org.alfresco.repo.domain.locks
Class LockEntity

java.lang.Object
  extended by org.alfresco.repo.domain.locks.LockEntity

public class LockEntity
extends java.lang.Object

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

Field Summary
static java.lang.Long CONST_LONG_ZERO
           
 
Constructor Summary
LockEntity()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Long getExclusiveResourceId()
           
 java.lang.Long getExpiryTime()
           
 java.lang.Long getId()
           
 java.lang.String getLockToken()
           
 java.lang.Long getSharedResourceId()
           
 java.lang.Long getStartTime()
           
 java.lang.Long getVersion()
           
 boolean hasExpired()
           
 int hashCode()
           
 void incrementVersion()
          Increments the version number or resets it if it reaches a large number
 boolean isExclusive()
          Determine if the lock is logically exclusive.
 void setExclusiveResourceId(java.lang.Long exclusiveResourceId)
           
 void setExpiryTime(java.lang.Long expiryTime)
           
 void setId(java.lang.Long id)
           
 void setLockToken(java.lang.String lockToken)
           
 void setSharedResourceId(java.lang.Long sharedResourceId)
           
 void setStartTime(java.lang.Long startTime)
           
 void setVersion(java.lang.Long version)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CONST_LONG_ZERO

public static final java.lang.Long CONST_LONG_ZERO
Constructor Detail

LockEntity

public LockEntity()
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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

public java.lang.Long getId()

setId

public void setId(java.lang.Long id)

getVersion

public java.lang.Long getVersion()

setVersion

public void setVersion(java.lang.Long version)

incrementVersion

public void incrementVersion()
Increments the version number or resets it if it reaches a large number


getSharedResourceId

public java.lang.Long getSharedResourceId()
Returns:
Returns the ID of the shared lock resource

setSharedResourceId

public void setSharedResourceId(java.lang.Long sharedResourceId)
Parameters:
sharedResourceId - the ID of the shared lock resource

getExclusiveResourceId

public java.lang.Long getExclusiveResourceId()

setExclusiveResourceId

public void setExclusiveResourceId(java.lang.Long exclusiveResourceId)

getLockToken

public java.lang.String getLockToken()
Returns:
Returns the token assigned when the lock was created

setLockToken

public void setLockToken(java.lang.String lockToken)
Parameters:
lockToken - the token assigned when the lock was created

getStartTime

public java.lang.Long getStartTime()
Returns:
Returns the time when the lock was started

setStartTime

public void setStartTime(java.lang.Long startTime)

getExpiryTime

public java.lang.Long getExpiryTime()

setExpiryTime

public void setExpiryTime(java.lang.Long expiryTime)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.