SAP CC 3.0 BART API

com.highdeal.bart.hci
Class CDRModel

java.lang.Object
  extended by com.highdeal.bart.hci.CDRModel
All Implemented Interfaces:
java.lang.Comparable<CDRModel>

public class CDRModel
extends java.lang.Object
implements java.lang.Comparable<CDRModel>

A CDR is a Call Detail Record, an computer record from a telephone exchange.

The CDR model class is BART CDR representation. CDR models keep dialing data such as consumption date and user accesses in database in order to rate them on SAP CC systems. CDRs are linked through all 3 BART processes: acquisition process, consolidation process and rating process. Besides CDRs data, each CDR has a status that evolved during BART processes.

CDR are created during the acquisition process.

On the client side, following CDR models fields should be fill with related dialing data:

On the server side, acquisition process will filled following fields: CDR is then inserted in the BART database, waiting for modification or rating process. See AcquisitionSessionModel for information about the acquisition process.

During the acquisition process, a consolidation process is done

The consolidation process tries to fetch cdr's subscription information usable for the rating process. It fills the following fields: CDRs that have been successfully consolidated have status "new".
If consolidation failed for this CDRs, its status became "no_provisioning" and its batch rating group became -"2". If the consolidation is successful, but the CDR's subscription is only online type, the CDR status became "online subscription" and the CDR batch rating group became "-1". In those both case, a manual consolidation (ConsolidateCDRBulkOp) is needed to rate those CDRs.

Finally the CDR is rated with the rating process.

The rating process selects every CDRs with: Other CDRs will be ignored by the rating process.
Following fields will be updated during this process: When the CDR rating is successful, the status becomes "rated". When an rating error occurs, the status becomes "error" and the following fields will be filled: See RatingSessionModel for information about rating process.

A CDR can be rerated through the rerating process

In this process, selected rated CDRs are rerated. This process is completely handled by the SAP Convergent Charging Core Server. CDRs selected for rerating have the status "to_be_rerated".


XML Schema Fragment
<xs:element name="cdr">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="ci" minOccurs="1" maxOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="cdrID" type="xs:string"/>
    <xs:attribute name="batchRatingGroupId" type="xs:int"/>
    <xs:attribute name="userID" type="xs:string" use="required"/>
    <xs:attribute name="serviceID" type="xs:string" use="required"/>
    <xs:attribute name="subscriptionID" type="xs:string"/>
    <xs:attribute name="consumptionDate" type="xs:dateTime" use="required"/>
    <xs:attribute name="status" type="cdrStatusType"/>
    <xs:attribute name="acquisitionDate" type="xs:dateTime"/>
    <xs:attribute name="acquisitionID" type="xs:string"/>
    <xs:attribute name="ratingDate" type="xs:dateTime"/>
    <xs:attribute name="ratingID" type="xs:string"/>
    <xs:attribute name="errorCode" type="xs:string"/>
    <xs:attribute name="errorDescription" type="xs:string"/>
    <xs:attribute name="source" type="xs:string"/>
    <xs:attribute name="magicNumber" type="xs:string"/>
    <xs:attribute name="snapshotID" type="xs:int"/>
  </xs:complexType>
 </xs:element>
<xs:simpleType name="cdrStatusType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="new"/>
     <xs:enumeration value="error"/>
     <xs:enumeration value="rated"/>
     <xs:enumeration value="duplicate"/>
     <xs:enumeration value="ignored"/>
     <xs:enumeration value="to_be_rerated"/>
     <xs:enumeration value="no_provisioning"/>
     <xs:enumeration value="online_subscription"/>
   </xs:restriction>
 </xs:simpleType>

Field Summary
static int BRGRP_NO_PROVISIONING
          Reserved for internal used.
static int BRGRP_ONLINE_SUBSCRIPTION
          Reserved for internal used.
static int NO_SUBSCRIPTION
          Reserved for internal used.
static int STATUS_DUPLICATE
          This status indicates that the CDR is a duplicate.
static int STATUS_ERROR
          This status indicates that a attempt of rating has been done but a rating errors occurs.
static int STATUS_IGNORED
          This status indicates that the CDR will be ignored by the next rating session.
static int STATUS_NEW
          This status indicates that the CDR has been correctly acquired and consolidated.
