@Override public boolean isLockable( Type type, Scope scope ) { return Type.WRITE.equals( type ) && Scope.EXCLUSIVE.equals( scope ); }
/** * Create a <code>Type</code> object from the given localName and namespace. * * @param localName * @param namespace * @return <code>Type</code> object. */ public static Type create(String localName, Namespace namespace) { String key = DomUtil.getExpandedName(localName, namespace); if (types.containsKey(key)) { return types.get(key); } else { Type type = new Type(localName, namespace); types.put(key, type); return type; } } }
/** * Create a <code>Type</code> object from the given Xml element. * * @param lockType * @return <code>Type</code> object. */ public static Type createFromXml(Element lockType) { if (lockType != null && DavConstants.XML_LOCKTYPE.equals(lockType.getLocalName())) { // we have the parent element and must retrieve the type first lockType = DomUtil.getFirstChildElement(lockType); } if (lockType == null) { throw new IllegalArgumentException("'null' is not valid lock type entry."); } Namespace namespace = Namespace.getNamespace(lockType.getPrefix(), lockType.getNamespaceURI()); return create(lockType.getLocalName(), namespace); }
/** * Returns the Xml representation of this <code>LockEntry</code>. * * @return Xml representation * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(Document) * @param document */ public Element toXml(Document document) { Element entry = DomUtil.createElement(document, XML_LOCKENTRY, NAMESPACE); entry.appendChild(getScope().toXml(document)); entry.appendChild(getType().toXml(document)); return entry; }
public Type getType() { return Type.createFromXml(DomUtil.getChildElement(alElement, XML_LOCKTYPE, NAMESPACE)); }
/** * Returns the Xml representation of this <code>LockEntry</code>. * * @return Xml representation * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(Document) * @param document */ public Element toXml(Document document) { Element entry = DomUtil.createElement(document, XML_LOCKENTRY, NAMESPACE); entry.appendChild(getScope().toXml(document)); entry.appendChild(getType().toXml(document)); return entry; }
public Type getType() { return Type.createFromXml(DomUtil.getChildElement(alElement, XML_LOCKTYPE, NAMESPACE)); }
/** * @param type * @param scope * @return true if type is {@link Type#WRITE} and scope is {@link Scope#EXCLUSIVE} * @see DavResource#isLockable(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope) */ public boolean isLockable(Type type, Scope scope) { return Type.WRITE.equals(type) && Scope.EXCLUSIVE.equals(scope); }
/** * Returns the Xml representation of this <code>LockEntry</code>. * * @return Xml representation * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(Document) * @param document */ public Element toXml(Document document) { Element entry = DomUtil.createElement(document, XML_LOCKENTRY, NAMESPACE); entry.appendChild(getScope().toXml(document)); entry.appendChild(getType().toXml(document)); return entry; }
public Type getType() { return Type.createFromXml(DomUtil.getChildElement(alElement, XML_LOCKTYPE, NAMESPACE)); }
/** * Create a <code>Type</code> object from the given localName and namespace. * * @param localName * @param namespace * @return <code>Type</code> object. */ public static Type create(String localName, Namespace namespace) { String key = DomUtil.getQualifiedName(localName, namespace); if (types.containsKey(key)) { return (Type) types.get(key); } else { Type type = new Type(localName, namespace); types.put(key, type); return type; } } }
/** * Create a <code>Type</code> object from the given Xml element. * * @param lockType * @return <code>Type</code> object. */ public static Type createFromXml(Element lockType) { if (lockType != null && DavConstants.XML_LOCKTYPE.equals(lockType.getLocalName())) { // we have the parent element and must retrieve the type first lockType = DomUtil.getFirstChildElement(lockType); } if (lockType == null) { throw new IllegalArgumentException("'null' is not valid lock type entry."); } Namespace namespace = Namespace.getNamespace(lockType.getPrefix(), lockType.getNamespaceURI()); return create(lockType.getLocalName(), namespace); }
/** * @see DavResource#getLock(Type, Scope) */ @Override public ActiveLock getLock(Type type, Scope scope) { ActiveLock lock = null; if (TransactionConstants.TRANSACTION.equals(type)) { lock = txMgr.getLock(type, scope, this); } return lock; }
/** * Returns the xml representation of this lock info.<br> * NOTE however, that the depth and the timeout are not included * in the xml. They will be passed to the server using the corresponding * request headers. * * @param document * @return xml representation of this lock info. * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(Document) */ public Element toXml(Document document) { if (isRefreshLock) { return null; } else { Element lockInfo = DomUtil.createElement(document, XML_LOCKINFO, NAMESPACE); lockInfo.appendChild(scope.toXml(document)); lockInfo.appendChild(type.toXml(document)); if (owner != null) { DomUtil.addChildElement(lockInfo, XML_OWNER, NAMESPACE, owner); } return lockInfo; } }
String childName = child.getLocalName(); if (XML_LOCKTYPE.equals(childName)) { type = Type.createFromXml(child); } else if (XML_LOCKSCOPE.equals(childName)) { scope = Scope.createFromXml(child);
/** * Create a <code>Type</code> object from the given localName and namespace. * * @param localName * @param namespace * @return <code>Type</code> object. */ public static Type create(String localName, Namespace namespace) { String key = DomUtil.getExpandedName(localName, namespace); if (types.containsKey(key)) { return types.get(key); } else { Type type = new Type(localName, namespace); types.put(key, type); return type; } } }
/** * Create a <code>Type</code> object from the given Xml element. * * @param lockType * @return <code>Type</code> object. */ public static Type createFromXml(Element lockType) { if (lockType != null && DavConstants.XML_LOCKTYPE.equals(lockType.getLocalName())) { // we have the parent element and must retrieve the type first lockType = DomUtil.getFirstChildElement(lockType); } if (lockType == null) { throw new IllegalArgumentException("'null' is not valid lock type entry."); } Namespace namespace = Namespace.getNamespace(lockType.getPrefix(), lockType.getNamespaceURI()); return create(lockType.getLocalName(), namespace); }
@Override public boolean isLockable(Type type, Scope scope) { return Type.WRITE.equals(type) && Scope.EXCLUSIVE.equals(scope); }
/** * Returns the xml representation of this lock info.<br> * NOTE however, that the depth and the timeout are not included * in the xml. They will be passed to the server using the corresponding * request headers. * * @param document * @return xml representation of this lock info. * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(Document) */ public Element toXml(Document document) { if (isRefreshLock) { return null; } else { Element lockInfo = DomUtil.createElement(document, XML_LOCKINFO, NAMESPACE); lockInfo.appendChild(scope.toXml(document)); lockInfo.appendChild(type.toXml(document)); if (owner != null) { DomUtil.addChildElement(lockInfo, XML_OWNER, NAMESPACE, owner); } return lockInfo; } }
String childName = child.getLocalName(); if (XML_LOCKTYPE.equals(childName)) { type = Type.createFromXml(child); } else if (XML_LOCKSCOPE.equals(childName)) { scope = Scope.createFromXml(child);