public class LockInfoImpl
extends java.lang.Object
implements java.io.Serializable, org.alfresco.repo.webdav.LockInfo
LockStore. Clients of this
class are expected to synchronise externally using the provided
ReentrantReadWriteLock (use LockInfoImpl.getRWLock()).| Constructor and Description |
|---|
LockInfoImpl()
Default constructor
|
LockInfoImpl(java.lang.String token,
java.lang.String scope,
java.lang.String depth)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSharedLockToken(java.lang.String token)
Adds new shared lock token to sharedLockTokens list.
|
protected java.util.Date |
dateNow()
Hook to allow unit testing - gets the current date/time.
|
java.lang.String |
getDepth()
Returns lock depth
|
java.lang.String |
getExclusiveLockToken()
Getter for exclusive lock token.
|
java.util.Date |
getExpires()
Retrieve the expiry date/time for this lock, or null if it never expires.
|
java.lang.String |
getOwner()
Who owns the lock?
|
long |
getRemainingTimeoutSeconds()
Remaining time before lock expires, in seconds.
|
java.util.concurrent.locks.ReentrantReadWriteLock |
getRWLock()
Retrieves the
ReentrantReadWriteLock associated with this LockInfo. |
java.lang.String |
getScope()
Returns lock scope
|
java.util.Set |
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(java.lang.String depth)
Setter for lock depth
|
void |
setExclusiveLockToken(java.lang.String token)
Setter for exclusive lock token
|
void |
setExpires(java.util.Date expires)
Set the expiry date/time for this lock.
|
void |
setOwner(java.lang.String owner)
Set the username of who owns the lock.
|
void |
setScope(java.lang.String scope)
Setter for lock scope.
|
void |
setSharedLockTokens(java.util.Set 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.
|
java.lang.String |
toString()
Return the lock info as a string
|
public LockInfoImpl()
public LockInfoImpl(java.lang.String token,
java.lang.String scope,
java.lang.String depth)
token - Exclusive lock tokenscope - Lock scope (shared/exclusive)depth - Lock depth (0/infinity)public java.util.concurrent.locks.ReentrantReadWriteLock getRWLock()
ReentrantReadWriteLock associated with this LockInfo. This is
to allow client code to protect against invalid concurrent access to the state of
this class.
Not to be confused with WebDAV locks.
getRWLock in interface org.alfresco.repo.webdav.LockInfopublic boolean isLocked()
isLocked in interface org.alfresco.repo.webdav.LockInfopublic void setExclusiveLockToken(java.lang.String token)
setExclusiveLockToken in interface org.alfresco.repo.webdav.LockInfotoken - Lock tokenpublic java.lang.String getExclusiveLockToken()
getExclusiveLockToken in interface org.alfresco.repo.webdav.LockInfopublic void setScope(java.lang.String scope)
setScope in interface org.alfresco.repo.webdav.LockInfoscope - public java.lang.String getScope()
getScope in interface org.alfresco.repo.webdav.LockInfopublic void setDepth(java.lang.String depth)
setDepth in interface org.alfresco.repo.webdav.LockInfodepth - lock depthpublic java.lang.String getDepth()
getDepth in interface org.alfresco.repo.webdav.LockInfopublic java.util.Set getSharedLockTokens()
getSharedLockTokens in interface org.alfresco.repo.webdav.LockInfopublic void setSharedLockTokens(java.util.Set sharedLockTokens)
setSharedLockTokens in interface org.alfresco.repo.webdav.LockInfosharedLockTokens - public void addSharedLockToken(java.lang.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 java.lang.String toString()
toString in interface org.alfresco.repo.webdav.LockInfotoString in class java.lang.Objectpublic boolean isExpired()
isExpired in interface org.alfresco.repo.webdav.LockInfopublic boolean isExclusive()
isExclusive in interface org.alfresco.repo.webdav.LockInfopublic java.lang.String getOwner()
getOwner in interface org.alfresco.repo.webdav.LockInfopublic void setOwner(java.lang.String owner)
setOwner in interface org.alfresco.repo.webdav.LockInfoowner - Owner's usernamepublic void setExpires(java.util.Date expires)
setExpires in interface org.alfresco.repo.webdav.LockInfoexpires - the expires to setpublic java.util.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 - public void setTimeoutMinutes(int lockTimeoutMins)
setTimeoutMinutes in interface org.alfresco.repo.webdav.LockInfolockTimeoutMins - protected java.util.Date dateNow()
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.