com.highdeal.bart.hci
Class AcquisitionSessionModel

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

public class AcquisitionSessionModel
extends java.lang.Object
implements XMLMarshallable

This Java class represents an acquisition session of Consumption Detail Records (CDR)s in batch mode; It is the main class of the acquisition process.

Basically, the acquisition process creates CDRs in BART Server and its back-end database; it can also de-duplicate them.

The acquisition process is linked with three major service operations that interact with one acquisition session model. Those operations are:

When creating the acquisition session model (on client side), user can define:

Once the acquisition session is started, the acquisition is initialized with a start date and the session identifier. Your client application should fetch this session identifier from the StartAcquisitionSessionResult to to use it for the Acquire CDR operation and Stop Acquisition Session operation.

During the acquisition process, the acquisition session model will keep track of the duration and number of new, duplicate, and consolidated CDRs.

When an acquisition session model is not well stopped, this acquisition session will be set to the "cleaned" status on the next start of the SAP CC BART Server system.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="acquisition">
   <xs:complexType>
     <xs:attribute name="sessionID" type="xs:string" />
     <xs:attribute name="startDate" type="xs:dateTime"/>
     <xs:attribute name="duration" type="xs:string"/>
     <xs:attribute name="nbCDRNew" type="xs:string"/>
     <xs:attribute name="nbCDRDuplicate" type="xs:string"/>
     <xs:attribute name="nbCDRConsolidate" type="xs:string"/>
     <xs:attribute name="source" type="xs:string"/>
     <xs:attribute name="description" type="xs:string"/>
     <xs:attribute name="status" type="AcquisitionSessionStatusType"/>
     <xs:attribute name="mode" type="AcquisitionModeType" />
   </xs:complexType>
 </xs:element>
<xs:simpleType name="AcquisitionSessionStatusType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="inProgress"/>
     <xs:enumeration value="ended"/>
     <xs:enumeration value="endedWithErrors"/>
     <xs:enumeration value="cleaned"/>
   </xs:restriction>
 </xs:simpleType>
<xs:simpleType name="AcquisitionModeType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="acquire"/>
     <xs:enumeration value="acquireAndDeduplicate"/>
     <xs:enumeration value="acquireAndRejectDuplicate"/>
   </xs:restriction>
 </xs:simpleType>


Field Summary
static int ACQUIRE_AND_DEDUPLICATE_MODE
          In acquire and de-duplicate mode, duplicated cdrs get duplicated status and are stored in the database.
static int ACQUIRE_AND_REJECT_DUPLICATE_MODE
          In acquire and reject duplicate mode, duplicated cdrs are rejected.
static int ACQUIRE_MODE
          In acquire mode, no de-duplication detection is performed.
static int CLEANED_STATUS
          Status for badly ended acquisition session.
static int ENDED_STATUS
          Status for ended acquisition session.
static int ENDED_WITH_ERROR_STATUS
          Status for ended acquisition session when an error occurs on client side.
static int IN_PROGRESS_STATUS
          Status for opened acquisition session.
static java.lang.String TAG_NAME
          The XML tag name of this data model: acquisition
 
Constructor Summary
AcquisitionSessionModel()
          Builds an empty acquisition session model.
AcquisitionSessionModel(java.lang.Long OID, java.util.Date startDate, java.lang.Long duration, java.lang.Long nbCDRAcquired, java.lang.Long nbCDRDuplicate, java.lang.Long nbCDRConsolidate, java.lang.String source, java.lang.String description, int mode, int status)
          Builds an acquisition session model with full information.
AcquisitionSessionModel(java.lang.String source, java.lang.String description, int mode)
          Builds an acquisition session model with source, description and mode.
 
