public class AcquisitionSessionModel extends java.lang.Object implements XMLMarshallable
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:
StartAcquisitionSessionOp: Starts a new acquisition session model.
AcquireCDROp: Acquires one or more CDRs on the given acquisition session model.
StopAcquisitionSessionOp: Stops the acquisition session model.
When creating the acquisition session model (on client side), user can define:
ACQUIRE_MODE: No de-duplication detection is performed.
ACQUIRE_AND_DEDUPLICATE_MODE: Duplicated CDRs get duplicated status and are stored in the database.
ACQUIRE_AND_REJECT_DUPLICATE_MODE: Duplicated CDRs are rejected.
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.
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>
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
public static final java.lang.String TAG_NAME
public static final int ACQUIRE_MODE
public static final int ACQUIRE_AND_DEDUPLICATE_MODE
public static final int ACQUIRE_AND_REJECT_DUPLICATE_MODE
public static final int IN_PROGRESS_STATUS
public static final int ENDED_STATUS
public static final int ENDED_WITH_ERROR_STATUS
public static final int CLEANED_STATUS
public AcquisitionSessionModel()
public AcquisitionSessionModel(java.lang.String source,
java.lang.String description,
int mode)
source - description - mode - 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)
OID - startDate - duration - nbCDRAcquired - nbCDRDuplicate - source - description - mode - status - public java.lang.Long getDuration()
public void _setDuration(java.lang.Long d)
d - The duration of the acquisition sessionpublic java.lang.Long getNbCDRNew()
public void _setNbCDRNew(java.lang.Long nbNew)
nbNew - The number of new CDRspublic java.lang.Long getNbCDRDuplicate()
public void _setNbCDRDuplicate(java.lang.Long nbDup)
nbDup - The number of duplicate CDRspublic java.lang.Long getNbCDRConsolidate()
public void _setNbCDRConsolidate(java.lang.Long nbConsolidate)
nbConsolidate - The number of consolidate CDRspublic java.lang.Long _getOID()
public void _setOID(java.lang.Long oid)
oid - The identifier of the acquisition session modelpublic java.lang.String getSource()
public void setSource(java.lang.String source)
source - The source of the acquisition session modelpublic java.lang.String getDescription()
public void setDescription(java.lang.String description)
description - The descriptionpublic java.util.Date getStartDate()
public void _setStartDate(java.util.Date sd)
sd - The new start datepublic int getMode()
ACQUIRE_MODE,
ACQUIRE_AND_DEDUPLICATE_MODE,
ACQUIRE_AND_REJECT_DUPLICATE_MODEpublic void setMode(int acquisitionMode)
acquisitionMode - ACQUIRE_MODE,
ACQUIRE_AND_DEDUPLICATE_MODE,
ACQUIRE_AND_REJECT_DUPLICATE_MODEpublic int getStatus()
IN_PROGRESS_STATUS,
ENDED_STATUS,
ENDED_WITH_ERROR_STATUS,
CLEANED_STATUSpublic void _setStatus(int statusType)
statusType - The new statusIN_PROGRESS_STATUS,
ENDED_STATUS,
ENDED_WITH_ERROR_STATUS,
CLEANED_STATUSpublic void _incrementNumberOfNewCDRs()
public void _incrementNumberOfNewCDRs(long number)
number - The number of new acquired CDRspublic void _incrementNumberOfDuplicateCDRs()
public void _incrementNumberOfDuplicateCDRs(long number)
number - The number of duplicate acquired CDRspublic void _incrementNumberOfConsolidateCDRs()
public void _incrementNumberOfConsolidateCDRs(long number)
number - The number of duplicate acquired CDRspublic java.lang.String toString()
toString in class java.lang.Objectpublic void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(java.lang.String tagName,
XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void addCharacterData(java.lang.String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object intopublic void innerMarshall(XMLOutputter output)
public java.lang.String getStatusStringRepresentation()
public java.lang.String getModeStringRepresentation()
public void _initDeduplicateFifo(int fifoSize)
fifoSize - The size of the de-duplication fifopublic void _cleanDeduplicateFifo()
public com.highdeal.bart.util.DeduplicateFIFO _getDeduplicateFifo()
public long getLastCDRDate()
public void setLastCDRDate(long time)
time - The date where the last CDR have been acquired