public class LockInfoImpl extends Object implements Serializable, org.alfresco.repo.webdav.LockInfo
LockStore. Clients of this
class are expected to synchronise externally using the provided
ReentrantReadWriteLock.| Modifier and Type | Field and Description |
|---|---|
static String |
ADDINFO_WEBDAV_MARKER |
| Constructor and Description |
|---|
LockInfoImpl()
Default constructor
|
LockInfoImpl(String token,
String scope,
String depth)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSharedLockToken(String token)
Adds new shared lock token to sharedLockTokens list.
|
protected Date |
dateNow()
Hook to allow unit testing - gets the current date/time.
|
static org.alfresco.repo.webdav.LockInfo |
fromJSON(String json) |
String |
getDepth()
Returns lock depth
|
String |
getExclusiveLockToken()
Getter for exclusive lock token.
|
Date |
getExpires()
Retrieve the expiry date/time for this lock, or null if it never expires.
|
String |
getOwner()
Who owns the lock?
|
long |
getRemainingTimeoutSeconds()
Remaining time before lock expires, in seconds.
|
String |
getScope()
Returns lock scope
|
Set<String> |
getSharedLockTokens()
Getter for sharedLockTokens list.
|
boolean |
isExclusive()
Is it an exclusive lock?
|
boolean |
isExpired()
Whether this lock has expired.
|
boolean |
isLocked()
Returns true if node has shared or exclusive locks
|
boolean |
isShared()
Is it a shared lock?
|
void |
setDepth(String depth)
Setter for lock depth
|
void |
setExclusiveLockToken(String token)
Setter for exclusive lock token
|
void |
setExpires(Date expires)
Set the expiry date/time for this lock.
|
void |
setOwner(String owner)
Set the username of who owns the lock.
|
void |
setScope(String scope)
Setter for lock scope.
|
void |
setSharedLockTokens(Set<String> sharedLockTokens)
Setter for sharedLockTokens list.
|
void |
setTimeoutMinutes(int lockTimeoutMins)
Sets the expiry date/time to lockTimeout minutes into the future.
|
void |
setTimeoutSeconds(int lockTimeoutSecs)
Sets the expiry date/time to lockTimeout seconds into the future.
|
String |
toJSON() |
String |
toString()
Return the lock info as a string
|
public static final String ADDINFO_WEBDAV_MARKER
public boolean isLocked()
isLocked in interface org.alfresco.repo.webdav.LockInfopublic void setExclusiveLockToken(String token)
setExclusiveLockToken in interface org.alfresco.repo.webdav.LockInfotoken - Lock tokenpublic String getExclusiveLockToken()
getExclusiveLockToken in interface org.alfresco.repo.webdav.LockInfopublic void setScope(String scope)
setScope in interface org.alfresco.repo.webdav.LockInfoscope - Stringpublic String getScope()
getScope in interface org.alfresco.repo.webdav.LockInfopublic void setDepth(String depth)
setDepth in interface org.alfresco.repo.webdav.LockInfodepth - lock depthpublic String getDepth()
getDepth in interface org.alfresco.repo.webdav.LockInfopublic Set<String> getSharedLockTokens()
getSharedLockTokens in interface org.alfresco.repo.webdav.LockInfopublic void setSharedLockTokens(Set<String> sharedLockTokens)
setSharedLockTokens in interface org.alfresco.repo.webdav.LockInfopublic void addSharedLockToken(String token)
addSharedLockToken in interface org.alfresco.repo.webdav.LockInfotoken - The token to add.public boolean isShared()
isShared in interface org.alfresco.repo.webdav.LockInfopublic String toString()
public String toJSON()
toJSON in interface org.alfresco.repo.webdav.LockInfopublic static org.alfresco.repo.webdav.LockInfo fromJSON(String json)
public boolean isExpired()
isExpired in interface org.alfresco.repo.webdav.LockInfopublic boolean isExclusive()
isExclusive in interface org.alfresco.repo.webdav.LockInfopublic String getOwner()
getOwner in interface org.alfresco.repo.webdav.LockInfopublic void setOwner(String owner)
setOwner in interface org.alfresco.repo.webdav.LockInfoowner - Owner's usernamepublic void setExpires(Date expires)
setExpires in interface org.alfresco.repo.webdav.LockInfoexpires - the expires to setpublic Date getExpires()
getExpires in interface org.alfresco.repo.webdav.LockInfopublic long getRemainingTimeoutSeconds()
getRemainingTimeoutSeconds in interface org.alfresco.repo.webdav.LockInfopublic void setTimeoutSeconds(int lockTimeoutSecs)
setTimeoutSeconds in interface org.alfresco.repo.webdav.LockInfolockTimeoutSecs - intpublic void setTimeoutMinutes(int lockTimeoutMins)
setTimeoutMinutes in interface org.alfresco.repo.webdav.LockInfolockTimeoutMins - intprotected Date dateNow()
Copyright © 2005–2018 Alfresco Software. All rights reserved.