Method Summary
 void _cleanDeduplicateFifo()
          Removes all the components inside the de-duplication fifo This should be used only on server side.
 com.highdeal.bart.util.DeduplicateFIFO _getDeduplicateFifo()
          Gets the de-duplication fifo.
 java.lang.Long _getOID()
          Gets the identifier of the acquisition session model.
 void _incrementNumberOfConsolidateCDRs()
          Increments number of newly duplicate CDRs in a thread-safe manner.
 void _incrementNumberOfConsolidateCDRs(long number)
          Increments number of newly duplicate CDRs in a thread-safe manner.
 void _incrementNumberOfDuplicateCDRs()
          Increments number of newly duplicate CDRs in a thread-safe manner.
 void _incrementNumberOfDuplicateCDRs(long number)
          Increments number of newly duplicate CDRs in a thread-safe manner.
 void _incrementNumberOfNewCDRs()
          Increments number of newly acquired CDRs in a thread-safe manner.
 void _incrementNumberOfNewCDRs(long number)
          Increments number of newly acquired CDRs in a thread-safe manner.
 void _initDeduplicateFifo(int fifoSize)
          Initializes the de-duplication fifo.
 void _setDuration(java.lang.Long d)
          Sets the duration of the acquisition session.
 void _setNbCDRConsolidate(java.lang.Long nbConsolidate)
          Sets the number of consolidate CDRs.
 void _setNbCDRDuplicate(java.lang.Long nbDup)
          Sets the number of duplicate CDRs.
 void _setNbCDRNew(java.lang.Long nbNew)
          Sets the number of new CDRs.
 void _setOID(java.lang.Long oid)
          Sets the identifier of the acquisition session model.
 void _setStartDate(java.util.Date sd)
          Sets the start date of this acquisition session.
 void _setStatus(int statusType)
          Sets the status of this acquisition 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.String getDescription()
          Gets the description of the acquisition session model.
 java.lang.Long getDuration()
          Gets the duration of the acquisition session.
 long getLastCDRDate()
          Gets the date where the last CDR has been acquired.
 int getMode()
          Gets the mode of this acquisition session.
 java.lang.String getModeStringRepresentation()
          Returns a String representation of mode parameter.
 java.lang.Long getNbCDRConsolidate()
          Gets the number of consolidate CDRs.
 java.lang.Long getNbCDRDuplicate()
          Gets the number of duplicate CDRs.
 java.lang.Long getNbCDRNew()
          Gets the number of new CDRs.
 java.lang.String getSource()
          Gets the source of the acquisition session model.
 java.util.Date getStartDate()
          Gets the start date of this acquisition session.
 int getStatus()
          Gets the status of this acquisition session.
 java.lang.String getStatusStringRepresentation()
          Return a String representation of status parameter.
 void innerMarshall(XMLOutputter output)
          Used for sub-classes 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 setDescription(java.lang.String description)
          Sets the description of the acquisition session model.
 void setLastCDRDate(long time)
          Sets the date where the last CDR has been acquired.
 void setMode(int acquisitionMode)
          Sets the mode of the acquisition session.
 void setSource(java.lang.String source)
          Sets the source of the acquisition session model.
 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
The XML tag name of this data model: acquisition

See Also:
Constant Field Values

ACQUIRE_MODE

public static final int ACQUIRE_MODE
In acquire mode, no de-duplication detection is performed.

See Also:
Constant Field Values

ACQUIRE_AND_DEDUPLICATE_MODE

public static final int ACQUIRE_AND_DEDUPLICATE_MODE
In acquire and de-duplicate mode, duplicated cdrs get duplicated status and are stored in the database.

See Also:
Constant Field Values

ACQUIRE_AND_REJECT_DUPLICATE_MODE

public static final int ACQUIRE_AND_REJECT_DUPLICATE_MODE
In acquire and reject duplicate mode, duplicated cdrs are rejected.

See Also:
Constant Field Values

IN_PROGRESS_STATUS

public static final int IN_PROGRESS_STATUS
Status for opened acquisition session.

See Also:
Constant Field Values

ENDED_STATUS

public static final int ENDED_STATUS
Status for ended acquisition session.

See Also:
Constant Field Values

ENDED_WITH_ERROR_STATUS

public static final int ENDED_WITH_ERROR_STATUS
Status for ended acquisition session when an error occurs on client side.

See Also:
Constant Field Values

CLEANED_STATUS

public static final int CLEANED_STATUS
Status for badly ended acquisition session. This status occurs when a acquisition session has been stopped on Bart server restart instead of StopAcquisitionSessionOp operation.

See Also:
Constant Field Values
Constructor Detail

AcquisitionSessionModel

public AcquisitionSessionModel()
Builds an empty acquisition session model.


AcquisitionSessionModel

public AcquisitionSessionModel(java.lang.String source,
                               java.lang.String description,
                               int mode)
Builds an acquisition session model with source, description and mode.

Parameters:
source -
description -
mode -

AcquisitionSessionModel

public AcquisitionSessionModel(java.lang.Long OID,
                               java.util.Date startDate,
                               java.lang.Long duration,
                               java.lang.Long nbCDRAcquired,
                               java.lang.Long nbCDRDuplicate,
                               java.lang.Long nbCDRConsolidate,
                               java.lang.String source,
                               java.lang.String description,
                               int mode,
                               int status)
Builds an acquisition session model with full information. This constructor should be reserved for internal use on server side.

Parameters:
OID -
startDate -
duration -
nbCDRAcquired -
nbCDRDuplicate -
source -
description -
mode -
status -
Method Detail

getDuration

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

Returns:
The duration of the acquisition session

_setDuration

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

Parameters:
d - The duration of the acquisition session

getNbCDRNew

public java.lang.Long getNbCDRNew()
Gets the number of new CDRs.

Returns:
The number of new CDRs

_setNbCDRNew

public void _setNbCDRNew(java.lang.Long nbNew)
Sets the number of new CDRs.

Parameters:
nbNew - The number of new CDRs

