org.abstracthorizon.danube.webdav.xml.dav.response
Class MultiStatus

java.lang.Object
  extended by org.abstracthorizon.danube.webdav.xml.dav.response.MultiStatus

public class MultiStatus
extends Object

This class represents multistatus response tag as defined in RFC-2518. It can render multistatus response xml but also can set HTTPConnection headers in a simple no content response or render partial content as required by some functions.

Author:
Daniel Sendula

Field Summary
protected  boolean committed
          Is stauts already sent to the connection
protected  boolean headerResponse
          Is it header response only or proper multistatus xml
protected  HTTPConnection httpConnection
          HTTP connection status is going to render response to
static Status MULTISTATUS_RESPONSE
          Mutlistatus response status 207
protected  NamespacesProvider provider
          Namespace provider
protected  List<Response> responses
          List of responses
 
Constructor Summary
MultiStatus(NamespacesProvider provider, HTTPConnection connection)
          Constructor
 
Method Summary
 Response addSimpleResponse(Status status)
          Adds simple response
 void commit()
          Sets commit flag to true
 HTTPConnection getHTTPConnection()
          Returns http connection
 String getResponseProtocol()
          Returns http connection's response protocol
 List<Response> getResponses()
          Returns responses
 boolean isCommitted()
          Returns commited flag
 boolean isHeaderResponse()
          Returns is it header only response
 HRef newHRef()
          Creates new href of request's URL
 HRef newHRef(String path)
          Creates new href of relative path of request's URL
 Response newResponse()
          Creates new response with href of request's URL
 Response newResponse(String path)
          Creates new response with href of relative path of request's URL
 void render()
          Renders with true for force mutlistatus flag
 void render(boolean forceMultistatus)
          Renders this object to http connection
static void renderNamespaces(PrintWriter writer, NamespacesProvider provider)
          Renders namespaces
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MULTISTATUS_RESPONSE

public static final Status MULTISTATUS_RESPONSE
Mutlistatus response status 207


httpConnection

protected HTTPConnection httpConnection
HTTP connection status is going to render response to


committed

protected boolean committed
Is stauts already sent to the connection


headerResponse

protected boolean headerResponse
Is it header response only or proper multistatus xml


provider

protected NamespacesProvider provider
Namespace provider


responses

protected List<Response> responses
List of responses

Constructor Detail

MultiStatus

public MultiStatus(NamespacesProvider provider,
                   HTTPConnection connection)
Constructor

Parameters:
provider - namespace provider
connection - connection to be rendered to
Method Detail

commit

public void commit()
Sets commit flag to true


isCommitted

public boolean isCommitted()
Returns commited flag

Returns:
commited flag

isHeaderResponse

public boolean isHeaderResponse()
Returns is it header only response

Returns:
true if it is header only response

getResponses

public List<Response> getResponses()
Returns responses

Returns:
responses

getHTTPConnection

public HTTPConnection getHTTPConnection()
Returns http connection

Returns:
http connection

getResponseProtocol

public String getResponseProtocol()
Returns http connection's response protocol

Returns:
http connection's response protocol

render

public void render()
Renders with true for force mutlistatus flag


render

public void render(boolean forceMultistatus)
Renders this object to http connection

Parameters:
forceMultistatus - if true then it is rendered as mutlistatus. Otherwise it can return header only or partial xml response

renderNamespaces

public static void renderNamespaces(PrintWriter writer,
                                    NamespacesProvider provider)
Renders namespaces

Parameters:
writer - writer
provider - namespace provider

addSimpleResponse

public Response addSimpleResponse(Status status)
Adds simple response

Parameters:
status - status
Returns:
new response

newResponse

public Response newResponse()
Creates new response with href of request's URL

Returns:
new response

newResponse

public Response newResponse(String path)
Creates new response with href of relative path of request's URL

Parameters:
path - relative path from request's URL
Returns:
new response

newHRef

public HRef newHRef()
Creates new href of request's URL

Returns:
new href

newHRef

public HRef newHRef(String path)
Creates new href of relative path of request's URL

Parameters:
path - path
Returns:
new href


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.