static int STATUS_NO_PROVISIONING
          This status indicates that the CDR has been acquired but not consolidated.
static int STATUS_ONLINE_SUBSCRIPTION
          This status indicates that the CDR is linked to an online only subscription and not a offline one.
static int STATUS_RATED
          This status indicates that the CDR has been successfully rated.
static int STATUS_RATING_IN_PROGRESS
          Deprecated. - not use since v1.2
static int STATUS_TO_BE_RERATED
          This status indicates that the CDR is selected to be rerated through SAP CC rerating operation.
static java.lang.String TAG_NAME
          XML tag name of this model.
 
Constructor Summary
CDRModel()
          Builds an empty CDR model
CDRModel(ChargeableItem item, java.lang.String userID, java.lang.String serviceID, java.util.Date consumptionDate, java.lang.String source)
          Builds a CDR model with an chargeable item, source and access information.
CDRModel(java.lang.Long OID, ChargeableItem item, java.lang.String userID, java.lang.String serviceID, java.lang.Integer batchRatingGroupId, java.lang.Long subscriptionID, java.lang.Short partitionID, java.lang.Long chargeID, java.util.Date consumptionDate, int status)
          Build a CDR model with rating information.
CDRModel(java.lang.Long OID, java.lang.Integer batchRatingGroupId, ChargeableItem item, java.lang.String userID, java.lang.String serviceID, java.lang.Long subscriptionID, java.lang.Short partitionID, java.lang.Long chargeID, java.util.Date consumptionDate, java.util.Date acquisitionDate, java.util.Date ratingDate, int errorCode, java.lang.String errorDescription, int status, java.lang.Long acquisitionID, java.lang.Long ratingID, java.lang.String source, java.lang.String magicNumber)
          Builds a CDR model with full information.
 
Method Summary
 AccessibleChargeType _getAccessibleChargeType()
           
 java.lang.String _getDatabaseMagicNumber()
           
 java.lang.Long _getOID()
          Gets the CDR model identifier.
 int _getOriginalErrorCode()
           
 java.lang.String _getOriginalErrorDescription()
           
 int _getOriginalStatus()
           
 void _setAccessibleChargeType(AccessibleChargeType accessibleChargeType)
           
 void _setAcquisitionDate(java.util.Date acqDate)
          Sets the acquisition date of the CDR model.
 void _setAcquisitionID(java.lang.Long acqID)
          Sets the acquisition session identifier.
 void _setBatchRatingGroupId(java.lang.Integer bgrp)
          Sets the batch rating group identifier
 void _setCompareKey(java.lang.Long compareKey)
           
 void _setErrorCode(int ratingError)
          Sets the error code.
 void _setErrorDescription(java.lang.String description)
          Sets the error description.
 void _setMagicNumber(java.lang.String mNumber)
          Sets the magic number of the CDR model.
 void _setOID(java.lang.Long oid)
          Sets the CDR model identifier.
 void _setOriginalErrorCode(int ratingError)
           
 void _setOriginalErrorDescription(java.lang.String description)
           
 void _setRatingDate(java.util.Date ratDate)
          Sets the CDR model rating date.
 void _setRatingID(java.lang.Long ratID)
          Sets the rating session identifier.
 void _setSnapshotID(int snapshotID)
          Sets the snapshot identifier used to rate event.
 void _setStatus(int s)
          Sets the CDR model status.
 void _setSubscriptionID(java.lang.Long subID)
          Sets the subscription identifier.
 void addCharacterData(java.lang.String cData)
           
 void addChild(java.lang.String tagName, XMLMarshallable child)
           
