org.eclipse.webdav.dom
Class ActiveLock

java.lang.Object
  extended by org.eclipse.webdav.dom.ElementEditor
      extended by org.eclipse.webdav.dom.ActiveLock

public class ActiveLock
extends ElementEditor

An element editor for the WebDAV activelock element. See RFC2518 section 12.1 for the element's definition.

Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

See Also:
LockDiscovery, Owner

Field Summary
protected static String[] childNames
           
 
Fields inherited from class org.eclipse.webdav.dom.ElementEditor
DAV_NS, root, XML_NS_NAME, XML_NS_PREFIX, XML_PREFIX
 
Constructor Summary
ActiveLock(Element root)
          Creates a new editor on the given WebDAV activelock element.
 
Method Summary
 void addLockTokenHref(String href)
          Adds the given href to this activelock's locktoken.
 String getDepth()
          Returns the depth of this activelock; for example, Context.DEPTH_ZERO.
 Enumeration getLockTokenHrefs()
          Returns an Enumeration of Strings containing this activelock's lock token hrefs.
 Owner getOwner()
          Returns this activelock's owner, or null if this active lock has no owner.
 String getTimeout()
          Returns this activelock's timeout, or null if this active lock has no timeout.
 boolean isShared()
          Returns true if this activelock is shared, or false if it is exclusive.
 void setDepth(String depth)
          Sets the depth of this activelock to the given depth.
 void setIsShared(boolean isShared)
          Sets whether this activelock is shared or exclusive.
 Owner setOwner()
          Creates and sets an owner element on this activelock and returns an editor on it.
 void setTimeout(String timeout)
          Sets the timeout on this activelock to the given timeout.
 
Methods inherited from class org.eclipse.webdav.dom.ElementEditor
addChild, addChild, addChild, appendChild, appendChild, cloneNode, create, declareNS, decodeHref, encodeHref, ensure, ensure, ensureDAVElement, ensureDAVElement, ensureNotNull, ensureNull, ensureText, extractElement, extractNode, getChild, getChildElement, getChildText, getDAVChild, getElement, getFirstChild, getFirstChild, getFirstText, getLastChild, getNamespaces, getNamespaces, getNextSibling, getNextSibling, getNextSibling, getNSLocalName, getNSLocalName, getNSName, getNSPrefix, getNSPrefix, getQualifiedName, getSibling, getText, getTwin, hasChild, insertBefore, insertBefore, isDAVElement, isDAVElement, isElement, isText, makeNSStandalone, reduceNS, reduceNS, resolve, setChild, setChild, setChild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

childNames

protected static final String[] childNames
Constructor Detail

ActiveLock

public ActiveLock(Element root)
           throws MalformedElementException
Creates a new editor on the given WebDAV activelock element. The element is assumed to be well formed.

Parameters:
root - an activelock element
Throws:
MalformedElementException - if there is reason to believe that the element is not well formed
Method Detail

addLockTokenHref

public void addLockTokenHref(String href)
Adds the given href to this activelock's locktoken. The href must not be null.

Parameters:
href - the href to add

getDepth

public String getDepth()
                throws MalformedElementException
Returns the depth of this activelock; for example, Context.DEPTH_ZERO.

Throws:
MalformedElementException - if there is reason to believe that this editor's underlying element is not well formed
See Also:
Context

getLockTokenHrefs

public Enumeration getLockTokenHrefs()
                              throws MalformedElementException
Returns an Enumeration of Strings containing this activelock's lock token hrefs.

Returns:
an Enumeration of Strings
Throws:
MalformedElementException - if there is reason to believe that this editor's underlying element is not well formed

getOwner

public Owner getOwner()
               throws MalformedElementException
Returns this activelock's owner, or null if this active lock has no owner.

Returns:
this activelock's owner, or null
Throws:
MalformedElementException - if there is reason to believe that this editor's underlying element is not well formed

getTimeout

public String getTimeout()
                  throws MalformedElementException
Returns this activelock's timeout, or null if this active lock has no timeout.

Returns:
this activelock's timeout, or null
Throws:
MalformedElementException - if there is reason to believe that this editor's underlying element is not well formed

isShared

public boolean isShared()
                 throws MalformedElementException
Returns true if this activelock is shared, or false if it is exclusive.

Returns:
a boolean indicating whether this activelock is shared or exclusive
Throws:
MalformedElementException - if there is reason to believe that this editor's underlying element is not well formed

setDepth

public void setDepth(String depth)
Sets the depth of this activelock to the given depth. The depth must not be null and must be one of:

Parameters:
depth - the depth for this activelock
See Also:
Context

setIsShared

public void setIsShared(boolean isShared)
Sets whether this activelock is shared or exclusive. If isShared is true, the activelock is set as shared, otherwise, the activelock is set as exclusive.

Parameters:
isShared - a boolean indicating whether this activelock will be set to be shared or exclusive

setOwner

public Owner setOwner()
Creates and sets an owner element on this activelock and returns an editor on it.

Returns:
an editor on an owner element

setTimeout

public void setTimeout(String timeout)
Sets the timeout on this activelock to the given timeout. If the timeout is null the current timeout is removed.

Parameters:
timeout - the timeout value for this activelock, or null for no timeout


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.