com.waveset.object
Class LockInfo

java.lang.Object
  extended bycom.waveset.object.LockInfo

public class LockInfo
extends java.lang.Object

Hides the structure of logical lock information.


Field Summary
static java.lang.String code_id
           
protected static java.lang.String LOCK_INFO_SEP
           
static int MAX_LOCKED_BY_LENGTH
           
 
Constructor Summary
LockInfo(java.lang.String lockInfoString)
          Constructs a LockInfo object using a string value (typically obtained from a data store).
LockInfo(java.lang.String lockedBy, long timeoutMillis)
          Constructs a LockInfo object using the specified values.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getLockedBy()
          Who owns this lock?
 long getTimeoutTime()
          When will this lock expire?
 boolean isExpired()
          Is this item lock expired?
 boolean isLocked()
          Is this item locked?
 boolean isLockedBy(java.lang.String lockedBy)
          Is this item locked by a specific caller?
 java.lang.String toString()
          Render this LockInfo object as a string in a format suitable for storage as a property value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

LOCK_INFO_SEP

protected static final java.lang.String LOCK_INFO_SEP
See Also:
Constant Field Values

MAX_LOCKED_BY_LENGTH

public static final int MAX_LOCKED_BY_LENGTH
See Also:
Constant Field Values
Constructor Detail

LockInfo

public LockInfo(java.lang.String lockedBy,
                long timeoutMillis)
Constructs a LockInfo object using the specified values.

Parameters:
lockedBy - - a string identifying the caller

LockInfo

public LockInfo(java.lang.String lockInfoString)
         throws InvalidArgument
Constructs a LockInfo object using a string value (typically obtained from a data store). NOTE: Protected. Not intended for client use.

Method Detail

toString

public java.lang.String toString()
Render this LockInfo object as a string in a format suitable for storage as a property value.


equals

public boolean equals(java.lang.Object o)

isExpired

public boolean isExpired()
Is this item lock expired?

Returns:
true if lock is expired; otherwise false

isLocked

public boolean isLocked()
Is this item locked?

Returns:
true if item is locked; otherwise false

isLockedBy

public boolean isLockedBy(java.lang.String lockedBy)
Is this item locked by a specific caller?

Returns:
true if item is locked by the specified caller; otherwise false

getLockedBy

public java.lang.String getLockedBy()
Who owns this lock?

Returns:
a string identifying the caller who created this lock

getTimeoutTime

public long getTimeoutTime()
When will this lock expire?

Returns:
the time this lock will expire.