|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.webdav.locking.LockedObject
public class LockedObject
a helper class for ResourceLocks, represents the Locks
Field Summary | |
---|---|
protected LockedObject[] |
children
children of that lock |
protected boolean |
exclusive
weather the lock is exclusive or not. if owner=null the exclusive value doesn't matter |
protected long |
expiresAt
Describing the timeout of a locked object (ms) |
protected int |
lockDepth
Describing the depth of a locked collection. |
protected String[] |
owner
owner of the lock. shared locks can have multiple owners. is null if no owner is present |
protected LockedObject |
parent
|
protected String |
type
weather the lock is a write or read lock |
Constructor Summary | |
---|---|
LockedObject(ResourceLocks resLocks,
String path,
boolean temporary)
|
Method Summary | |
---|---|
void |
addChild(LockedObject newChild)
adds a new child lock to this lock |
boolean |
addLockedObjectOwner(String owner)
adds a new owner to a lock |
boolean |
checkLocks(boolean exclusive,
int depth)
checks if a lock of the given exclusivity can be placed, only considering children up to "depth" |
String |
getID()
Gets the LockID (locktoken) for the LockedObject |
int |
getLockDepth()
Gets the depth of the lock |
String[] |
getOwner()
Gets the owners for the LockedObject |
String |
getPath()
Gets the path for the LockedObject |
long |
getTimeoutMillis()
Gets the timeout for the LockedObject |
String |
getType()
Gets the type of the lock |
boolean |
hasExpired()
Return true if the lock has expired. |
boolean |
isExclusive()
Gets the exclusivity for the LockedObject |
boolean |
isShared()
Gets the exclusivity for the LockedObject |
void |
refreshTimeout(int timeout)
Sets a new timeout for the LockedObject |
void |
removeLockedObject()
deletes this Lock object. assumes that it has no children and no owners (does not check this itself) |
void |
removeLockedObjectOwner(String owner)
tries to remove the owner from the lock |
void |
removeTempLockedObject()
deletes this Lock object. assumes that it has no children and no owners (does not check this itself) |
void |
setExclusive(boolean exclusive)
Sets the exclusivity for the LockedObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int lockDepth
protected long expiresAt
protected String[] owner
protected LockedObject[] children
protected LockedObject parent
protected boolean exclusive
protected String type
Constructor Detail |
---|
public LockedObject(ResourceLocks resLocks, String path, boolean temporary)
resLocks
- the resourceLocks where locks are storedpath
- the path to the locked objecttemporary
- indicates if the LockedObject should be temporary or notMethod Detail |
---|
public boolean addLockedObjectOwner(String owner)
owner
- string that represents the owner
public void removeLockedObjectOwner(String owner)
owner
- string that represents the ownerpublic void addChild(LockedObject newChild)
newChild
- new childpublic void removeLockedObject()
public void removeTempLockedObject()
public boolean checkLocks(boolean exclusive, int depth)
exclusive
- wheather the new lock should be exclusivedepth
- the depth to which should be checked
public void refreshTimeout(int timeout)
timeout
- public long getTimeoutMillis()
public boolean hasExpired()
public String getID()
public String[] getOwner()
public String getPath()
public void setExclusive(boolean exclusive)
exclusive
- public boolean isExclusive()
public boolean isShared()
public String getType()
public int getLockDepth()
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |