Class AcquisitionSessionModel

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

public class AcquisitionSessionModel extends 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:

  • The source: generally where CDRs come from (e.g.: filename, directory...).
  • The description: comprehnsive description of this acquisition session.
  • The acquisition mode:

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 Details

    • TAG_NAME

      public static final String TAG_NAME
      The XML tag name of this data model: acquisition
      See Also:
    • ACQUIRE_MODE

      public static final int ACQUIRE_MODE
      In acquire mode, no de-duplication detection is performed.
      See Also:
    • 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:
    • 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:
    • IN_PROGRESS_STATUS

      public static final int IN_PROGRESS_STATUS
      Status for opened acquisition session.
      See Also:
    • ENDED_STATUS

      public static final int ENDED_STATUS
      Status for ended acquisition session.
      See Also:
    • 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:
    • 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:
  • Constructor Details

    • AcquisitionSessionModel

      public AcquisitionSessionModel()
      Builds an empty acquisition session model.
    • AcquisitionSessionModel

      public AcquisitionSessionModel(String source, String description, int mode)
      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

      public Long getDuration()
      Gets the duration of the acquisition session.
      Returns:
      The duration of the acquisition session
    • _setDuration

      public void _setDuration(Long d)
      Sets the duration of the acquisition session.
      Parameters:
      d - The duration of the acquisition session
    • getNbCDRNew

      public Long getNbCDRNew()
      Gets the number of new CDRs.
      Returns:
      The number of new CDRs
    • _setNbCDRNew

      public void _setNbCDRNew(Long nbNew)
      Sets the number of new CDRs.
      Parameters:
      nbNew - The number of new CDRs
    • getNbCDRDuplicate

      public Long getNbCDRDuplicate()
      Gets the number of duplicate CDRs.
      Returns:
      The number of duplicate CDRs
    • _setNbCDRDuplicate

      public void _setNbCDRDuplicate(Long nbDup)
      Sets the number of duplicate CDRs.
      Parameters:
      nbDup - The number of duplicate CDRs
    • getNbCDRConsolidate

      public Long getNbCDRConsolidate()
      Gets the number of consolidate CDRs.
      Returns:
      The number of consolidate CDRs
    • _setNbCDRConsolidate

      public void _setNbCDRConsolidate(Long nbConsolidate)
      Sets the number of consolidate CDRs.
      Parameters:
      nbConsolidate - The number of consolidate CDRs
    • _getOID

      public Long _getOID()
      Gets the identifier of the acquisition session model.
      Returns:
      The identifier of the acquisition session model
    • _setOID

      public void _setOID(Long oid)
      Sets the identifier of the acquisition session model.
      Parameters:
      oid - The identifier of the acquisition session model
    • getSource

      public String getSource()
      Gets the source of the acquisition session model.
      Returns:
      The source of the acquisition session model
    • setSource

      public void setSource(String source)
      Sets the source of the acquisition session model.
      Parameters:
      source - The source of the acquisition session model
    • getDescription

      public String getDescription()
      Gets the description of the acquisition session model.
      Returns:
      The description session model
    • setDescription

      public void setDescription(String description)
      Sets the description of the acquisition session model.
      Parameters:
      description - The description
    • getStartDate

      public Date getStartDate()
      Gets the start date of this acquisition session.
      Returns:
      The start date of this acquisition session
    • _setStartDate

      public void _setStartDate(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:
    • 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

      public String toString()
      Overrides:
      toString in class 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(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(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 String getStatusStringRepresentation()
      Return a String representation of status parameter.
      Returns:
      A String representation of status parameter
    • getModeStringRepresentation

      public 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