org.apache.slide.lock
Class NodeLock

java.lang.Object
  extended byorg.apache.slide.lock.NodeLock
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public final class NodeLock
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

NodeLock class.

Version:
$Revision: 1.18 $
See Also:
Serialized Form

Field Summary
static int EXCLUSIVE
           
protected  java.util.Date expirationDate
          Expiration date of the lock.
protected  boolean inheritance
          Lock is inheritable.
static int LOCAL
           
protected  java.lang.String lockId
          Lock Id.
protected  java.lang.String objectUri
          Locked object.
protected  java.lang.String ownerInfo
          Contacting information about the lock owner
protected  int scope
          Lock scope.
static int SHARED
           
protected  java.lang.String subjectUri
          User who is the lock owner.
protected  java.lang.String typeUri
          Lock type.
 
Constructor Summary
NodeLock()
          Constructor.
NodeLock(NodeLock lock, java.lang.String typeUri)
          Constructor.
NodeLock(ObjectNode locked, SubjectNode user, ActionNode lockType, java.util.Date expirationDate, boolean inheritance)
          Constructor.
NodeLock(ObjectNode locked, SubjectNode user, ActionNode lockType, java.util.Date expirationDate, boolean inheritance, boolean exclusive)
          Constructor.
NodeLock(ObjectNode locked, SubjectNode user, ActionNode lockType, java.util.Date expirationDate, boolean inheritance, boolean exclusive, java.lang.String ownerInfo)
          Constructor.
NodeLock(java.lang.String objectUri, java.lang.String subjectUri, java.lang.String typeUri, java.util.Date expirationDate, boolean inheritance)
          Constructor.
NodeLock(java.lang.String objectUri, java.lang.String subjectUri, java.lang.String typeUri, java.util.Date expirationDate, boolean inheritance, boolean exclusive)
          Constructor.
NodeLock(java.lang.String objectUri, java.lang.String subjectUri, java.lang.String typeUri, java.util.Date expirationDate, boolean inheritance, boolean exclusive, java.lang.String ownerInfo)
          Constructor.
NodeLock(java.lang.String objectUri, java.lang.String subjectUri, java.lang.String typeUri, java.util.Date expirationDate, boolean inheritance, int scope, java.lang.String ownerInfo)
           
NodeLock(java.lang.String lockId, java.lang.String objectUri, java.lang.String subjectUri, java.lang.String typeUri, java.util.Date expirationDate, boolean inheritance, boolean exclusive)
          Constructor.
NodeLock(java.lang.String lockId, java.lang.String objectUri, java.lang.String subjectUri, java.lang.String typeUri, java.util.Date expirationDate, boolean inheritance, boolean exclusive, java.lang.String ownerInfo)
          Constructor.
NodeLock(java.lang.String lockId, java.lang.String objectUri, java.lang.String subjectUri, java.lang.String typeUri, java.util.Date expirationDate, boolean inheritance, int scope, java.lang.String ownerInfo)
           
 
Method Summary
 NodeLock cloneObject()
          Clone.
 boolean equals(java.lang.Object obj)
          Equals.
 java.util.Date getExpirationDate()
          Expiration date accessor.
 java.lang.String getLockId()
          Get lock identifier.
 java.lang.String getObjectUri()
          Locked object accessor.
 java.lang.String getOwnerInfo()
          Get the contacting info for the lock owner (phone, email, etc.)
 java.lang.String getSubjectUri()
          Lock owner uri accessor.
 java.lang.String getTypeUri()
          Lock type uri accessor.
 boolean hasExpired()
          Expiration test.
 boolean isExclusive()
          Exclusive flag accessor.
 boolean isInheritable()
          Inheritance flag accessor.
 boolean isLocal()
          Exclusive flag accessor.
 boolean isShared()
          Exclusive flag accessor.
(package private)  void setExclusive(boolean exclusive)
          Exclusive flag mutator.
(package private)  void setExpirationDate(java.util.Date expirationDate)
          Expiration date mutator.
