public class JcrActiveLock extends AbstractActiveLock implements ActiveLock, DavConstants
JcrActiveLock
wraps a JCR lock
object.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 and Description |
---|
JcrActiveLock(Lock lock)
|
Modifier and Type | Method and Description |
---|---|
String |
getOwner()
Return the name (or id) of the lock owner.
|
Scope |
getScope()
Return the scope of this lock.
|
long |
getTimeout()
Calculates the milliseconds of the timeout from
Lock.getSecondsRemaining() . |
String |
getToken()
Return the lock token if the
Session that obtained the lock
is the lock token holder, null otherwise.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]. |
Type |
getType()
Always returns
Type.WRITE . |
boolean |
isDeep()
Return true if the lock is deep.
|
boolean |
isExpired()
Returns true, if this lock is already expired.
|
boolean |
isLockedByToken(String lockToken)
Return true if the given lock token equals the token holding that lock.
|
void |
setIsDeep(boolean isDeep)
Set the lock deepness.
|
void |
setOwner(String owner)
Set the name (or id) of the lock owner
|
void |
setTimeout(long timeout)
Throws
UnsupportedOperationException |
getLockroot, setLockroot, toXml
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLockroot, setLockroot
toXml
public JcrActiveLock(Lock lock)
lock
- public boolean isLockedByToken(String lockToken)
isLockedByToken
in interface ActiveLock
lockToken
- ActiveLock.isLockedByToken(String)
public boolean isExpired()
ActiveLock
isExpired
in interface ActiveLock
ActiveLock.isExpired()
public String getToken()
Session
that obtained the lock
is the lock token holder, null
otherwise.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.
getToken
in interface ActiveLock
ActiveLock.getToken()
public String getOwner()
ActiveLock
getOwner
in interface ActiveLock
ActiveLock.getOwner()
public void setOwner(String owner)
ActiveLock
setOwner
in interface ActiveLock
ActiveLock.setOwner(String)
public long getTimeout()
Lock.getSecondsRemaining()
. If the timeout of
jcr lock is undefined or infinite DavConstants.INFINITE_TIMEOUT
is
returned.getTimeout
in interface ActiveLock
ActiveLock.getTimeout()
public void setTimeout(long timeout)
UnsupportedOperationException
setTimeout
in interface ActiveLock
ActiveLock.setTimeout(long)
public boolean isDeep()
ActiveLock
isDeep
in interface ActiveLock
ActiveLock.isDeep()
public void setIsDeep(boolean isDeep)
ActiveLock
setIsDeep
in interface ActiveLock
ActiveLock.setIsDeep(boolean)
public Type getType()
Type.WRITE
.getType
in interface ActiveLock
Type.WRITE
ActiveLock.getType()
public Scope getScope()
ActiveLock
getScope
in interface ActiveLock
exclusive
or exclusive session scoped
lock.ActiveLock.getScope()
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.