Class UsageRateModel

java.lang.Object
com.highdeal.pnr.hci.RateModel
com.highdeal.pnr.hci.UsageRateModel
All Implemented Interfaces:
IXMLMarshallable, XMLMarshallable, ContextualNode

public class UsageRateModel extends RateModel
This class represents an usage rate.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="usage">
   <xs:complexType>
    <xs:sequence>
     <xs:element ref="component" minOccurs="1" maxOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="ciName" type="xs:string" use="required"/>
    <xs:attribute name="name" type="xs:string"/>
    <xs:attribute name="description" type="xs:string"/>
   </xs:complexType>
 </xs:element>

  • Field Details

  • Constructor Details

    • UsageRateModel

      public UsageRateModel()
  • Method Details

    • setChargeableItemName

      public void setChargeableItemName(String name)
      Sets the chargeable item name.
      Parameters:
      name - the chargeable item name.
    • getChargeableItemName

      public String getChargeableItemName()
      Gets the chargeable item name.
      Returns:
      the chargeable item name.
    • checkValidity

      public boolean checkValidity()
      Returns true if the Usage Rate is valid. Usage rate is valid if all the following conditions are met:
      • The RateModel.checkValidity() returned true.
      • The Chargeable item is not null or empty
      • The Chargeable item is valid in the context.
      Overrides:
      checkValidity in class RateModel
      Returns:
      true if the usage rate is valid, false otherwise.
    • getContext

      public RatingContextDescription getContext(ContextualNode child)
      Gets the context for the specified child.
      Parameters:
      child - the child node
      Returns:
      the context.
    • availableCINames

      public List<QualifiedChargeableItemDescription> availableCINames()
      Gets available chargeable item names.
      Returns:
      a list of QualifiedChargeableItemDescription containing all chargeable item names.
    • setAttributes

      public void setAttributes(XMLAttributes atts)
      Description copied from interface: XMLMarshallable
      Sets the attributes of the XML representation of the element being processed.
      Specified by:
      setAttributes in interface XMLMarshallable
      Overrides:
      setAttributes in class RateModel
      Parameters:
      atts - The XML attributes of the current element
    • marshal

      public 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
      Overrides:
      marshal in class RateModel
      Parameters:
      output - The XML output to marshal the object into