Class OperationFailureErrorException

All Implemented Interfaces:
IErrorException, IXMLMarshallable, OperationResult, XMLMarshallable, Serializable
Direct Known Subclasses:
InvalidCreationErrorException, InvalidDeletionErrorException, InvalidMaintainErrorException, InvalidModificationErrorException, InvalidOperationErrorException, InvalidSearchErrorException, InvalidSubscriberDataExportErrorException, InvalidSubscriberDataImportErrorException, ServerErrorException

public abstract class OperationFailureErrorException extends OperationFailureException implements IErrorException, IXMLMarshallable
This abstract Java class is the base representation of an OperationFailureException that includes an error (error code and arguments, comprehensive message, potential causes); Consider the direct known subclasses: ServerErrorException, InvalidCreationErrorException, and other error exceptions.

This class should be implemented by all the failure exceptions.

This class implements both the IXMLMarshallable and the XMLMarshallable Java interfaces.

Implementation in Your Client Application

Consider the known subclasses that represent an HCI operation exception; They are listed in this page.

See Also:

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="cause" type="IErrorType" />
 <xs:element name="causedBy" type="IErrorType" />

 <xs:complexType name="IErrorType">
   <xs:sequence>
     <xs:element name="message" type="xs:string" />
     <xs:choice>
       <xs:element ref="string" />
       <xs:element ref="date" />
       <xs:element ref="number" />
       <xs:element ref="boolean" />
     </xs:choice>
   </xs:sequence>
   <xs:attribute name="module" type="xs:string" />
   <xs:attribute name="code" type="xs:integer" />
 </xs:complexType>

 <xs:complexType name="OperationFailureError">
   <xs:sequence>
     <xs:element ref="cause" minOccurs="1" maxOccurs="1"/>
     <xs:element ref="causedBy" minOccurs="0" maxOccurs="unbounded"/>
   </xs:sequence>
 </xs:complexType>

  • Field Details

    • CAUSE_TAG_NAME

      public static final String CAUSE_TAG_NAME
      Constant for the XML tag name of the error embedded in the Operation Failure: "cause"
      See Also:
    • CAUSED_BY_TAG_NAME

      public static final String CAUSED_BY_TAG_NAME
      Constant for the XML tag name of the nested IErrors errors embedded in the Operation Failure: "causedBy"
      See Also:
    • MESSAGE_TAG_NAME

      public static final String MESSAGE_TAG_NAME
      Constant for the XML tag name of the message describing the error embedded in the Operation Failure: "message"
      See Also:
  • Constructor Details

    • OperationFailureErrorException

      public OperationFailureErrorException()
      Default constructor of the Operation Failure exception used to unmarshal its XML representation.
    • OperationFailureErrorException

      public OperationFailureErrorException(IError error)
      Builds the Operation Failure exception with the specified IError.
      Parameters:
      error - The IError to embed in the operation failure
    • OperationFailureErrorException

      public OperationFailureErrorException(IError error, OperationFailureErrorException cause)
      Builds the Operation Failure exception with the specified IError and its triggering operation failure.
      Parameters:
      error - The IError to embed in the operation failure
      cause - The Operation Failure that has triggered the current Operation Failure
    • OperationFailureErrorException

      public OperationFailureErrorException(IError error, Throwable cause)
      Builds the Operation Failure exception with the specified IError and its triggering exception.
      Parameters:
      error - The IError to embed in the operation failure
      cause - The exception that has triggered the current Operation Failure
  • Method Details

    • getMessage

      public String getMessage()
      Returns the text message of the error in this exception.
      Overrides:
      getMessage in class Throwable
      Returns:
      The error message
    • getError

      public IError getError()
      Description copied from interface: IErrorException
      Gets the error included in this exception.
      Specified by:
      getError in interface IErrorException
      Returns:
      The error associated in this exception
    • setError

      public void setError(IError error)
      Sets the error contained in this Operation Failure.
      Parameters:
      error - The IError to embed in this operation failure
    • getTagName

      public abstract String getTagName()
      Gets the XML tag name of the HCI model.
      Returns:
      The XML tag name
    • marshal

      public final void marshal(XMLOutputter output)
      Description copied from interface: XMLMarshallable
      Gives an XML representation of this object, including its children.
      Specified by:
      marshal in interface IXMLMarshallable
      Specified by:
      marshal in interface XMLMarshallable
      Parameters:
      output - The XML output to marshal the object into
    • marshalChildren

      public void marshalChildren(XMLOutputter output)
      Description copied from interface: IXMLMarshallable
      Gives an XML representation of the child objects of an object.
      Specified by:
      marshalChildren in interface IXMLMarshallable
      Parameters:
      output - The XML output to marshal the child objects into
    • addChild

      public void addChild(String tagName, XMLMarshallable child)
      Description copied from interface: XMLMarshallable
      Adds a child to the object, the child representing the marshallable object which must be added to the element.
      Specified by:
      addChild in interface XMLMarshallable
      Parameters:
      tagName - The name of tag for the child
      child - The child to be added
    • marshalIError

      public static final void marshalIError(XMLOutputter output, IError err)
      Marshals the error into the output.
      Parameters:
      output - The output to marshal the error into
      err - The error to marshal
    • unmarshalIError

      public static final IError unmarshalIError(XMLMarshallable child)
      Unmarshals the error into the output.
      Parameters:
      child - The element to read the error from
      Returns:
      The error