|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.opencms.lock.CmsLock
Represents the lock state of a VFS resource.
The lock state is combination of how, by whom and in which project a resource is currently locked.
Using old-style methods on CmsResource objects to prove the lock
state of a resource may result to incorrect lock states. Use
CmsObject.getLock(String) to obtain a
CmsLock object that represents the current lock state of a resource.
CmsObject.getLock(org.opencms.file.CmsResource),
CmsLockManager| Field Summary | |
static int |
COMMON
Indicates that the lock is a common lock and doesn't expire. |
static int |
TEMPORARY
Indicates that the lock is a temporary lock that expires is the user was logged out. |
static int |
TYPE_EXCLUSIVE
A lock that allows the user to edit the resource�s structure record, it�s resource record, and its content record. |
static int |
TYPE_INHERITED
A lock that is inherited from a locked parent folder. |
static int |
TYPE_SHARED_EXCLUSIVE
A lock that allows the user to edit the resource�s structure record only, but not it�s resource record nor content record. |
static int |
TYPE_SHARED_INHERITED
A lock that allows the user to edit the resource�s structure record only, but not it�s resource record nor content record. |
static int |
TYPE_UNLOCKED
Reserved for the Null CmsLock. |
| Constructor Summary | |
CmsLock(String resourceName,
CmsUUID userId,
int projectId,
int type)
Constructor for a new Cms lock. |
|
CmsLock(String resourceName,
CmsUUID userId,
int projectId,
int type,
int mode)
Constructor for a new Cms lock. |
|
| Method Summary | |
boolean |
equals(Object obj)
Compares this lock to the specified object. |
int |
getMode()
Returns the mode of the lock to indicate if the lock is a temporary lock. |
static CmsLock |
getNullLock()
Returns the shared Null CmsLock. |
int |
getProjectId()
Returns the ID of the project where the resource is currently locked. |
String |
getResourceName()
Returns the name of the locked resource. |
int |
getType()
Returns the type about how the resource is locked. |
CmsUUID |
getUserId()
Returns the ID of the user who currently locked the resource. |
int |
hashCode()
|
boolean |
isNullLock()
Proves if this CmsLock is the Null CmsLock. |
String |
toString()
Builds a string representation of the current state. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int COMMON
public static final int TEMPORARY
public static final int TYPE_EXCLUSIVE
This lock is assigned to files that are locked via the context menu.
public static final int TYPE_INHERITED
public static final int TYPE_SHARED_EXCLUSIVE
This lock is assigned to files if a sibling of the resource record has already an exclusive lock.
public static final int TYPE_SHARED_INHERITED
This lock is assigned to resources that already have a shared exclusive lock, and then inherit a lock because one if it's parent folders gets locked.
public static final int TYPE_UNLOCKED
| Constructor Detail |
public CmsLock(String resourceName,
CmsUUID userId,
int projectId,
int type)
resourceName - the full resource name including the site rootuserId - the ID of the user who locked the resourceprojectId - the ID of the project where the resource is lockedtype - flag indicating how the resource is locked
public CmsLock(String resourceName,
CmsUUID userId,
int projectId,
int type,
int mode)
resourceName - the full resource name including the site rootuserId - the ID of the user who locked the resourceprojectId - the ID of the project where the resource is lockedtype - flag indicating how the resource is lockedmode - flag indicating the mode (temporary or common) of a lock| Method Detail |
public static CmsLock getNullLock()
public boolean equals(Object obj)
obj - the object to compare to
public int getMode()
public int getProjectId()
public String getResourceName()
public int getType()
public CmsUUID getUserId()
public int hashCode()
Object.hashCode()public boolean isNullLock()
public String toString()
Object.toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||