|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.abstracthorizon.danube.webdav.lock.Lock
public class Lock
This clas represents a lock
Field Summary | |
---|---|
protected static long |
counter
Static token element counter |
protected int |
depth
Locks depth. |
protected Object |
owner
Locks owner. |
protected int |
scope
Lock scope |
protected Timeout |
timeout
Locks timeout |
protected String |
token
Lock's token |
protected int |
type
Lock type |
protected long |
validUntil
Timestamp until where this lock is valid |
Constructor Summary | |
---|---|
Lock(int type,
int scope,
Object owner,
Timeout timeout,
int depth)
Constructor |
Method Summary | |
---|---|
protected void |
createToken()
Creates new lock's token |
boolean |
equals(Object o)
Retunrs true if locks are same (token wise) |
void |
freeLock()
Frees lock. |
int |
getDepth()
Returns lock depth |
Object |
getOwner()
Returns lock owner |
int |
getScope()
Returns lock scope |
Timeout |
getTimeout()
Returns lock timeout |
String |
getToken()
Return's lock token |
int |
getType()
Returns lock type |
long |
getValidUntil()
Returns timestamp until lock is valid |
boolean |
refreshTimeout(Timeout timeout)
Refreshes locks validity by reusing given timeout |
void |
setDepth(int depth)
Sets lock depth |
void |
setOwner(Object owner)
Sets lock owner |
void |
setScope(int scope)
Sets lock scope |
void |
setTimeout(Timeout timeout)
Sets lock timeout |
void |
setToken(String token)
Sets lock token |
void |
setType(int type)
Sets lock type |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int type
LockingMechanism.TYPE_WRITE
protected int scope
LockingMechanism.SCOPE_SHARED
,
LockingMechanism.SCOPE_EXCLUSIVE
protected Object owner
null
protected int depth
null
protected Timeout timeout
protected String token
protected long validUntil
protected static long counter
Constructor Detail |
---|
public Lock(int type, int scope, Object owner, Timeout timeout, int depth)
type
- lock typescope
- lock scopeowner
- lock ownertimeout
- lock timeoutdepth
- lock depthMethod Detail |
---|
protected void createToken()
public int getDepth()
public void setDepth(int depth)
depth
- lock depthpublic Object getOwner()
public void setOwner(Object owner)
owner
- lock ownerpublic int getScope()
public void setScope(int scope)
scope
- lock scopepublic Timeout getTimeout()
public void setTimeout(Timeout timeout)
timeout
- lock timeoutpublic String getToken()
public void setToken(String token)
token
- lock tokenpublic int getType()
public void setType(int type)
type
- lock typepublic long getValidUntil()
public boolean refreshTimeout(Timeout timeout)
timeout
- timeout
true
public void freeLock()
public boolean equals(Object o)
true
if locks are same (token wise)
equals
in class Object
true
if locks are same (token wise)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |