org.vfny.geoserver.responses.wfs
Class WfsTransResponse

java.lang.Object
  extended byorg.vfny.geoserver.responses.wfs.WfsTransResponse

public class WfsTransResponse
extends java.lang.Object

Java representation of a WFS_TransactionResponse xml element. The status and handle are required, so they are in the constructor, and a locator, a message, and any number of InsertResults can be added. This object can then write itself out to xml for a response.


Field Summary
static java.lang.String CUR_VERSION
          Current version of wfs
static short FAILED
          Status if one of more operations failed
static java.lang.String HANDLE
          Name of the version element of the xml document
static java.lang.String INSERT_RESULT
          The name of the insert result element of the xml document
static short PARTIAL
          Status for transaction partially succeeding, data in incosistent state.
static java.lang.String ROOT
          The name of the root element of the xml document
 short status
          Status of the transaction represented by this response.
static java.lang.String STATUS
          Name of the status element of the xml document
static short SUCCESS
          Status if the transaction was successful
static java.lang.String TRANS_RESULT
          Name of the transaction result element of the xml document
static java.lang.String V_OFFSET
           
static java.lang.String VERSION
          Name of the version element of the xml document
 
Constructor Summary
WfsTransResponse(short status, boolean verbose)
          Only constructor, as status is mandatory
WfsTransResponse(short status, java.lang.String handle, boolean verbose)
          Convenience constructor, for status and handle
 
Method Summary
 void addInsertResult(java.lang.String handle, java.util.Collection featureIds)
          adds an insert result for a successful insert operation.
 java.lang.String getXmlResponse(Request gs)
           
 void setHandle(java.lang.String handle)
          Sets the handle for this response.
 void setLocator(java.lang.String locator)
          Sets the string to indicate which part of the transaction failed.
 void setMessage(java.lang.String message)
          Sets the string to give a message about a failure.
 void writeXmlResponse(java.io.Writer writer, Request request)
          Generates the xml represented by this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUCCESS

public static final short SUCCESS
Status if the transaction was successful

See Also:
Constant Field Values

FAILED

public static final short FAILED
Status if one of more operations failed

See Also:
Constant Field Values

PARTIAL

public static final short PARTIAL
Status for transaction partially succeeding, data in incosistent state.

See Also:
Constant Field Values

ROOT

public static final java.lang.String ROOT
The name of the root element of the xml document

See Also:
Constant Field Values

INSERT_RESULT

public static final java.lang.String INSERT_RESULT
The name of the insert result element of the xml document

See Also:
Constant Field Values

TRANS_RESULT

public static final java.lang.String TRANS_RESULT
Name of the transaction result element of the xml document

See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
Name of the version element of the xml document

See Also:
Constant Field Values

CUR_VERSION

public static final java.lang.String CUR_VERSION
Current version of wfs

See Also:
Constant Field Values

HANDLE

public static final java.lang.String HANDLE
Name of the version element of the xml document

See Also:
Constant Field Values

STATUS

public static final java.lang.String STATUS
Name of the status element of the xml document

See Also:
Constant Field Values

V_OFFSET

public static final java.lang.String V_OFFSET
See Also:
Constant Field Values

status

public final short status
Status of the transaction represented by this response.

Constructor Detail

WfsTransResponse

public WfsTransResponse(short status,
                        boolean verbose)
Only constructor, as status is mandatory

Parameters:
status - The status of the transaction.
verbose - DOCUMENT ME!

WfsTransResponse

public WfsTransResponse(short status,
                        java.lang.String handle,
                        boolean verbose)
Convenience constructor, for status and handle

Parameters:
status - The status of the transaction.
handle - the handle of the response. Should be the same as the handle of the transaction request.
verbose - DOCUMENT ME!
Method Detail

setHandle

public void setHandle(java.lang.String handle)
Sets the handle for this response.

Parameters:
handle - the handle of the response. Should be the same as the handle of the transaction request.

setLocator

public void setLocator(java.lang.String locator)
Sets the string to indicate which part of the transaction failed. Should be the handle of the sub-request that failed.

Parameters:
locator - the handle of the failed transaction.

setMessage

public void setMessage(java.lang.String message)
Sets the string to give a message about a failure.

Parameters:
message - to give the user information about the failure.

addInsertResult

public void addInsertResult(java.lang.String handle,
                            java.util.Collection featureIds)
adds an insert result for a successful insert operation.

Parameters:
handle - the handle of the insert request.
featureIds - the collection of successfully added feature ids.

writeXmlResponse

public void writeXmlResponse(java.io.Writer writer,
                             Request request)
                      throws java.io.IOException
Generates the xml represented by this object.

Parameters:
writer - DOCUMENT ME!
request - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!

getXmlResponse

public java.lang.String getXmlResponse(Request gs)