public class DefaultActiveLock extends AbstractActiveLock
DefaultActiveLock
implements the ActiveLock
interface
and represents an exclusive write lock with a random uuid lock token.
Lock owner, timeout and depth is retrieved from the LockInfo
object
passed in the constructor. If the lockinfo is null, the following default
values are set:- timeout is set to infinity. - isDeep is set to true.
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 |
---|
DefaultActiveLock()
Create a new
DefaultActiveLock with default values. |
DefaultActiveLock(LockInfo lockInfo)
Create a new lock
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getOwner()
Return the name (or id) of the lock owner.
|
Scope |
getScope()
This is always an exclusive lock.
|
long |
getTimeout()
Return the number of milliseconds the lock will live until it is expired
or -1 if the timeout is not available (or the client is not allowed
to retrieve it).
|
java.lang.String |
getToken()
Return the lock token.
|
Type |
getType()
This is always a write lock.
|
boolean |
isDeep()
Return true if the lock is deep.
|
boolean |
isExpired()
Returns true, if this lock is already expired.
|
boolean |
isLockedByToken(java.lang.String lockToken)
Return true, if the given token matches the lock token present in this
lock thus indicating that any lock relevant operation should not fail
due to a lock.
|
void |
setIsDeep(boolean isDeep)
Set the lock deepness.
|
void |
setOwner(java.lang.String owner)
Set the name (or id) of the lock owner
|
void |
setTimeout(long timeout)
Defines the number of milliseconds until the timeout is reached.
|
getLockroot, setLockroot, toXml
public DefaultActiveLock()
DefaultActiveLock
with default values.public DefaultActiveLock(LockInfo lockInfo)
lockInfo
- java.lang.IllegalArgumentException
- if either scope or type is invalid.public boolean isLockedByToken(java.lang.String lockToken)
ActiveLock
lockToken
- to be checkedActiveLock.isLockedByToken(String)
public boolean isExpired()
ActiveLock
ActiveLock.isExpired()
public java.lang.String getToken()
ActiveLock
ActiveLock.getToken()
public java.lang.String getOwner()
ActiveLock
ActiveLock.getOwner()
public void setOwner(java.lang.String owner)
ActiveLock
ActiveLock.setOwner(String)
public long getTimeout()
ActiveLock
ActiveLock.getTimeout()
public void setTimeout(long timeout)
ActiveLock
ActiveLock.setTimeout(long)
public boolean isDeep()
ActiveLock
ActiveLock.isDeep()
public void setIsDeep(boolean isDeep)
ActiveLock
ActiveLock.setIsDeep(boolean)
public Type getType()
Type.WRITE
public Scope getScope()
Scope.EXCLUSIVE
Copyright © 2010 - 2020 Adobe. All Rights Reserved