Class AcquisitionSessionModel
- All Implemented Interfaces:
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:
- The source: generally where CDRs come from (e.g.: filename, directory...).
- The description: comprehnsive description of this acquisition session.
- The acquisition mode:
-
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.
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
FieldsModifier and TypeFieldDescriptionstatic final intIn acquire and de-duplicate mode, duplicated cdrs get duplicated status and are stored in the database.static final intIn acquire and reject duplicate mode, duplicated cdrs are rejected.static final intIn acquire mode, no de-duplication detection is performed.static final intStatus for badly ended acquisition session.static final intStatus for ended acquisition session.static final intStatus for ended acquisition session when an error occurs on client side.static final intStatus for opened acquisition session.static final StringThe XML tag name of this data model: acquisition -
Constructor Summary
ConstructorsConstructorDescriptionBuilds an empty acquisition session model.AcquisitionSessionModel(Long OID, Date startDate, Long duration, Long nbCDRAcquired, Long nbCDRDuplicate, Long nbCDRConsolidate, String source, String description, int mode, int status) Builds an acquisition session model with full information.AcquisitionSessionModel(String source, String description, int mode) Builds an acquisition session model with source, description and mode. -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves all the components inside the de-duplication fifo This should be used only on server side.com.highdeal.bart.util.DeduplicateFIFOGets the de-duplication fifo._getOID()Gets the identifier of the acquisition session model.voidIncrements 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.voidIncrements 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.voidIncrements 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(Long d) Sets the duration of the acquisition session.void_setNbCDRConsolidate(Long nbConsolidate) Sets the number of consolidate CDRs.void_setNbCDRDuplicate(Long nbDup) Sets the number of duplicate CDRs.void_setNbCDRNew(Long nbNew) Sets the number of new CDRs.voidSets the identifier of the acquisition session model.void_setStartDate(Date sd) Sets the start date of this acquisition session.void_setStatus(int statusType) Sets the status of this acquisition session.voidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String tagName, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.Gets the description of the acquisition session model.Gets the duration of the acquisition session.longGets the date where the last CDR has been acquired.intgetMode()Gets the mode of this acquisition session.Returns a String representation of mode parameter.Gets the number of consolidate CDRs.Gets the number of duplicate CDRs.Gets the number of new CDRs.Gets the source of the acquisition session model.Gets the start date of this acquisition session.intGets the status of this acquisition session.Return a String representation of status parameter.voidinnerMarshall(XMLOutputter output) Used for sub-classes onlyvoidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidsetDescription(String description) Sets the description of the acquisition session model.voidsetLastCDRDate(long time) Sets the date where the last CDR has been acquired.voidsetMode(int acquisitionMode) Sets the mode of the acquisition session.voidSets the source of the acquisition session model.toString()
-
Field Details
-
TAG_NAME
The XML tag name of this data model: acquisition- See Also:
-
ACQUIRE_MODE
public static final int ACQUIRE_MODEIn acquire mode, no de-duplication detection is performed.- See Also:
-
ACQUIRE_AND_DEDUPLICATE_MODE
public static final int ACQUIRE_AND_DEDUPLICATE_MODEIn acquire and de-duplicate mode, duplicated cdrs get duplicated status and are stored in the database.- See Also:
-
ACQUIRE_AND_REJECT_DUPLICATE_MODE
public static final int ACQUIRE_AND_REJECT_DUPLICATE_MODEIn acquire and reject duplicate mode, duplicated cdrs are rejected.- See Also:
-
IN_PROGRESS_STATUS
public static final int IN_PROGRESS_STATUSStatus for opened acquisition session.- See Also:
-
ENDED_STATUS
public static final int ENDED_STATUSStatus for ended acquisition session.- See Also:
-
ENDED_WITH_ERROR_STATUS
public static final int ENDED_WITH_ERROR_STATUSStatus for ended acquisition session when an error occurs on client side.- See Also:
-
CLEANED_STATUS
public static final int CLEANED_STATUSStatus 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:
-
-
Constructor Details
-
AcquisitionSessionModel
public AcquisitionSessionModel()Builds an empty acquisition session model. -
AcquisitionSessionModel
Builds an acquisition session model with source, description and mode.- Parameters:
source-description-mode-
-
AcquisitionSessionModel
public AcquisitionSessionModel(Long OID, Date startDate, Long duration, Long nbCDRAcquired, Long nbCDRDuplicate, Long nbCDRConsolidate, String source, 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 Details
-
getDuration
Gets the duration of the acquisition session.- Returns:
- The duration of the acquisition session
-
_setDuration
Sets the duration of the acquisition session.- Parameters:
d- The duration of the acquisition session
-
getNbCDRNew
Gets the number of new CDRs.- Returns:
- The number of new CDRs
-
_setNbCDRNew
Sets the number of new CDRs.- Parameters:
nbNew- The number of new CDRs
-
getNbCDRDuplicate
Gets the number of duplicate CDRs.- Returns:
- The number of duplicate CDRs
-
_setNbCDRDuplicate
Sets the number of duplicate CDRs.- Parameters:
nbDup- The number of duplicate CDRs
-
getNbCDRConsolidate
Gets the number of consolidate CDRs.- Returns:
- The number of consolidate CDRs
-
_setNbCDRConsolidate
Sets the number of consolidate CDRs.- Parameters:
nbConsolidate- The number of consolidate CDRs
-
_getOID
Gets the identifier of the acquisition session model.- Returns:
- The identifier of the acquisition session model
-
_setOID
Sets the identifier of the acquisition session model.- Parameters:
oid- The identifier of the acquisition session model
-
getSource
Gets the source of the acquisition session model.- Returns:
- The source of the acquisition session model
-
setSource
Sets the source of the acquisition session model.- Parameters:
source- The source of the acquisition session model
-
getDescription
Gets the description of the acquisition session model.- Returns:
- The description session model
-
setDescription
Sets the description of the acquisition session model.- Parameters:
description- The description
-
getStartDate
Gets the start date of this acquisition session.- Returns:
- The start date of this acquisition session
-
_setStartDate
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:
-
setMode
public void setMode(int acquisitionMode) Sets the mode of the acquisition session.- Parameters:
acquisitionMode-- See Also:
-
getStatus
public int getStatus()Gets the status of this acquisition session.- Returns:
- the status of this acquisition session.
- See Also:
-
_setStatus
public void _setStatus(int statusType) Sets the status of this acquisition session.- Parameters:
statusType- The new status- See Also:
-
_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
-
setAttributes
Description copied from interface:XMLMarshallableSets the attributes of the XML representation of the element being processed.- Specified by:
setAttributesin interfaceXMLMarshallable- Parameters:
atts- TheXML attributesof the current element
-
addChild
Description copied from interface:XMLMarshallableAdds a child to the object, thechildrepresenting the marshallable object which must be added to the element.- Specified by:
addChildin interfaceXMLMarshallable- Parameters:
tagName- The name of tag for the childchild- The child to be added
-
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data to be added
-
marshal
Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Specified by:
marshalin interfaceXMLMarshallable- Parameters:
output- TheXML outputto marshal the object into
-
innerMarshall
Used for sub-classes only -
getStatusStringRepresentation
Return a String representation of status parameter.- Returns:
- A String representation of status parameter
-
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
-