Package org.alfresco.repo.webdav
Interface LockInfo
public interface LockInfo
Interface to represent WebDAV lock info. This interface mainly exists to allow decoupling of the LockStore classes from the rest of the WebDAV code base therefore allowing the LockStore related classes to live in the repository project without creating a dependency on the remote-api project.
- Author:
- Matt Ward
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddSharedLockToken(String token) Adds new shared lock token to sharedLockTokens list.getDepth()Returns lock depthGetter for exclusive lock token.Retrieve the expiry date/time for this lock, or null if it never expires.getOwner()Retrieves the username of the lock owner.longRetrieve the remaining time before the lock expires, in secondsgetScope()Returns lock scopeGetter for sharedLockTokens list.booleanIs it an exclusive lock?booleanWhether this lock has expired.booleanisLocked()Returns true if node has shared or exclusive locksbooleanisShared()Is it a shared lock?voidSetter for lock depthvoidsetExclusiveLockToken(String token) Setter for exclusive lock tokenvoidsetExpires(Date expires) Set the expiry date/time for this lock.voidSet the username of who owns the lock.voidSetter for lock scope.voidsetSharedLockTokens(Set<String> sharedLockTokens) Setter for sharedLockTokens list.voidsetTimeoutMinutes(int lockTimeoutMins) Sets the expiry date/time to lockTimeout minutes into the future.voidsetTimeoutSeconds(int lockTimeoutSecs) Sets the expiry date/time to lockTimeout seconds into the future.toJSON()Return the lock info as a JSON string
-
Method Details
-
isLocked
boolean isLocked()Returns true if node has shared or exclusive locks- Returns:
- boolean
-
setExclusiveLockToken
Setter for exclusive lock token- Parameters:
token- Lock token
-
getExclusiveLockToken
String getExclusiveLockToken()Getter for exclusive lock token.- Returns:
- String
-
setScope
Setter for lock scope.- Parameters:
scope- String
-
getScope
String getScope()Returns lock scope- Returns:
- lock scope
-
setDepth
Setter for lock depth- Parameters:
depth- lock depth
-
getDepth
String getDepth()Returns lock depth- Returns:
- lock depth
-
toJSON
String toJSON()Return the lock info as a JSON string- Returns:
- String
-
isExpired
boolean isExpired()Whether this lock has expired. If no expiry is set (i.e. expires is null) then false is always returned.- Returns:
- true if expired.
-
isExclusive
boolean isExclusive()Is it an exclusive lock?- Returns:
- true if exclusive.
-
getOwner
String getOwner()Retrieves the username of the lock owner.- Returns:
- the owner
-
setOwner
Set the username of who owns the lock.- Parameters:
owner- Owner's username
-
setExpires
Set the expiry date/time for this lock. Set to null for never expires.- Parameters:
expires- the expires to set
-
getExpires
Date getExpires()Retrieve the expiry date/time for this lock, or null if it never expires.- Returns:
- the expires
-
getRemainingTimeoutSeconds
long getRemainingTimeoutSeconds()Retrieve the remaining time before the lock expires, in seconds- Returns:
- long
-
setTimeoutSeconds
void setTimeoutSeconds(int lockTimeoutSecs) Sets the expiry date/time to lockTimeout seconds into the future. Provide a lockTimeout of WebDAV.TIMEOUT_INFINITY for never expires.- Parameters:
lockTimeoutSecs- int
-
setTimeoutMinutes
void setTimeoutMinutes(int lockTimeoutMins) Sets the expiry date/time to lockTimeout minutes into the future. Provide a lockTimeout of WebDAV.TIMEOUT_INFINITY for never expires.- Parameters:
lockTimeoutMins- int
-