public abstract class WebdavLock
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_TIMEOUT |
protected int |
depth |
protected java.lang.String |
id |
protected long |
lastMod |
static int |
MAX_TIMEOUT |
static java.security.MessageDigest |
md5Digest |
protected java.lang.String |
owner |
static java.lang.String |
REVISION |
protected java.lang.String |
scope |
protected java.lang.String |
secret |
protected int |
timeout |
protected java.util.Collection<java.lang.String> |
tokens |
protected java.lang.String |
type |
protected java.lang.String |
uri |
Modifier | Constructor and Description |
---|---|
protected |
WebdavLock(java.lang.String uri,
WebdavContext ctxt)
The lock must be a relative URI to the path folders starting and ending by '/'.
|
Modifier and Type | Method and Description |
---|---|
void |
acquire(WebdavResource resource,
WebdavContext ctxt)
This method is called for other mecanism outside of Webdav
that need to be notified by lock
|
java.lang.String |
encode(byte[] binaryData)
Encodes the 128 bit (16 bytes) MD5 into a 32 character String.
|
java.lang.String |
generateId(WebdavContext ctxt)
Generate an MD5 id from the given locks parameters
|
int |
getDepth()
This method retrieve the Depth of the Lock
|
long |
getExpiredTime()
This method retrieve the expired timeout
|
java.lang.String |
getId()
An MD5 representation of the Lock
|
long |
getLastModified()
This method retrieve the lastmodified of timeout
|
java.lang.String |
getOwner()
This method retrieve the Owner of the Lock
|
java.lang.String |
getScope()
This method retrieve the Scope of the Lock
|
int |
getTimeout()
This method retrieve the Timeout of the Lock
without lastMod
|
java.util.Collection<java.lang.String> |
getTokens()
This method retrieve the Tokens of the Lock
|
java.lang.String |
getType()
This method retrieve the Type of the Lock
|
boolean |
hasExpired() |
boolean |
isExclusive() |
void |
refresh(WebdavResource resource,
WebdavContext ctxt)
This method is called for other mecanism outside of Webdav
that need to be notified by unlock
|
void |
release(WebdavResource resource,
WebdavContext ctxt)
This method is called for other mecanism outside of Webdav
that need to be notified by unlock
|
void |
setDepth(int depth)
This method set the Depth of the Lock
|
void |
setOwner(java.lang.String owner)
This method set the Owner of the Lock
|
void |
setScope(java.lang.String scope)
This method set the Scope of the Lock
|
void |
setTimeout(int timeout)
This method set the Timeout of the Lock
|
void |
setType(java.lang.String type)
This method set the Type of the Lock
|
java.lang.String |
toString() |
public static final java.lang.String REVISION
public static final int DEFAULT_TIMEOUT
public static final int MAX_TIMEOUT
public static final java.security.MessageDigest md5Digest
protected java.lang.String uri
protected long lastMod
protected int timeout
protected int depth
protected java.lang.String type
protected java.lang.String scope
protected java.lang.String owner
protected java.lang.String id
protected java.lang.String secret
protected java.util.Collection<java.lang.String> tokens
protected WebdavLock(java.lang.String uri, WebdavContext ctxt)
uri
- the lock urictxt
- the Webdav ContextWebdavFileSystem.getLocks(WebdavResource, WebdavContext)
public int getDepth()
public void setDepth(int depth)
depth
- public long getExpiredTime()
public long getLastModified()
public int getTimeout()
public void setTimeout(int timeout)
timeout
- the timeout since mdatepublic java.lang.String getType()
public void setType(java.lang.String type)
type
- the type of the lockpublic java.lang.String getScope()
public void setScope(java.lang.String scope)
scope
- the scope of the lockpublic java.lang.String getOwner()
public void setOwner(java.lang.String owner)
owner
- the owner of the lockpublic java.lang.String getId()
public java.util.Collection<java.lang.String> getTokens()
public boolean isExclusive()
public boolean hasExpired()
public java.lang.String toString()
toString
in class java.lang.Object
public void acquire(WebdavResource resource, WebdavContext ctxt)
ctxt
- the Webdav Contextpublic void release(WebdavResource resource, WebdavContext ctxt)
ctxt
- the Webdav Contextpublic void refresh(WebdavResource resource, WebdavContext ctxt)
ctxt
- the Webdav Contextpublic java.lang.String generateId(WebdavContext ctxt)
ctxt
- the WebDav Contextpublic java.lang.String encode(byte[] binaryData)
binaryData
- Array containing the digestCopyright © 2001-2010 Jalios SA. All Rights Reserved.