Class JcrActiveLock
- java.lang.Object
 - 
- org.apache.jackrabbit.webdav.lock.AbstractActiveLock
 - 
- org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock
 
 
 
- 
- All Implemented Interfaces:
 DavConstants,ActiveLock,XmlSerializable
public class JcrActiveLock extends AbstractActiveLock implements ActiveLock, DavConstants
JcrActiveLockwraps aJCR lockobject. 
- 
- 
Field Summary
- 
Fields inherited from interface org.apache.jackrabbit.webdav.DavConstants
creationDateFormat, DEPTH_0, DEPTH_1, DEPTH_INFINITY, DEPTH_INFINITY_S, HEADER_AUTHORIZATION, HEADER_CONTENT_LANGUAGE, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_DAV, HEADER_DEPTH, HEADER_DESTINATION, HEADER_ETAG, HEADER_IF, HEADER_LAST_MODIFIED, HEADER_LOCK_TOKEN, HEADER_OVERWRITE, HEADER_TIMEOUT, INFINITE_TIMEOUT, modificationDateFormat, NAMESPACE, OPAQUE_LOCK_TOKEN_PREFIX, PROPERTY_CREATIONDATE, PROPERTY_DISPLAYNAME, PROPERTY_GETCONTENTLANGUAGE, PROPERTY_GETCONTENTLENGTH, PROPERTY_GETCONTENTTYPE, PROPERTY_GETETAG, PROPERTY_GETLASTMODIFIED, PROPERTY_LOCKDISCOVERY, PROPERTY_RESOURCETYPE, PROPERTY_SOURCE, PROPERTY_SUPPORTEDLOCK, PROPFIND_ALL_PROP, PROPFIND_ALL_PROP_INCLUDE, PROPFIND_BY_PROPERTY, PROPFIND_PROPERTY_NAMES, TIMEOUT_INFINITE, UNDEFINED_TIME, UNDEFINED_TIMEOUT, XML_ACTIVELOCK, XML_ALLPROP, XML_COLLECTION, XML_DEPTH, XML_DST, XML_EXCLUSIVE, XML_HREF, XML_INCLUDE, XML_KEEPALIVE, XML_LINK, XML_LOCKENTRY, XML_LOCKINFO, XML_LOCKROOT, XML_LOCKSCOPE, XML_LOCKTOKEN, XML_LOCKTYPE, XML_MULTISTATUS, XML_OMIT, XML_OWNER, XML_PROP, XML_PROPERTYBEHAVIOR, XML_PROPERTYUPDATE, XML_PROPFIND, XML_PROPNAME, XML_PROPSTAT, XML_REMOVE, XML_RESPONSE, XML_RESPONSEDESCRIPTION, XML_SET, XML_SHARED, XML_SOURCE, XML_STATUS, XML_TIMEOUT, XML_WRITE 
 - 
 
