Class StatelessRatingEvent

java.lang.Object
com.highdeal.pnr.hci.StatelessRatingEvent
All Implemented Interfaces:
XMLMarshallable

public class StatelessRatingEvent extends Object implements XMLMarshallable
This Java class represents a stateless rating event, you specify this information in the rating operation requests.

The event includes:

  • an extended chargeable item (XCI) composed of the chargeable item, the USID, and the SID
  • an event type: customer service usage, activation, ...

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="statelessRatingEvent">
   <xs:complexType>
     <xs:sequence>
       <xs:element ref="ci"
                   minOccurs="1" maxOccurs="1"/>
     </xs:sequence>
     <xs:attribute name="userId" type="xs:string"/>
     <xs:attribute name="serviceId" type="xs:string"/>
     <xs:attribute name="type" type="StatelessRatingEventType" default="usage"/>
   </xs:complexType>
 </xs:element>
 <xs:simpleType name="StatelessRatingEventType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="activation"/>
     <xs:enumeration value="usage"/>
     <xs:enumeration value="suspension"/>
     <xs:enumeration value="resumption"/>
     <xs:enumeration value="cancellation"/>
     <xs:enumeration value="earlyCancellation"/>
   </xs:restriction>
 </xs:simpleType>

  • Field Details

    • ACTIVATION

      public static final int ACTIVATION
      Constant for type activation. The name of this type is "activation".
      See Also:
    • USAGE

      public static final int USAGE
      Constant for type usage. The name of this type is "usage".
      See Also:
    • SUSPENSION

      public static final int SUSPENSION
      Constant for type suspension. The name of this type is "suspension".
      See Also:
    • RESUMPTION

      public static final int RESUMPTION
      Constant for type resumption. The name of this type is "resumption".
      See Also:
    • CANCELLATION

      public static final int CANCELLATION
      Constant for type cancellation. The name of this type is "cancellation".
      See Also:
    • EARLY_CANCELLATION

      public static final int EARLY_CANCELLATION
      Constant for type early cancellation. The name of this type is "earlyCancellation".
      See Also:
  • Constructor Details

    • StatelessRatingEvent

      public StatelessRatingEvent()
  • Method Details

    • getChargeableItem

      public ChargeableItem getChargeableItem()
      Returns the chargeable item to be rated.
      Returns:
      The chargeable item to be rated
    • setChargeableItem

      public void setChargeableItem(ChargeableItem chargeableItem)
      Sets the chargeable item to be rated (dynamically priced) by the connected SAP CC system. The chargeable item represents the consumption of a digital service.
      Parameters:
      chargeableItem - The chargeable item to be rated
    • getUserId

      public String getUserId()
      Gets the technical identifier of the end customer within the customer service.
      Returns:
      The user ID
    • setUserId

      public void setUserId(String userId)
      Sets the technical identifier of the end customer within the customer service. The SAP CC system controls this ID.
      Parameters:
      userId - The user ID
    • getServiceId

      public String getServiceId()
      Gets the customer service identifier (a technical ID).
      Returns:
      The technical ID of the customer service
    • setServiceId

      public void setServiceId(String serviceId)
      Sets the customer service identifier (a technical ID).
      Parameters:
      serviceId - The technical ID of the customer service
    • getType

      public int getType()
      Gets the stateless rating event type.
      Returns:
      The stateless rating event type
    • setType

      public void setType(int type)
      Sets the stateless rating event type.
      Parameters:
      type - The stateless rating event type
      Throws:
      IllegalArgumentException - when type is not valid. The type must be in: ACTIVATION, USAGE, SUSPENSION, RESUMPTION, CANCELLATION, EARLY_CANCELLATION.
    • 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
      Parameters:
      atts - The XML attributes of the current element
    • 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
    • addCharacterData

      public void addCharacterData(String cData)
      Description copied from interface: XMLMarshallable
      Adds character data to the content element.
      Specified by:
      addCharacterData in interface XMLMarshallable
      Parameters:
      cData - The character data to be added
    • 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 XMLMarshallable
      Parameters:
      output - The XML output to marshal the object into
    • getTypeName

      public static final String getTypeName(int type)
      Gets the name of the stateless rating event.
      Parameters:
      type - The type of the stateless rating event
      Returns:
      The name of the type or null if the type is not valid
    • getTypeCode

      public static final int getTypeCode(String typeName) throws IllegalArgumentException
      Gets the code of the stateless event.
      Parameters:
      typeName - The name of the stateless event type
      Returns:
      The code of the stateless event type
      Throws:
      IllegalArgumentException - when the typeName is not a name of stateless event type. The type name must be in: activation, usage, suspension, resumption, cancellation, earlyCancellation.