|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.webdav.lock.LockInfo
public class LockInfo
LockInfo
is a simple utility class encapsulating the information
passed with a LOCK request. It combines both the request body (which if present
is required to by a 'lockinfo' Xml element) and the lock relevant request
headers 'Timeout
' and
'Depth
'.
Note that is class is not intended to perform any validation of the information
given, since this left to those objects responsible for the lock creation
on the requested resource.
Field Summary |
---|
Constructor Summary | |
---|---|
LockInfo(Element liElement,
long timeout,
boolean isDeep)
Create a new LockInfo object from the given information. |
|
LockInfo(long timeout)
Create a new LockInfo used for refreshing an existing lock. |
|
LockInfo(Scope scope,
Type type,
String owner,
long timeout,
boolean isDeep)
Create a new LockInfo |
Method Summary | |
---|---|
String |
getOwner()
Return the owner indicated by the corresponding child element from the 'lockinfo' element or null if no 'lockinfo' element was
passed to the constructor or did not contain an 'owner' element. |
Scope |
getScope()
Return the lock scope or null if no 'lockinfo' element was
passed to the constructor or did not contain an 'scope' element and the
scope has not been set otherwise. |
long |
getTimeout()
Returns the time until the lock is requested to expire. |
Type |
getType()
Returns the lock type or null if no 'lockinfo' element was
passed to the constructor or did not contain an 'type' element and the
type has not been set otherwise. |
boolean |
isDeep()
Returns true if the lock must be applied with depth infinity. |
boolean |
isRefreshLock()
Returns true if this LockInfo was created for a LOCK
request intended to refresh an existing lock rather than creating a
new one. |
void |
setScope(Scope scope)
Set the lock scope. |
void |
setType(Type type)
Set the lock type. |
Element |
toXml(Document document)
Returns the xml representation of this lock info. NOTE however, that the depth and the timeout are not included in the xml. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LockInfo(long timeout)
LockInfo
used for refreshing an existing lock.
timeout
- public LockInfo(Scope scope, Type type, String owner, long timeout, boolean isDeep)
LockInfo
scope
- type
- owner
- timeout
- isDeep
- public LockInfo(Element liElement, long timeout, boolean isDeep) throws DavException
LockInfo
object from the given information. If
liElement
is null
this lockinfo is assumed to
be issued from a 'Refresh Lock' request.
liElement
- 'lockinfo' element present in the request body of a LOCK request
or null
if the request was intended to refresh an existing lock.timeout
- Requested timespan until the lock should expire. A LOCK
request MUST contain a 'Timeout
'
according to RFC 2518.isDeep
- boolean value indicating whether the lock should be applied
with depth infinity or only to the requested resource.
DavException
- if the liElement
is not
null but does not start with an 'lockinfo' element.
Method Detail |
---|
public Type getType()
null if no 'lockinfo' element was
passed to the constructor or did not contain an 'type' element and the
type has not been set otherwise.
- Returns:
- type or
null
public void setType(Type type)
type
- public Scope getScope()
null if no 'lockinfo' element was
passed to the constructor or did not contain an 'scope' element and the
scope has not been set otherwise.
- Returns:
- scope or
null
public void setScope(Scope scope)
scope
- public String getOwner()
null if no 'lockinfo' element was
passed to the constructor or did not contain an 'owner' element.
- Returns:
- owner or
null
public boolean isDeep()
public long getTimeout()
public boolean isRefreshLock()
LockInfo
was created for a LOCK
request intended to refresh an existing lock rather than creating a
new one.
public Element toXml(Document document)
toXml
in interface XmlSerializable
document
-
XmlSerializable.toXml(Document)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |