Class UnlockChargingContractException

All Implemented Interfaces:
OperationResult, XMLMarshallable, Serializable

public class UnlockChargingContractException extends OperationFailureException
Exception thrown when the unlocking of a provider contract fails.

The following reasons are defined:

  • DOES_NOT_EXIST , which means that the provider contract does not exist
  • INVALID , which means that the operation is invalid (provider contract ID is missing)
  • NOT_LOCKED , which means that the provider contract is not locked
See Also:

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="unlockChargingContractFault">
   <xs:complexType>
     <xs:attribute name="reason" type="UnlockChargingContractFaultReasonType"/>
     <xs:attribute name="message" type="xs:string"/>
   </xs:complexType>
 </xs:element>
 <xs:simpleType name="UnlockChargingContractFaultReasonType">
   <xs:restriction base="xs:string">
      <xs:enumeration value="does_not_exist"/>
      <xs:enumeration value="invalid"/>
      <xs:enumeration value="not_locked"/>
   </xs:restriction>
 </xs:simpleType>

  • Field Details

    • DOES_NOT_EXIST

      public static final int DOES_NOT_EXIST
      0: Constant indicating that the provider contract does not exist
      See Also:
    • INVALID

      public static final int INVALID
      1: Constant indicating that the operation is invalid (provider contract ID is missing)
      See Also:
    • NOT_LOCKED

      public static final int NOT_LOCKED
      2: Constant indicating that the provider contract is not locked
      See Also:
    • OPERATION_NAME

      public static final String OPERATION_NAME
      The XML tag name of this exception: "unlockChargingContractFault"
      See Also:
  • Constructor Details

    • UnlockChargingContractException

      public UnlockChargingContractException()
      Constructs an empty exception.
    • UnlockChargingContractException

      public UnlockChargingContractException(int reason, String message)
      Constructs an exception with a message. It contains a human readable text.
      Parameters:
      reason - the reason.
      message - the message.
  • Method Details

    • getName

      public String getName()
      Gets the name of the operation.
      Returns:
      "unlockChargingContractFault"
    • getReason

      public int getReason()
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
    • setAttributes

      public void setAttributes(XMLAttributes atts)
      Description copied from interface: XMLMarshallable
      Sets the attributes of the XML representation of the element being processed.
      Parameters:
      atts - The XML attributes of the current element
    • addCharacterData

      public void addCharacterData(String cData)
      Description copied from interface: XMLMarshallable
      Adds character data to the content element.
      Parameters:
      cData - The character data to be added
    • 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.
      Parameters:
      tagName - The name of tag for the child
      child - The child to be added
    • marshal

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