getNbCDRDuplicate

public java.lang.Long getNbCDRDuplicate()
Gets the number of duplicate CDRs.

Returns:
The number of duplicate CDRs

_setNbCDRDuplicate

public void _setNbCDRDuplicate(java.lang.Long nbDup)
Sets the number of duplicate CDRs.

Parameters:
nbDup - The number of duplicate CDRs

getNbCDRConsolidate

public java.lang.Long getNbCDRConsolidate()
Gets the number of consolidate CDRs.

Returns:
The number of consolidate CDRs

_setNbCDRConsolidate

public void _setNbCDRConsolidate(java.lang.Long nbConsolidate)
Sets the number of consolidate CDRs.

Parameters:
nbConsolidate - The number of consolidate CDRs

_getOID

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

Returns:
The identifier of the acquisition session model

_setOID

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

Parameters:
oid - The identifier of the acquisition session model

getSource

public java.lang.String getSource()
Gets the source of the acquisition session model.

Returns:
The source of the acquisition session model

setSource

public void setSource(java.lang.String source)
Sets the source of the acquisition session model.

Parameters:
source - The source of the acquisition session model

getDescription

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

Returns:
The description session model

setDescription

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

Parameters:
description - The description

getStartDate

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

Returns:
The start date of this acquisition session

_setStartDate

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

Parameters:
sd - The new start date

getMode

public int getMode()
Gets the mode of this acquisition session.

Returns:
The mode of this acquisition session
See Also:
ACQUIRE_MODE, ACQUIRE_AND_DEDUPLICATE_MODE, ACQUIRE_AND_REJECT_DUPLICATE_MODE

setMode

public void setMode(int acquisitionMode)
Sets the mode of the acquisition session.

Parameters:
acquisitionMode -
See Also:
ACQUIRE_MODE, ACQUIRE_AND_DEDUPLICATE_MODE, ACQUIRE_AND_REJECT_DUPLICATE_MODE

getStatus

public int getStatus()
Gets the status of this acquisition session.

Returns:
the status of this acquisition session.
See Also:
IN_PROGRESS_STATUS, ENDED_STATUS, ENDED_WITH_ERROR_STATUS, CLEANED_STATUS

_setStatus

public void _setStatus(int statusType)
Sets the status of this acquisition session.

Parameters:
statusType - The new status
See Also:
IN_PROGRESS_STATUS, ENDED_STATUS, ENDED_WITH_ERROR_STATUS, CLEANED_STATUS

_incrementNumberOfNewCDRs

public void _incrementNumberOfNewCDRs()
Increments number of newly acquired CDRs in a thread-safe manner.


_incrementNumberOfNewCDRs

public void _incrementNumberOfNewCDRs(long number)
Increments number of newly acquired CDRs in a thread-safe manner.

Parameters:
number - The number of new acquired CDRs

_incrementNumberOfDuplicateCDRs

public void _incrementNumberOfDuplicateCDRs()
Increments number of newly duplicate CDRs in a thread-safe manner.


_incrementNumberOfDuplicateCDRs

public void _incrementNumberOfDuplicateCDRs(long number)
Increments number of newly duplicate CDRs in a thread-safe manner.

Parameters:
number - The number of duplicate acquired CDRs

_incrementNumberOfConsolidateCDRs

public void _incrementNumberOfConsolidateCDRs()
Increments number of newly duplicate CDRs in a thread-safe manner.


_incrementNumberOfConsolidateCDRs

public void _incrementNumberOfConsolidateCDRs(long number)
Increments number of newly duplicate CDRs in a thread-safe manner.

Parameters:
number - The number of duplicate acquired CDRs

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)
Used for sub-classes only


getStatusStringRepresentation

public java.lang.String getStatusStringRepresentation()
Return a String representation of status parameter.

Returns:
A String representation of status parameter

getModeStringRepresentation

public java.lang.String getModeStringRepresentation()
Returns a String representation of mode parameter.

Returns:
The String representation of mode parameter

_initDeduplicateFifo

public void _initDeduplicateFifo(int fifoSize)
Initializes the de-duplication fifo. This should be used only on server side.

Parameters:
fifoSize - The size of the de-duplication fifo

_cleanDeduplicateFifo

public void _cleanDeduplicateFifo()
Removes all the components inside the de-duplication fifo This should be used only on server side.


_getDeduplicateFifo

public com.highdeal.bart.util.DeduplicateFIFO _getDeduplicateFifo()
Gets the de-duplication fifo. This should be used only on server side.

Returns:
The de-duplication fifo

getLastCDRDate

public long getLastCDRDate()
Gets the date where the last CDR has been acquired.

Returns:
The date where the last CDR has been acquired

setLastCDRDate

public void setLastCDRDate(long time)
Sets the date where the last CDR has been acquired.

Parameters:
time - The date where the last CDR have been acquired

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