com.ibm.xcap.xml
Class ErrorMessage

java.lang.Object
  extended by com.ibm.xcap.xml.ErrorMessage

public class ErrorMessage
extends java.lang.Object

Class ErrorMessage Encapsulates an error message to be packaged in an XCAP response

See Also:
ParseErrorMessageException

Field Summary
protected static java.lang.String CLASSNAME
           
static java.lang.String COPYRIGHT
           
static short TYPE_CANNOT_DELETE
          provides a generic catch-all for other insertion cases
static short TYPE_CANNOT_INSERT
          provides a generic catch-all for other insertion cases
static short TYPE_CONSTRAINT_FAILURE
          The document does not meet application usage constraints
static short TYPE_NO_PARENT
          The element could not be inserted because its parent does not exist in the document.
static short TYPE_NOT_WELL_FORMED
          The XML contain in the body of the request is not well formed
static short TYPE_NOT_XML_ATT_VALUE
          The request did not contain a valid xml attribute value.
static short TYPE_NOT_XML_FRAG
          The request did not contain a valid xml fragment body.
static short TYPE_SCHEMA_VALIDATION_ERROR
          The resulting document was not compliant with the schema.
static short TYPE_UNIQUENESS_FAILURE
          The document does not meet uniqueness constraints
 
Constructor Summary
ErrorMessage()
          Constructor for ErrorMessage.
ErrorMessage(org.w3c.dom.Document error)
          Constructor for ErrorMessage.
ErrorMessage(short type)
          Constructor for ErrorMessage.
ErrorMessage(short type, java.lang.Object data)
          Constructor for ErrorMessage
ErrorMessage(java.lang.String error)
          Constructor for ErrorMessage.
 
Method Summary
 void setErrorElement(java.lang.String elementTag)
          Set a simple response with the given tag
 void setNoParentError(java.lang.String ancestor)
          The element could not be inserted because its parent does not exist in the document.
 void setUniquenessFailure(java.lang.String[] uris)
          The user tried to set a URI that the server must constrain to be unique, and this URI exists.
 java.lang.String toString()
          String representation of xml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT

CLASSNAME

protected static final java.lang.String CLASSNAME

TYPE_NOT_WELL_FORMED

public static final short TYPE_NOT_WELL_FORMED
The XML contain in the body of the request is not well formed

See Also:
Constant Field Values

TYPE_NOT_XML_FRAG

public static final short TYPE_NOT_XML_FRAG
The request did not contain a valid xml fragment body.

See Also:
Constant Field Values

TYPE_NO_PARENT

public static final short TYPE_NO_PARENT
The element could not be inserted because its parent does not exist in the document.

See Also:
Constant Field Values

TYPE_SCHEMA_VALIDATION_ERROR

public static final short TYPE_SCHEMA_VALIDATION_ERROR
The resulting document was not compliant with the schema.

See Also:
Constant Field Values

TYPE_NOT_XML_ATT_VALUE

public static final short TYPE_NOT_XML_ATT_VALUE
The request did not contain a valid xml attribute value.

See Also:
Constant Field Values

TYPE_CANNOT_INSERT

public static final short TYPE_CANNOT_INSERT
provides a generic catch-all for other insertion cases

See Also:
Constant Field Values

TYPE_CANNOT_DELETE

public static final short TYPE_CANNOT_DELETE
provides a generic catch-all for other insertion cases

See Also:
Constant Field Values

TYPE_UNIQUENESS_FAILURE

public static final short TYPE_UNIQUENESS_FAILURE
The document does not meet uniqueness constraints

See Also:
Constant Field Values

TYPE_CONSTRAINT_FAILURE

public static final short TYPE_CONSTRAINT_FAILURE
The document does not meet application usage constraints

See Also:
Constant Field Values
Constructor Detail

ErrorMessage

public ErrorMessage()
             throws ParseErrorMessageException
Constructor for ErrorMessage. create new xml error document

Throws:
ParseErrorMessageException

ErrorMessage

public ErrorMessage(short type)
             throws ParseErrorMessageException
Constructor for ErrorMessage. create new xml error document

Parameters:
type -
Throws:
ParseErrorMessageException

ErrorMessage

public ErrorMessage(short type,
                    java.lang.Object data)
             throws ParseErrorMessageException
Constructor for ErrorMessage

Parameters:
type -
data -
Throws:
ParseErrorMessageException

ErrorMessage

public ErrorMessage(java.lang.String error)
             throws ParseErrorMessageException
Constructor for ErrorMessage.

Parameters:
error - -- the xml message as String
Throws:
ParseErrorMessageException

ErrorMessage

public ErrorMessage(org.w3c.dom.Document error)
             throws ParseErrorMessageException
Constructor for ErrorMessage.

Parameters:
error - -- the xml message
Throws:
ParseErrorMessageException
Method Detail

toString

public java.lang.String toString()
String representation of xml

Overrides:
toString in class java.lang.Object
Returns:
String representation of the error message

setErrorElement

public void setErrorElement(java.lang.String elementTag)
Set a simple response with the given tag

Parameters:
elementTag -

setNoParentError

public void setNoParentError(java.lang.String ancestor)
The element could not be inserted because its parent does not exist in the document.

Parameters:
ancestor - - Contains an HTTP URI that points to the element which is the closest ancestor that does exist.

setUniquenessFailure

public void setUniquenessFailure(java.lang.String[] uris)
The user tried to set a URI that the server must constrain to be unique, and this URI exists.

Parameters:
uris - - the uri's that failed to be proccess