protected  java.lang.Long compareKey()
           
 int compareTo(CDRModel that)
           
 CDRModel duplicate()
          Duplicates a CDR model.
 java.lang.String get32MagicNumber()
          Gets the magic number of the CDR model.
 java.util.Date getAcquisitionDate()
          Gets the acquisition date of the CDR model.
 java.lang.Long getAcquisitionID()
          Gets the acquisition session identifier.
 java.lang.Integer getBatchRatingGroupId()
          Gets the batch rating group identifier.
 ChargeableItem getChargeableItem()
          Gets the chargeable item of the CDR model.
 java.lang.Long getChargeID()
          Gets the charge identifier.
 java.util.Date getConsumptionDate()
          Gets the consumption date of the CDR model.
 int getErrorCode()
          Gets the error code.
 java.lang.String getErrorDescription()
          Gets the error description.
 java.lang.String getMagicNumber()
          Gets the magic number of the CDR model.
 java.lang.String getName()
          Gets the CDR name.
 java.lang.Short getPartitionID()
          Gets the partition identifier.
 java.util.Date getRatingDate()
          Gets CDR model rating date.
 java.lang.Long getRatingID()
          Gets the rating session identifier.
 java.lang.String getServiceID()
          Gets the service Id.
 int getSnapshotID()
          Gets the snapshot identifier used to rate event.
 java.lang.String getSource()
          Gets the CDR model source.
 int getStatus()
          Gets the CDR model status.
 java.lang.Long getSubscriptionID()
          Gets the subscription identifier
 java.lang.String getUserID()
          Gets the user Id.
 void marshal(XMLOutputter output)
           
 void setAttributes(XMLAttributes atts)
           
 void setCDRIgnored()
          Sets the CDR to the status "ignored".
 void setCDRNew()
          Sets the CDR to the status "new".
 void setChargeableItem(ChargeableItem item)
          Sets the chargeable item of the CDR model.
 void setChargeID(java.lang.Long chargeID)
          Sets the charge identifier.
 void setConsumptionDate(java.util.Date consumptionDate)
          Sets the consumption date of the CDR model.
 void setName(java.lang.String name)
          Sets CDR name by setting item name
 void setPartitionID(java.lang.Short partitionID)
          Sets the partition identifier.
 void setServiceID(java.lang.String serviceID)
          Sets the service Id.
 void setSource(java.lang.String source)
          Sets the CDR model source.
 void setUserID(java.lang.String userID)
          Sets the user Id.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_NEW

public static final int STATUS_NEW
This status indicates that the CDR has been correctly acquired and consolidated.

See Also:
Constant Field Values

STATUS_ERROR

public static final int STATUS_ERROR
This status indicates that a attempt of rating has been done but a rating errors occurs.

See Also:
Constant Field Values

STATUS_RATED

public static final int STATUS_RATED
This status indicates that the CDR has been successfully rated.

See Also:
Constant Field Values

STATUS_DUPLICATE

public static final int STATUS_DUPLICATE
This status indicates that the CDR is a duplicate.

See Also:
Constant Field Values

STATUS_IGNORED

public static final int STATUS_IGNORED
This status indicates that the CDR will be ignored by the next rating session. It has to be manually set.

See Also:
Constant Field Values

STATUS_TO_BE_RERATED

public static final int STATUS_TO_BE_RERATED
This status indicates that the CDR is selected to be rerated through SAP CC rerating operation.

See Also:
Constant Field Values

STATUS_NO_PROVISIONING

public static final int STATUS_NO_PROVISIONING
This status indicates that the CDR has been acquired but not consolidated.

See Also:
Constant Field Values

STATUS_ONLINE_SUBSCRIPTION

public static final int STATUS_ONLINE_SUBSCRIPTION
This status indicates that the CDR is linked to an online only subscription and not a offline one.

See Also:
Constant Field Values

BRGRP_ONLINE_SUBSCRIPTION

public static final int BRGRP_ONLINE_SUBSCRIPTION
Reserved for internal used.

See Also:
Constant Field Values

BRGRP_NO_PROVISIONING

public static final int BRGRP_NO_PROVISIONING
Reserved for internal used.

See Also:
Constant Field Values

NO_SUBSCRIPTION

public static final int NO_SUBSCRIPTION
Reserved for internal used.

See Also:
Constant Field Values

STATUS_RATING_IN_PROGRESS

@Deprecated
public static final int STATUS_RATING_IN_PROGRESS
Deprecated. - not use since v1.2
See Also:
Constant Field Values

TAG_NAME

public static final java.lang.String TAG_NAME
XML tag name of this model.

See Also:
Constant Field Values
Constructor Detail

CDRModel

public CDRModel()
Builds an empty CDR model


CDRModel

public CDRModel(ChargeableItem item,
                java.lang.String userID,
                java.lang.String serviceID,
                java.util.Date consumptionDate,
                java.lang.String source)
