Package org.alfresco.repo.webdav
Interface LockInfo
-
public interface LockInfoInterface 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddSharedLockToken(java.lang.String token)Adds new shared lock token to sharedLockTokens list.java.lang.StringgetDepth()Returns lock depthjava.lang.StringgetExclusiveLockToken()Getter for exclusive lock token.java.util.DategetExpires()Retrieve the expiry date/time for this lock, or null if it never expires.java.lang.StringgetOwner()Retrieves the username of the lock owner.longgetRemainingTimeoutSeconds()Retrieve the remaining time before the lock expires, in secondsjava.lang.StringgetScope()Returns lock scopejava.util.Set<java.lang.String>getSharedLockTokens()Getter for sharedLockTokens list.booleanisExclusive()Is it an exclusive lock?booleanisExpired()Whether this lock has expired.booleanisLocked()Returns true if node has shared or exclusive locksbooleanisShared()Is it a shared lock?voidsetDepth(java.lang.String depth)Setter for lock depthvoidsetExclusiveLockToken(java.lang.String token)Setter for exclusive lock tokenvoidsetExpires(java.util.Date expires)Set the expiry date/time for this lock.voidsetOwner(java.lang.String owner)Set the username of who owns the lock.voidsetScope(java.lang.String scope)Setter for lock scope.voidsetSharedLockTokens(java.util.Set<java.lang.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.java.lang.StringtoJSON()Return the lock info as a JSON string
-
-
-
Method Detail
-
isLocked
boolean isLocked()
Returns true if node has shared or exclusive locks- Returns:
- boolean
-
setExclusiveLockToken
void setExclusiveLockToken(java.lang.String token)
Setter for exclusive lock token- Parameters:
token- Lock token
-
getExclusiveLockToken
java.lang.String getExclusiveLockToken()
Getter for exclusive lock token.- Returns:
- String
-
setScope
void setScope(java.lang.String scope)
Setter for lock scope.- Parameters:
scope- String
-
getScope
java.lang.String getScope()
Returns lock scope- Returns:
- lock scope
-
setDepth
void setDepth(java.lang.String depth)
Setter for lock depth- Parameters:
depth- lock depth
-
getDepth
java.lang.String getDepth()
Returns lock depth- Returns:
- lock depth
-
getSharedLockTokens
java.util.Set<java.lang.String> getSharedLockTokens()
Getter for sharedLockTokens list.
-
setSharedLockTokens
void setSharedLockTokens(java.util.Set<java.lang.String> sharedLockTokens)
Setter for sharedLockTokens list.
-
addSharedLockToken
void addSharedLockToken(java.lang.String token)
Adds new shared lock token to sharedLockTokens list.- Parameters:
token- The token to add.
-
isShared
boolean isShared()
Is it a shared lock?- Returns:
- true if shared.
-
toJSON
java.lang.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
java.lang.String getOwner()
Retrieves the username of the lock owner.- Returns:
- the owner
-
setOwner
void setOwner(java.lang.String owner)
Set the username of who owns the lock.- Parameters:
owner- Owner's username
-
setExpires
void setExpires(java.util.Date expires)
Set the expiry date/time for this lock. Set to null for never expires.- Parameters:
expires- the expires to set
-
getExpires
java.util.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
-
-