(package private)  void setInheritable(boolean inheritance)
          Inheritance flag mutator.
 void setObjectUri(java.lang.String objectUri)
          Locked object mutator.
 void setOwnerInfo(java.lang.String ownerInfo)
          Set the contacting info for the lock owner (phone, email, etc.)
(package private)  void setSubjectUri(java.lang.String subjectUri)
          Lock owner uri mutator.
(package private)  void setTypeUri(java.lang.String typeUri)
          Lock type mutator.
 void validate(java.lang.String expectedUri)
          Validate.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHARED

public static final int SHARED
See Also:
Constant Field Values

EXCLUSIVE

public static final int EXCLUSIVE
See Also:
Constant Field Values

LOCAL

public static final int LOCAL
See Also:
Constant Field Values

objectUri

protected java.lang.String objectUri
Locked object.


subjectUri

protected java.lang.String subjectUri
User who is the lock owner.


typeUri

protected java.lang.String typeUri
Lock type.


expirationDate

protected java.util.Date expirationDate
Expiration date of the lock.


inheritance

protected boolean inheritance
Lock is inheritable.


scope

protected int scope
Lock scope.


lockId

protected java.lang.String lockId
Lock Id.


ownerInfo

protected java.lang.String ownerInfo
Contacting information about the lock owner

Constructor Detail

NodeLock

public NodeLock()
Constructor.


NodeLock

public NodeLock(ObjectNode locked,
                SubjectNode user,
                ActionNode lockType,
                java.util.Date expirationDate,
                boolean inheritance)
Constructor.

Parameters:
locked - Locked object
user - Lock owner
lockType - Type of the lock
expirationDate - Date of expiration of the lock
inheritance - True if lock is inheritable

NodeLock

public NodeLock(ObjectNode locked,
                SubjectNode user,
                ActionNode lockType,
                java.util.Date expirationDate,
                boolean inheritance,
                boolean exclusive)
Constructor.

Parameters:
locked - Locked object
user - Lock owner
lockType - Type of the lock
expirationDate - Date of expiration of the lock
inheritance - True if lock is inheritable

NodeLock

public NodeLock(ObjectNode locked,
                SubjectNode user,
                ActionNode lockType,
                java.util.Date expirationDate,
                boolean inheritance,
                boolean exclusive,
                java.lang.String ownerInfo)
Constructor.

Parameters:
locked - Locked object
user - Lock owner
lockType - Type of the lock
expirationDate - Date of expiration of the lock
inheritance - True if lock is inheritable

NodeLock

public NodeLock(java.lang.String objectUri,
                java.lang.String subjectUri,
                java.lang.String typeUri,
                java.util.Date expirationDate,
                boolean inheritance)
Constructor.

Parameters:
objectUri - Locked object uri
subjectUri - Lock owner uri
typeUri - Lock type uri
expirationDate - Date of expiration of the lock
inheritance - True if lock is inheritable

NodeLock

public NodeLock(java.lang.String objectUri,
                java.lang.String subjectUri,
                java.lang.String typeUri,
                java.util.Date expirationDate,
                boolean inheritance,
                boolean exclusive)
Constructor.

Parameters:
objectUri - Locked object uri
subjectUri - Lock owner uri
typeUri - Lock type uri
expirationDate - Date of expiration of the lock
inheritance - True if lock is inheritable

NodeLock

public NodeLock(java.lang.String objectUri,
                java.lang.String subjectUri,
                java.lang.String typeUri,
                java.util.Date expirationDate,
                boolean inheritance,
                boolean exclusive,
                java.lang.String ownerInfo)
Constructor.

Parameters:
objectUri - Locked object uri
subjectUri - Lock owner uri
typeUri - Lock type uri
expirationDate - Date of expiration of the lock
inheritance - True if lock is inheritable
exclusive - True if lock is exclusive
ownerInfo - contacting info about the lock owner (phone number, email)

NodeLock

public NodeLock(NodeLock lock,
                java.lang.String typeUri)
Constructor. Creates a new lock linked to another given lock.

Parameters:
lock - Linked lock

NodeLock

public NodeLock(java.lang.String lockId,
                java.lang.String objectUri,
                java.lang.String subjectUri,
                java.lang.String typeUri,
                java.util.Date expirationDate,
                boolean inheritance,
                boolean exclusive)