- 
Constructor Summary
Constructors Constructor Description JcrActiveLock(Lock lock) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetOwner()Return the name (or id) of the lock owner.ScopegetScope()Return the scope of this lock.longgetTimeout()Calculates the milliseconds of the timeout fromLock.getSecondsRemaining().StringgetToken()Return the lock token if theSessionthat obtained the lock is the lock token holder,nullotherwise.
NOTE: currently the token generated by the underlying JCR repository is not checked for compliance with RFC 2518 ("OpaqueLockToken-URI = "opaquelocktoken:" UUID [Extension] ; The UUID production is the string representation of a UUID, as defined in [ISO-11578].TypegetType()Always returnsType.WRITE.booleanisDeep()Return true if the lock is deep.booleanisExpired()Returns true, if this lock is already expired.booleanisLockedByToken(String lockToken)Return true if the given lock token equals the token holding that lock.voidsetIsDeep(boolean isDeep)Set the lock deepness.voidsetOwner(String owner)Set the name (or id) of the lock ownervoidsetTimeout(long timeout)ThrowsUnsupportedOperationException- 
Methods inherited from class org.apache.jackrabbit.webdav.lock.AbstractActiveLock
getLockroot, setLockroot, toXml 
- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface org.apache.jackrabbit.webdav.lock.ActiveLock
getLockroot, setLockroot 
- 
Methods inherited from interface org.apache.jackrabbit.webdav.xml.XmlSerializable
toXml 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
JcrActiveLock
public JcrActiveLock(Lock lock)
- Parameters:
 lock-
 
 - 
 
- 
Method Detail
- 
isLockedByToken
public boolean isLockedByToken(String lockToken)
Return true if the given lock token equals the token holding that lock.- Specified by:
 isLockedByTokenin interfaceActiveLock- Parameters:
 lockToken-- Returns:
 - true if the given lock token equals this locks token.
 - See Also:
 ActiveLock.isLockedByToken(String)
 
- 
isExpired
public boolean isExpired()
Description copied from interface:ActiveLockReturns true, if this lock is already expired.- Specified by:
 isExpiredin interfaceActiveLock- Returns:
 - true if the lock is expired
 - See Also:
 ActiveLock.isExpired()
 
- 
getToken
public String getToken()
Return the lock token if theSessionthat obtained the lock is the lock token holder,nullotherwise.
NOTE: currently the token generated by the underlying JCR repository is not checked for compliance with RFC 2518 ("OpaqueLockToken-URI = "opaquelocktoken:" UUID [Extension] ; The UUID production is the string representation of a UUID, as defined in [ISO-11578]. Note that white space (LWS) is not allowed between elements of this production.").In case of session-scoped JCR 2.0 locks, the token is never exposed even if the current session is lock holder. In order to cope with DAV specific requirements and the fulfill the requirement stated above, the node's identifier is subsequently exposed as DAV-token.
- Specified by:
 getTokenin interfaceActiveLock- Returns:
 - token string representing the lock token.
 - See Also:
 ActiveLock.getToken()
 
- 
getOwner
public String getOwner()
Description copied from interface:ActiveLockReturn the name (or id) of the lock owner.- Specified by:
 getOwnerin interfaceActiveLock- Returns:
 - name (or id) of the lock owner.
 - See Also:
 ActiveLock.getOwner()
 
- 
setOwner
public void setOwner(String owner)
Description copied from interface:ActiveLockSet the name (or id) of the lock owner- Specified by:
 setOwnerin interfaceActiveLock- See Also:
 ActiveLock.setOwner(String)
 
- 
getTimeout
public long getTimeout()
Calculates the milliseconds of the timeout fromLock.getSecondsRemaining(). If the timeout of jcr lock is undefined or infiniteDavConstants.INFINITE_TIMEOUTis returned.- Specified by:
 getTimeoutin interfaceActiveLock- Returns:
 - number of milliseconds.
 - See Also:
 ActiveLock.getTimeout()
 
- 
setTimeout
public void setTimeout(long timeout)
ThrowsUnsupportedOperationException- Specified by:
 setTimeoutin interfaceActiveLock- See Also:
 ActiveLock.setTimeout(long)
 
- 
isDeep
public boolean isDeep()
Description copied from interface:ActiveLockReturn true if the lock is deep.- Specified by:
 isDeepin interfaceActiveLock- Returns:
 - true if the lock is deep.
 - See Also:
 ActiveLock.isDeep()
 
- 
setIsDeep
public void setIsDeep(boolean isDeep)
Description copied from interface:ActiveLockSet the lock deepness.- Specified by:
 setIsDeepin interfaceActiveLock- See Also:
 ActiveLock.setIsDeep(boolean)
 
- 
getType
public Type getType()
Always returnsType.WRITE.- Specified by:
 getTypein interfaceActiveLock- Returns:
 Type.WRITE- See Also:
 ActiveLock.getType()
 
- 
getScope
public Scope getScope()
Description copied from interface:ActiveLockReturn the scope of this lock.- Specified by:
 getScopein interfaceActiveLock- Returns:
 - The scope of this lock, which may either by an 
exclusiveorexclusive session scopedlock. - See Also:
 ActiveLock.getScope()
 
 - 
 
 -