Builds a CDR model with an chargeable item, source and access information. This constructor should be used for acquisition process on client side.

Parameters:
item -
userID -
serviceID -
consumptionDate -
source -

CDRModel

public CDRModel(java.lang.Long OID,
                java.lang.Integer batchRatingGroupId,
                ChargeableItem item,
                java.lang.String userID,
                java.lang.String serviceID,
                java.lang.Long subscriptionID,
                java.lang.Short partitionID,
                java.lang.Long chargeID,
                java.util.Date consumptionDate,
                java.util.Date acquisitionDate,
                java.util.Date ratingDate,
                int errorCode,
                java.lang.String errorDescription,
                int status,
                java.lang.Long acquisitionID,
                java.lang.Long ratingID,
                java.lang.String source,
                java.lang.String magicNumber)
Builds a CDR model with full information. This constructor should be reserved for internal use

Parameters:
item -
userID -
serviceID -
consumptionDate -
source -

CDRModel

public CDRModel(java.lang.Long OID,
                ChargeableItem item,
                java.lang.String userID,
                java.lang.String serviceID,
                java.lang.Integer batchRatingGroupId,
                java.lang.Long subscriptionID,
                java.lang.Short partitionID,
                java.lang.Long chargeID,
                java.util.Date consumptionDate,
                int status)
Build a CDR model with rating information. This constructor should be reserved for internal use.

Parameters:
item -
userID -
serviceID -
consumptionDate -
Method Detail

duplicate

public CDRModel duplicate()
Duplicates a CDR model. The result is a new object with same values, even the CDR Id !

Returns:
CDRModel the duplicated CDR model.

setCDRIgnored

public void setCDRIgnored()
Sets the CDR to the status "ignored".


setCDRNew

public void setCDRNew()
Sets the CDR to the status "new".


getAcquisitionDate

public java.util.Date getAcquisitionDate()
Gets the acquisition date of the CDR model.

Returns:
the acquisition date of the CDR model.

_setAcquisitionDate

public void _setAcquisitionDate(java.util.Date acqDate)
Sets the acquisition date of the CDR model.

Parameters:
acqDate - the acquisition date.

getAcquisitionID

public java.lang.Long getAcquisitionID()
Gets the acquisition session identifier.

Returns:
the acquisition session identifier.

_setAcquisitionID

public void _setAcquisitionID(java.lang.Long acqID)
Sets the acquisition session identifier.

Parameters:
acqID - the acquisition session identifier

getRatingID

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

Returns:
the rating session identifier.

_setRatingID

public void _setRatingID(java.lang.Long ratID)
Sets the rating session identifier.

Parameters:
ratID - the rating session identifier

getConsumptionDate

public java.util.Date getConsumptionDate()
Gets the consumption date of the CDR model.

Returns:
the consumption date of the CDR model.

setConsumptionDate

public void setConsumptionDate(java.util.Date consumptionDate)
Sets the consumption date of the CDR model.

Parameters:
consumptionDate - the consumption date of the CDR model

getBatchRatingGroupId

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

Returns:
the batch rating group identifier.

_setBatchRatingGroupId

public void _setBatchRatingGroupId(java.lang.Integer bgrp)
Sets the batch rating group identifier

Parameters:
bgrp - the batch rating group identifier

getMagicNumber

public java.lang.String getMagicNumber()
Gets the magic number of the CDR model.

Returns:
the magic number of the CDR model.

get32MagicNumber

public java.lang.String get32MagicNumber()
Gets the magic number of the CDR model.

Returns:
the magic number of the CDR model.

_getDatabaseMagicNumber

public java.lang.String _getDatabaseMagicNumber()

_setMagicNumber

public void _setMagicNumber(java.lang.String mNumber)
Sets the magic number of the CDR model.

Parameters:
mNumber - the magic number

getName

public java.lang.String getName()
Gets the CDR name.

Returns:
the CDR name.

setName

public void setName(java.lang.String name)
Sets CDR name by setting item name

Parameters:
name - new CDR name
See Also:
com.highdeal.pnr.hci.ChargeableItem#setName(String name)

getChargeableItem

public ChargeableItem getChargeableItem()
Gets the chargeable item of the CDR model.

Returns:
the chargeable item of the CDR model.

setChargeableItem