Constructor.

Parameters:
objectUri - Locked object uri
subjectUri - Lock owner uri
typeUri - Lock type uri
expirationDate - Date of expiration of the lock
inheritance - True if lock is inheritable

NodeLock

public NodeLock(java.lang.String lockId,
                java.lang.String objectUri,
                java.lang.String subjectUri,
                java.lang.String typeUri,
                java.util.Date expirationDate,
                boolean inheritance,
                boolean exclusive,
                java.lang.String ownerInfo)
Constructor.

Parameters:
objectUri - Locked object uri
subjectUri - Lock owner uri
typeUri - Lock type uri
expirationDate - Date of expiration of the lock
inheritance - True if lock is inheritable
exclusive - True if lock is exclusive
ownerInfo - contacting info about the lock owner (phone number, email)

NodeLock

public NodeLock(java.lang.String objectUri,
                java.lang.String subjectUri,
                java.lang.String typeUri,
                java.util.Date expirationDate,
                boolean inheritance,
                int scope,
                java.lang.String ownerInfo)

NodeLock

public NodeLock(java.lang.String lockId,
                java.lang.String objectUri,
                java.lang.String subjectUri,
                java.lang.String typeUri,
                java.util.Date expirationDate,
                boolean inheritance,
                int scope,
                java.lang.String ownerInfo)
Method Detail

getObjectUri

public java.lang.String getObjectUri()
Locked object accessor.

Returns:
String Locked subject uri

setObjectUri

public void setObjectUri(java.lang.String objectUri)
Locked object mutator.

Parameters:
objectUri - Locked subject

getSubjectUri

public java.lang.String getSubjectUri()
Lock owner uri accessor.

Returns:
String Lock owner

setSubjectUri

void setSubjectUri(java.lang.String subjectUri)
Lock owner uri mutator.

Parameters:
subjectUri - Lock owner

getTypeUri

public java.lang.String getTypeUri()
Lock type uri accessor.

Returns:
String Lock type uri

setTypeUri

void setTypeUri(java.lang.String typeUri)
Lock type mutator.

Parameters:
typeUri - Lock type

getExpirationDate

public java.util.Date getExpirationDate()
Expiration date accessor.

Returns:
Date Exipiration date

setExpirationDate

void setExpirationDate(java.util.Date expirationDate)
Expiration date mutator.

Parameters:
expirationDate - Expiration date

hasExpired

public boolean hasExpired()
Expiration test.

Returns:
boolean True if this lock has expired

isInheritable

public boolean isInheritable()
Inheritance flag accessor.

Returns:
boolean True if token is inheritable

setInheritable

void setInheritable(boolean inheritance)
Inheritance flag mutator.

Parameters:
inheritance - Inheritance flag

isExclusive

public boolean isExclusive()
Exclusive flag accessor.

Returns:
boolean True if token is exclusive

isShared

public boolean isShared()
Exclusive flag accessor.

Returns:
boolean True if token is shared (ie, not exclusive)

isLocal

public boolean isLocal()
Exclusive flag accessor.

Returns:
boolean True if token is exclusive

setExclusive

void setExclusive(boolean exclusive)
Exclusive flag mutator.

Parameters:
exclusive - Exclusive flag

getLockId

public java.lang.String getLockId()
Get lock identifier.

Returns:
String lock id

setOwnerInfo

public void setOwnerInfo(java.lang.String ownerInfo)
Set the contacting info for the lock owner (phone, email, etc.)

Parameters:
ownerInfo - a String

getOwnerInfo

public java.lang.String getOwnerInfo()
Get the contacting info for the lock owner (phone, email, etc.)

Returns:
a String

cloneObject

public NodeLock cloneObject()
Clone.

Returns:
Object clone

equals

public boolean equals(java.lang.Object obj)
Equals.

Parameters:
obj - Object to test
Returns:
boolean True if the two object are equal :
  • obj is of type SlidePermission and is not null
  • All three Uris are equal

  • validate

    public void validate(java.lang.String expectedUri)
    Validate.

    Parameters:
    expectedUri - Uri