SAP CC 3.0 BART API

com.highdeal.bart.hci
Class AcquisitionSessionModel

java.lang.Object
  extended by com.highdeal.bart.hci.AcquisitionSessionModel

public class AcquisitionSessionModel
extends java.lang.Object

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

Basically, the acquisition process creates BART's CDRs (CDRModel) and can also de-duplicate them.

The acquisition process is linked with three major 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. Client side application should fetch this session identifier from the StartAcquisitionSessionResult in order to use it for operations AcquireCDROp and StopAcquisitionSessionOp.

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 "cleaned" status on the next start of BART Server.


XML Schema 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
          XML tag name of this model.
 
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()
          Remove 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)
           
 void addChild(java.lang.String tagName, XMLMarshallable child)
           
 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)
           
 void setAttributes(XMLAttributes atts)
           
 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
XML tag name of this model.

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)

addChild

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

addCharacterData

public void addCharacterData(java.lang.String cData)

marshal

public void marshal(XMLOutputter output)

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()
Remove 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

SAP CC 3.0 BART API

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