public void setChargeableItem(ChargeableItem item)
Sets the chargeable item of the CDR model.

Parameters:
item - the chargeable item

_getOID

public java.lang.Long _getOID()
Gets the CDR model identifier.

Returns:
the CDR model identifier.

_setOID

public void _setOID(java.lang.Long oid)
Sets the CDR model identifier.

Parameters:
oid - the CDR model identifier

getRatingDate

public java.util.Date getRatingDate()
Gets CDR model rating date.

Returns:
the CDR model rating date.

_setRatingDate

public void _setRatingDate(java.util.Date ratDate)
Sets the CDR model rating date.

Parameters:
ratDate - the rating date

getErrorCode

public int getErrorCode()
Gets the error code.

Returns:
the error code.

_getOriginalErrorCode

public int _getOriginalErrorCode()

_setErrorCode

public void _setErrorCode(int ratingError)
Sets the error code.

Parameters:
ratingError - the rating error

_setOriginalErrorCode

public void _setOriginalErrorCode(int ratingError)

getErrorDescription

public java.lang.String getErrorDescription()
Gets the error description.

Returns:
the error description.

_getOriginalErrorDescription

public java.lang.String _getOriginalErrorDescription()

_setErrorDescription

public void _setErrorDescription(java.lang.String description)
Sets the error description.

Parameters:
description - the error description.

_setOriginalErrorDescription

public void _setOriginalErrorDescription(java.lang.String description)

getServiceID

public java.lang.String getServiceID()
Gets the service Id.

Returns:
the service Id.

setServiceID

public void setServiceID(java.lang.String serviceID)
Sets the service Id.

Parameters:
serviceID - the service Id

getSource

public java.lang.String getSource()
Gets the CDR model source.

Returns:
the CDR model source.

setSource

public void setSource(java.lang.String source)
Sets the CDR model source.

Parameters:
source - the CDR model source

getStatus

public int getStatus()
Gets the CDR model status.

Returns:
the CDR model status.

_setStatus

public void _setStatus(int s)
Sets the CDR model status.

Parameters:
s - the status

_getOriginalStatus

public int _getOriginalStatus()

getUserID

public java.lang.String getUserID()
Gets the user Id.

Returns:
the user Id.

setUserID

public void setUserID(java.lang.String userID)
Sets the user Id.

Parameters:
userID - the user Id

getSubscriptionID

public java.lang.Long getSubscriptionID()
Gets the subscription identifier

Returns:
the subscription identifier.

_setSubscriptionID

public void _setSubscriptionID(java.lang.Long subID)
Sets the subscription identifier.

Parameters:
subID - the subscription identifier

getPartitionID

public java.lang.Short getPartitionID()
Gets the partition identifier.

Returns:
the partition identifier.

setPartitionID

public void setPartitionID(java.lang.Short partitionID)
Sets the partition identifier.

Parameters:
partitionID - the partition identifier

_setSnapshotID

public void _setSnapshotID(int snapshotID)
Sets the snapshot identifier used to rate event.

Parameters:
snapshotID - the snapshot identifier that uses format YYYYMMDD

getSnapshotID

public int getSnapshotID()
Gets the snapshot identifier used to rate event.

Returns:
the snapshot identifier that uses format YYYYMMDD

getChargeID

public java.lang.Long getChargeID()
Gets the charge identifier.

Returns:
the charge identifier.

setChargeID

public void setChargeID(java.lang.Long chargeID)
Sets the charge identifier.

Parameters:
chargeID - the charge identifier

toString

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

setAttributes

public void setAttributes(XMLAttributes atts)

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)

addCharacterData

public void addCharacterData(java.lang.String cData)

marshal

public void marshal(XMLOutputter output)

compareTo

public int compareTo(CDRModel that)
Specified by:
compareTo in interface java.lang.Comparable<CDRModel>

compareKey

protected java.lang.Long compareKey()

_setCompareKey

public void _setCompareKey(java.lang.Long compareKey)

_setAccessibleChargeType

public void _setAccessibleChargeType(AccessibleChargeType accessibleChargeType)

_getAccessibleChargeType

public AccessibleChargeType _getAccessibleChargeType()

SAP CC 3.0 BART API

(c) Copyright 2011 SAP AG. All rights reserved. SAP Convergent Charging 3.0