com.highdeal.pnr.hci
Class StatelessRatingEvent

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

public class StatelessRatingEvent
extends java.lang.Object
implements XMLMarshallable

This Java class represents a stateless rating event, you specify this information in the rating operation requests.

The event includes:

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 Summary
static int ACTIVATION
          Constant for type activation.
static int CANCELLATION
          Constant for type cancellation.
static int EARLY_CANCELLATION
          Constant for type early cancellation.
static int RESUMPTION
          Constant for type resumption.
static int SUSPENSION
          Constant for type suspension.
static int USAGE
          Constant for type usage.
 
Constructor Summary
StatelessRatingEvent()
           
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 ChargeableItem getChargeableItem()
          Returns the chargeable item to be rated.
 java.lang.String getServiceId()
          Gets the customer service identifier (a technical ID).
 int getType()
          Gets the stateless rating event type.
static int getTypeCode(java.lang.String typeName)
          Gets the code of the stateless event.
static java.lang.String getTypeName(int type)
          Gets the name of the stateless rating event.
 java.lang.String getUserId()
          Gets the technical identifier of the end customer within the customer service.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setChargeableItem(ChargeableItem chargeableItem)
          Sets the chargeable item to be rated (dynamically priced) by the connected SAP CC system.
 void setServiceId(java.lang.String serviceId)
          Sets the customer service identifier (a technical ID).
 void setType(int type)
          Sets the stateless rating event type.
 void setUserId(java.lang.String userId)
          Sets the technical identifier of the end customer within the customer service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTIVATION

public static final int ACTIVATION
Constant for type activation. The name of this type is "activation".

See Also:
Constant Field Values

USAGE

public static final int USAGE
Constant for type usage. The name of this type is "usage".

See Also:
Constant Field Values

SUSPENSION

public static final int SUSPENSION
Constant for type suspension. The name of this type is "suspension".

See Also:
Constant Field Values

RESUMPTION

public static final int RESUMPTION
Constant for type resumption. The name of this type is "resumption".

See Also:
Constant Field Values

CANCELLATION

public static final int CANCELLATION
Constant for type cancellation. The name of this type is "cancellation".

See Also:
Constant Field Values

EARLY_CANCELLATION

public static final int EARLY_CANCELLATION
Constant for type early cancellation. The name of this type is "earlyCancellation".

See Also:
Constant Field Values
Constructor Detail

StatelessRatingEvent

public StatelessRatingEvent()
Method Detail

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 java.lang.String getUserId()
Gets the technical identifier of the end customer within the customer service.

Returns:
The user ID

setUserId

public void setUserId(java.lang.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 java.lang.String getServiceId()
Gets the customer service identifier (a technical ID).

Returns:
The technical ID of the customer service

setServiceId

public void setServiceId(java.lang.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:
java.lang.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(java.lang.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(java.lang.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 java.lang.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(java.lang.String typeName)
                             throws java.lang.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:
java.lang.IllegalArgumentException - when the typeName is not a name of stateless event type. The type name must be in: activation, usage, suspension, resumption, cancellation, earlyCancellation.

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)