Package com.highdeal.pnr.hci
Class StatelessRatingEvent
java.lang.Object
com.highdeal.pnr.hci.StatelessRatingEvent
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstant fortypeactivation.static final intConstant fortypecancellation.static final intConstant fortypeearly cancellation.static final intConstant fortyperesumption.static final intConstant fortypesuspension.static final intConstant fortypeusage. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String tagName, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.Returns the chargeable item to be rated.Gets the customer service identifier (a technical ID).intgetType()Gets the stateless rating event type.static final intgetTypeCode(String typeName) Gets the code of the stateless event.static final StringgetTypeName(int type) Gets the name of the stateless rating event.Gets the technical identifier of the end customer within the customer service.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidsetChargeableItem(ChargeableItem chargeableItem) Sets thechargeable itemto be rated (dynamically priced) by the connected SAP CC system.voidsetServiceId(String serviceId) Sets the customer service identifier (a technical ID).voidsetType(int type) Sets the stateless rating event type.voidSets the technical identifier of the end customer within the customer service.
-
Field Details
-
ACTIVATION
public static final int ACTIVATIONConstant fortypeactivation. The name of this type is "activation".- See Also:
-
USAGE
public static final int USAGEConstant fortypeusage. The name of this type is "usage".- See Also:
-
SUSPENSION
public static final int SUSPENSIONConstant fortypesuspension. The name of this type is "suspension".- See Also:
-
RESUMPTION
public static final int RESUMPTIONConstant fortyperesumption. The name of this type is "resumption".- See Also:
-
CANCELLATION
public static final int CANCELLATIONConstant fortypecancellation. The name of this type is "cancellation".- See Also:
-
EARLY_CANCELLATION
public static final int EARLY_CANCELLATIONConstant fortypeearly cancellation. The name of this type is "earlyCancellation".- See Also:
-
-
Constructor Details
-
StatelessRatingEvent
public StatelessRatingEvent()
-
-
Method Details
-
getChargeableItem
Returns the chargeable item to be rated.- Returns:
- The chargeable item to be rated
-
setChargeableItem
Sets thechargeable itemto 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
Gets the technical identifier of the end customer within the customer service.- Returns:
- The user ID
-
setUserId
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
Gets the customer service identifier (a technical ID).- Returns:
- The technical ID of the customer service
-
setServiceId
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
Description copied from interface:XMLMarshallableSets the attributes of the XML representation of the element being processed.- Specified by:
setAttributesin interfaceXMLMarshallable- Parameters:
atts- TheXML attributesof the current element
-
addChild
Description copied from interface:XMLMarshallableAdds a child to the object, thechildrepresenting the marshallable object which must be added to the element.- Specified by:
addChildin interfaceXMLMarshallable- Parameters:
tagName- The name of tag for the childchild- The child to be added
-
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data to be added
-
marshal
Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Specified by:
marshalin interfaceXMLMarshallable- Parameters:
output- TheXML outputto marshal the object into
-
getTypeName
Gets the name of the stateless rating event.- Parameters:
type- The type of the stateless rating event- Returns:
- The name of the type or
nullif the type is not valid
-
getTypeCode
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 thetypeNameis not a name of stateless event type. The type name must be in:activation,usage,suspension,resumption,cancellation,earlyCancellation.
-