pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.webdav.util
Class StatusResponseElement

java.lang.Object
  extended by org.torweg.pulse.webdav.util.AbstractResponseElement
      extended by org.torweg.pulse.webdav.util.StatusResponseElement
All Implemented Interfaces:
IMultiStatusElement

public class StatusResponseElement
extends AbstractResponseElement

represents a status response element in a multi-status response.

StatusResponseElements are used by the COPY and MOVE operations.

Version:
$Revision: 2069 $
Author:
Thomas Weber

Constructor Summary
StatusResponseElement(java.net.URI h, boolean isCollection, boolean isResource)
          creates an abstract response.
 
Method Summary
 boolean equals(java.lang.Object obj)
          returns if the given object is equal to this object in terms of their href property.
 java.net.URI getHref()
          returns the href.
 DAVStatus getStatus()
          returns the status of the response.
 org.jdom.Element getXML()
          returns a status response element.
 int hashCode()
          returns the hash code.
 boolean isCollection()
           
 boolean isResource()
           
 void setStatus(DAVStatus s)
          sets the status for the response.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatusResponseElement

public StatusResponseElement(java.net.URI h,
                             boolean isCollection,
                             boolean isResource)
creates an abstract response.

Parameters:
h - the URI of the object the response is for
isCollection - indicates, whether the object is a collection
isResource - indicates, whether the object is a resource
Method Detail

getHref

public final java.net.URI getHref()
returns the href.

Specified by:
getHref in interface IMultiStatusElement
Specified by:
getHref in class AbstractResponseElement
Returns:
the href

isCollection

public final boolean isCollection()
Returns:
the collection

isResource

public final boolean isResource()
Returns:
the resource

setStatus

public final void setStatus(DAVStatus s)
sets the status for the response.

Parameters:
s - the status

getStatus

public final DAVStatus getStatus()
returns the status of the response.

Returns:
the status

hashCode

public int hashCode()
returns the hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code

equals

public boolean equals(java.lang.Object obj)
returns if the given object is equal to this object in terms of their href property.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the given object
Returns:
true, if the given object is equal to this object in terms of their href property

getXML

public org.jdom.Element getXML()
returns a status response element.

For example:
<D:response> <D:href>/some/collection</D:href> <D:propstat> <D:prop><D:resourcetype><D:collection/></D:resourcetype></D:prop> <D:status>HTTP/1.1 424 Failed Dependency</D:status> </D:propstat> </D:response>

Specified by:
getXML in interface IMultiStatusElement
Overrides:
getXML in class AbstractResponseElement
Returns:
a basic response element
See Also:
IMultiStatusElement.getXML()