com.highdeal.bart.hci
Class RatingSessionModel

java.lang.Object
  extended by com.highdeal.bart.hci.RatingSessionModel
All Implemented Interfaces:
XMLMarshallable

public class RatingSessionModel
extends java.lang.Object
implements XMLMarshallable

The rating session model is the main class of the rating process.

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:

With all modes, CDRs are rated in the order of their consumption date. Those mode can be divided into two types:

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
static class RatingSessionModel.Mode
           
static class RatingSessionModel.RatingMode
           
static class RatingSessionModel.SelectionMode
           
 
Field Summary
static int CLEANED_STATUS
          This status indicates that the rating session has been badly stopped and cleaned at the server restart.
static int ENDED_STATUS
          This status indicates that the rating session is ended.
static int IN_PROGRESS_STATUS
          This status indicates that the rating session is running.
static int RATING_CDRS_STATUS
          This status indicates that the rating session is running and rating the selected subscriptions.
static int SELECTING_SUBS_STATUS
          This status indicates that the rating session is running and selecting the subscriptions.
static int STOPPED_STATUS
          This status indicates that the rating session has been stopped manually.
static java.lang.String TAG_NAME
           
 
Constructor Summary
RatingSessionModel()
          Builds an empty rating session model
RatingSessionModel(java.lang.Integer batchRatingGroupId, java.util.Date maxConsumptionDate, java.lang.String description, RatingSessionModel.Mode mode)
          Build a rating session with batch rating group Id, max consumption date and description.
RatingSessionModel(java.lang.Long OID, java.lang.Integer batchRatingGroupId, java.util.Date startDate, java.lang.Long duration, RatingSessionModel.Mode mode, java.util.Date maxConsumptionDate, java.lang.Long nbCDRRated, java.lang.Long nbCDRError, java.lang.String description, int status)
          Build a rating session with full information.
RatingSessionModel(java.lang.Long OID, java.lang.Integer batchRatingGroupId, java.lang.Long cdrSubscriptionID, java.util.Date startDate, java.lang.Long duration, RatingSessionModel.Mode mode, java.util.Date maxConsumptionDate, java.lang.Long nbCDRRated, java.lang.Long nbCDRError, java.lang.String description, int status)
          Build a rating session with full information.
 
Method Summary
 java.lang.Long _getOID()
          Gets the identifier of the rating session.
 void _setDuration(java.lang.Long d)
          Sets the rating session duration.
 void _setNbCDRError(java.lang.Long nbError)
          Sets the number of erroneous CDRs.
 void _setNbCDRRated(java.lang.Long nbRated)
          Sets the number of rated CDRs
 void _setOID(java.lang.Long oid)
          Sets the identifier of the rating session.
 void _setStartDate(java.util.Date sd)
          Sets the start date of the rating session.
 void _setStatus(int statusType)
          Sets the status of the rating session.
 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.
 java.lang.Integer getBatchRatingGroupId()
          Gets the batch rating group identifier of the rating session.
 java.lang.Long getCDRSubscriptionID()
          Gets the CDR subscription Id.
 java.lang.String getDescription()
          Gets the description of the rating session.
 java.lang.Long getDuration()
          Gets the rating session duration.
 java.util.Date getMaxConsumptionDate()
          Gets the max consumption date of the rating session.
 RatingSessionModel.Mode getMode()
          Gets the mode of the rating session.
 java.lang.Long getNbCDRError()
          Gets the number of erroneous CDRs.
 java.lang.Long getNbCDRRated()
          Gets the number of rated CDRs.
 java.util.Date getStartDate()
          Gets the start date of the rating session.
 int getStatus()
          Gets the status of the rating session.
 java.lang.String getStatusStringRepresentation()
          Return a String representation of rating mode
 void innerMarshall(XMLOutputter output)
          This method is used by subclasses only.
 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 setBatchRatingGroupId(java.lang.Integer batchRatingGroupId)
          Sets the batch rating group identifier of the rating session.
 void setCDRSubscriptionID(java.lang.Long subscriptionID)
          Sets the CDR subscription Id.
 void setDescription(java.lang.String description)
          Sets the description of the rating session.
 void setMaxConsumptionDate(java.util.Date consumptionDate)
          Sets the max consumption of the rating session.
 void setMode(RatingSessionModel.Mode mode)
          Sets the mode of the rating session.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TAG_NAME

public static final java.lang.String TAG_NAME
See Also:
Constant Field Values

IN_PROGRESS_STATUS

public static final int IN_PROGRESS_STATUS
This status indicates that the rating session is running.

See Also:
Constant Field Values

ENDED_STATUS

public static final int ENDED_STATUS
This status indicates that the rating session is ended.

See Also:
Constant Field Values

STOPPED_STATUS

public static final int STOPPED_STATUS
This status indicates that the rating session has been stopped manually.

See Also:
Constant Field Values

CLEANED_STATUS

public static final int CLEANED_STATUS
This status indicates that the rating session has been badly stopped and cleaned at the server restart.

