org.outerj.daisy.repository
Interface LockInfo


public interface LockInfo

Provides information about a lock on a document variant.

If the method hasLock() returns false, there is no lock on the document and the output of the other methods is irrelevant and unspecified.

Note that so called "optimistic locking" always happens automatically, next to this explicit locking facility.


Method Summary
 long getDuration()
          Gets the duration of the lock, in milliseconds.
 java.util.Date getTimeAcquired()
          Get the time when the lock was acquired.
 LockType getType()
          Get the type of lock.
 long getUserId()
          Get the id of the user holding the lock.
 org.outerx.daisy.x10.LockInfoDocument getXml()
          Get an XML document describing this lock.
 boolean hasLock()
           
 

Method Detail

hasLock

public boolean hasLock()

getUserId

public long getUserId()
Get the id of the user holding the lock.


getTimeAcquired

public java.util.Date getTimeAcquired()
Get the time when the lock was acquired.


getDuration

public long getDuration()
Gets the duration of the lock, in milliseconds. This is the total duration, to be counted from the time this lock was acquired, NOT the remaining duration. This can be -1, meaning the lock does never expire.


getType

public LockType getType()
Get the type of lock. See Document.lock(long, LockType) for more info on the type of locks.


getXml

public org.outerx.daisy.x10.LockInfoDocument getXml()
Get an XML document describing this lock.



Copyright © -2005 . All Rights Reserved.