Package com.highdeal.bart.hci
Class RatingSessionModel
java.lang.Object
com.highdeal.bart.hci.RatingSessionModel
- All Implemented Interfaces:
XMLMarshallable
The rating session model is the main class of the rating process.
Basically, the rating process selects CDRs (
The rating process is launch using the
Basically, the rating process selects CDRs (
CDRModel) and sends them to the SAP Convergent Charging rating engine using batch
service.
The rating process is launch using the
RunRatingSessionOp operation.
On client side User should define the following parameters:
- The max consumption: selected CDRs will have a consumption date before this max consumption date.
- The batch rating group ID: a rating session is performed on only one batch rating group ID. You can't run two rating session on the same batch rating group ID.
- The description: A user define description.
- The mode: described below.
-
RatingSessionModel.SelectionMode: The way to selects CDRs-
RatingSessionModel.SelectionMode.NORMAL: All CDRs from the same subscription ID are fetch in the same time. This mode should be used for B2C subscriptions. -
RatingSessionModel.SelectionMode.WINDOWED: CDRs from the same subscription ID are fetch windowed. This mode should be used for B2B subscriptions.
-
-
RatingSessionModel.RatingMode: The way to rate CDRs-
RatingSessionModel.RatingMode.FIRSTFAIL: Once a rating error happens, latter CDRs from this same subscriptions will not be rated. -
RatingSessionModel.RatingMode.MOST: Even if rating errors happen, all CDRs will be rated. -
RatingSessionModel.RatingMode.TRY: CDRs are rated but no commit will be done on SAP Convergent Charging BART or Core side. This rating mode could be used to test current configuration.
-
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="rating">
<xs:complexType>
<xs:attribute name="sessionID" type="xs:string"/>
<xs:attribute name="batchRatingGroupId" type="xs:string"/>
<xs:attribute name="subscriptionID" type="xs:string"/>
<xs:attribute name="startDate" type="xs:dateTime"/>
<xs:attribute name="duration" type="xs:string"/>
<xs:attribute name="mode" type="RatingSessionModeType"/>
<xs:attribute name="maxConsumptionDate" type="xs:dateTime"/>
<xs:attribute name="nbCDRRated" type="xs:string"/>
<xs:attribute name="nbCDRError" type="xs:string"/>
<xs:attribute name="description" type="xs:string"/>
<xs:attribute name="status" type="RatingSessionStatusType"/>
</xs:complexType>
</xs:element><xs:simpleType name="RatingSessionStatusType">
<xs:restriction base="xs:string">
<xs:enumeration value="inProgress"/>
<xs:enumeration value="ended"/>
<xs:enumeration value="stopped"/>
<xs:enumeration value="cleaned"/>
</xs:restriction>
</xs:simpleType><xs:simpleType name="RatingSessionModeType">
<xs:restriction base="xs:string">
<xs:enumeration value="subscription-firstFail"/>
<xs:enumeration value="subscription-most"/>
<xs:enumeration value="subscription-try"/>
<xs:enumeration value="subscription-windowed-firstFail"/>
<xs:enumeration value="subscription-windowed-most"/>
<xs:enumeration value="subscription-windowed-try"/>
<xs:enumeration value="day-most"/>
<xs:enumeration value="day-subscription-firstFail"/>
<xs:enumeration value="azimut"/> <!-- deprecated -->
</xs:restriction>
</xs:simpleType>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThis status indicates that the rating session has been badly stopped and cleaned at the server restart.static final intThis status indicates that the rating session is ended.static final intThis status indicates that the rating session is running.static final intThis status indicates that the rating session is running and rating the selected subscriptions.static final intThis status indicates that the rating session is running and selecting the subscriptions.static final intThis status indicates that the rating session has been stopped manually.static final String -
Constructor Summary
ConstructorsConstructorDescriptionBuilds an empty rating session modelRatingSessionModel(Integer batchRatingGroupId, Date maxConsumptionDate, String description, RatingSessionModel.Mode mode) Build a rating session with batch rating group Id, max consumption date and description.RatingSessionModel(Long OID, Integer batchRatingGroupId, Long cdrSubscriptionID, Date startDate, Long duration, RatingSessionModel.Mode mode, Date maxConsumptionDate, Long nbCDRRated, Long nbCDRError, String description, int status) Build a rating session with full information.RatingSessionModel(Long OID, Integer batchRatingGroupId, Date startDate, Long duration, RatingSessionModel.Mode mode, Date maxConsumptionDate, Long nbCDRRated, Long nbCDRError, String description, int status) Build a rating session with full information. -
Method Summary
Modifier and TypeMethodDescription_getOID()Gets the identifier of the rating session.void_setDuration(Long d) Sets the rating session duration.void_setNbCDRError(Long nbError) Sets the number of erroneous CDRs.void_setNbCDRRated(Long nbRated) Sets the number of rated CDRsvoidSets the identifier of the rating session.void_setStartDate(Date sd) Sets the start date of the rating session.void_setStatus(int statusType) Sets the status of the rating session.voidaddCharacterData(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.Gets the batch rating group identifier of the rating session.Gets the CDR subscription Id.Gets the description of the rating session.Gets the rating session duration.Gets the max consumption date of the rating session.getMode()Gets the mode of the rating session.Gets the number of erroneous CDRs.Gets the number of rated CDRs.Gets the start date of the rating session.intGets the status of the rating session.Return a String representation of rating modevoidinnerMarshall(XMLOutputter output) This method is used by subclasses only.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.voidsetBatchRatingGroupId(Integer batchRatingGroupId) Sets the batch rating group identifier of the rating session.voidsetCDRSubscriptionID(Long subscriptionID) Sets the CDR subscription Id.voidsetDescription(String description) Sets the description of the rating session.voidsetMaxConsumptionDate(Date consumptionDate) Sets the max consumption of the rating session.voidSets the mode of the rating session.toString()
-
Field Details
-
TAG_NAME
- See Also:
-
IN_PROGRESS_STATUS
public static final int IN_PROGRESS_STATUSThis status indicates that the rating session is running.- See Also:
-
ENDED_STATUS
public static final int ENDED_STATUSThis status indicates that the rating session is ended.- See Also:
-
STOPPED_STATUS
public static final int STOPPED_STATUSThis status indicates that the rating session has been stopped manually.- See Also:
-
CLEANED_STATUS
public static final int CLEANED_STATUSThis status indicates that the rating session has been badly stopped and cleaned at the server restart.- See Also:
-
SELECTING_SUBS_STATUS
public static final int SELECTING_SUBS_STATUSThis status indicates that the rating session is running and selecting the subscriptions.- See Also:
-
RATING_CDRS_STATUS
public static final int RATING_CDRS_STATUSThis status indicates that the rating session is running and rating the selected subscriptions.- See Also:
-
-
Constructor Details
-
RatingSessionModel
public RatingSessionModel()Builds an empty rating session model -
RatingSessionModel
public RatingSessionModel(Integer batchRatingGroupId, Date maxConsumptionDate, String description, RatingSessionModel.Mode mode) Build a rating session with batch rating group Id, max consumption date and description. -
RatingSessionModel
public RatingSessionModel(Long OID, Integer batchRatingGroupId, Date startDate, Long duration, RatingSessionModel.Mode mode, Date maxConsumptionDate, Long nbCDRRated, Long nbCDRError, String description, int status) Build a rating session with full information. This constructor is reserved for internal use. -
RatingSessionModel
public RatingSessionModel(Long OID, Integer batchRatingGroupId, Long cdrSubscriptionID, Date startDate, Long duration, RatingSessionModel.Mode mode, Date maxConsumptionDate, Long nbCDRRated, Long nbCDRError, String description, int status) Build a rating session with full information. This constructor is reserved for internal use.
-
-
Method Details
-
getDuration
Gets the rating session duration.- Returns:
- the rating session duration.
-
_setDuration
Sets the rating session duration.- Parameters:
d- the duration
-
getNbCDRRated
Gets the number of rated CDRs.- Returns:
- the number of rated CDRs.
-
_setNbCDRRated
Sets the number of rated CDRs- Parameters:
nbRated- the number of rated CDRs
-
getNbCDRError
Gets the number of erroneous CDRs.- Returns:
- the number of erroneous CDRs.
-
_setNbCDRError
Sets the number of erroneous CDRs.- Parameters:
nbError- the number of erroneous CDRs
-
_getOID
Gets the identifier of the rating session.- Returns:
- the identifier of the rating session.
-
_setOID
Sets the identifier of the rating session.- Parameters:
oid- the identifier
-
getDescription
Gets the description of the rating session.- Returns:
- the description of the rating session.
-
setDescription
Sets the description of the rating session.- Parameters:
description- the description
-
getStartDate
Gets the start date of the rating session.- Returns:
- the start of the rating session.
-
_setStartDate
Sets the start date of the rating session.- Parameters:
sd- the start date
-
getMaxConsumptionDate
Gets the max consumption date of the rating session.- Returns:
- the max consumption date of the rating session.
-
setMaxConsumptionDate
Sets the max consumption of the rating session.- Parameters:
consumptionDate- the max consumption date
-
getMode
Gets the mode of the rating session.- Returns:
- the mode of the rating session.
-
setMode
Sets the mode of the rating session.- Parameters:
mode- the mode of the rating session
-
getStatus
public int getStatus()Gets the status of the rating session.- Returns:
- the status of the rating session.
-
_setStatus
public void _setStatus(int statusType) Sets the status of the rating session. This should be reserved for internal use.- Parameters:
statusType- the new status
-
getBatchRatingGroupId
Gets the batch rating group identifier of the rating session.- Returns:
- the batch rating group identifier.
-
setBatchRatingGroupId
Sets the batch rating group identifier of the rating session.- Parameters:
batchRatingGroupId- the batch rating group identifier
-
getCDRSubscriptionID
Gets the CDR subscription Id.- Returns:
- the CDR subscription Id.
-
setCDRSubscriptionID
Sets the CDR subscription Id.- Parameters:
subscriptionID- the subscription Id
-
toString
-
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
-
innerMarshall
This method is used by subclasses only. -
getStatusStringRepresentation
Return a String representation of rating mode- Returns:
- a String representation of rating mode
-