See Also:
Constant Field Values

SELECTING_SUBS_STATUS

public static final int SELECTING_SUBS_STATUS
This status indicates that the rating session is running and selecting the subscriptions.

See Also:
Constant Field Values

RATING_CDRS_STATUS

public static final int RATING_CDRS_STATUS
This status indicates that the rating session is running and rating the selected subscriptions.

See Also:
Constant Field Values
Constructor Detail

RatingSessionModel

public RatingSessionModel()
Builds an empty rating session model


RatingSessionModel

public RatingSessionModel(java.lang.Integer batchRatingGroupId,
                          java.util.Date maxConsumptionDate,
                          java.lang.String description,
                          RatingSessionModel.Mode mode)
Build a rating session with batch rating group Id, max consumption date and description.


RatingSessionModel

public RatingSessionModel(java.lang.Long OID,
                          java.lang.Integer batchRatingGroupId,
                          java.util.Date startDate,
                          java.lang.Long duration,
                          RatingSessionModel.Mode mode,
                          java.util.Date maxConsumptionDate,
                          java.lang.Long nbCDRRated,
                          java.lang.Long nbCDRError,
                          java.lang.String description,
                          int status)
Build a rating session with full information. This constructor is reserved for internal use.


RatingSessionModel

public RatingSessionModel(java.lang.Long OID,
                          java.lang.Integer batchRatingGroupId,
                          java.lang.Long cdrSubscriptionID,
                          java.util.Date startDate,
                          java.lang.Long duration,
                          RatingSessionModel.Mode mode,
                          java.util.Date maxConsumptionDate,
                          java.lang.Long nbCDRRated,
                          java.lang.Long nbCDRError,
                          java.lang.String description,
                          int status)
Build a rating session with full information. This constructor is reserved for internal use.

Method Detail

getDuration

public java.lang.Long getDuration()
Gets the rating session duration.

Returns:
the rating session duration.

_setDuration

public void _setDuration(java.lang.Long d)
Sets the rating session duration.

Parameters:
d - the duration

getNbCDRRated

public java.lang.Long getNbCDRRated()
Gets the number of rated CDRs.

Returns:
the number of rated CDRs.

_setNbCDRRated

public void _setNbCDRRated(java.lang.Long nbRated)
Sets the number of rated CDRs

Parameters:
nbRated - the number of rated CDRs

getNbCDRError

public java.lang.Long getNbCDRError()
Gets the number of erroneous CDRs.

Returns:
the number of erroneous CDRs.

_setNbCDRError

public void _setNbCDRError(java.lang.Long nbError)
Sets the number of erroneous CDRs.

Parameters:
nbError - the number of erroneous CDRs

_getOID

public java.lang.Long _getOID()
Gets the identifier of the rating session.

Returns:
the identifier of the rating session.

_setOID

public void _setOID(java.lang.Long oid)
Sets the identifier of the rating session.

Parameters:
oid - the identifier

getDescription

public java.lang.String getDescription()
Gets the description of the rating session.

Returns:
the description of the rating session.

setDescription

public void setDescription(java.lang.String description)
Sets the description of the rating session.

Parameters:
description - the description

getStartDate

public java.util.Date getStartDate()
Gets the start date of the rating session.

Returns:
the start of the rating session.

_setStartDate

public void _setStartDate(java.util.Date sd)
Sets the start date of the rating session.

Parameters:
sd - the start date

getMaxConsumptionDate

public java.util.Date getMaxConsumptionDate()
Gets the max consumption date of the rating session.

Returns:
the max consumption date of the rating session.

setMaxConsumptionDate

public void setMaxConsumptionDate(java.util.Date consumptionDate)
Sets the max consumption of the rating session.

Parameters:
consumptionDate - the max consumption date

getMode

public RatingSessionModel.Mode getMode()
Gets the mode of the rating session.

Returns:
the mode of the rating session.

setMode

public void setMode(RatingSessionModel.Mode mode)
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

public java.lang.Integer getBatchRatingGroupId()
Gets the batch rating group identifier of the rating session.

Returns:
the batch rating group identifier.

setBatchRatingGroupId

public void setBatchRatingGroupId(java.lang.Integer batchRatingGroupId)
Sets the batch rating group identifier of the rating session.

Parameters:
batchRatingGroupId - the batch rating group identifier

getCDRSubscriptionID

public java.lang.Long getCDRSubscriptionID()
Gets the CDR subscription Id.

Returns:
the CDR subscription Id.

setCDRSubscriptionID

public void setCDRSubscriptionID(java.lang.Long subscriptionID)
Sets the CDR subscription Id.

Parameters:
subscriptionID - the subscription Id

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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

innerMarshall

public void innerMarshall(XMLOutputter output)
This method is used by subclasses only.


getStatusStringRepresentation

public java.lang.String getStatusStringRepresentation()
Return a String representation of rating mode

Returns:
a String representation of rating mode

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