Package org.alfresco.repo.domain.locks
Class LockEntity
java.lang.Object
org.alfresco.repo.domain.locks.LockEntity
Entity bean for alf_lock table.
These are unique (see equals and hashCode) based on the shared and exclusive resource ID combination.
- Since:
- 3.2
- Author:
- Derek Hulley
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetId()booleaninthashCode()voidIncrements the version number or resets it if it reaches a large numberbooleanDetermine if the lock is logically exclusive.voidsetExclusiveResourceId(Long exclusiveResourceId) voidsetExpiryTime(Long expiryTime) voidvoidsetLockToken(String lockToken) voidsetSharedResourceId(Long sharedResourceId) voidsetStartTime(Long startTime) voidsetVersion(Long version) toString()
-
Field Details
-
CONST_LONG_ZERO
-
-
Constructor Details
-
LockEntity
public LockEntity()
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
toString
-
isExclusive
public boolean isExclusive()Determine if the lock is logically exclusive. A lock is exclusive if the shared lock resource matches the exclusive lock resource.- Returns:
- Returns true if the lock is exclusive or false if it is not
-
hasExpired
public boolean hasExpired() -
getId
-
setId
-
getVersion
-
setVersion
-
incrementVersion
public void incrementVersion()Increments the version number or resets it if it reaches a large number -
getExclusiveResourceId
-
setExclusiveResourceId
-
getLockToken
- Returns:
- Returns the token assigned when the lock was created
-
setLockToken
- Parameters:
lockToken- the token assigned when the lock was created
-
getStartTime
- Returns:
- Returns the time when the lock was started
-
setStartTime
-
getExpiryTime
-
setExpiryTime
-