Class CounterSnapshotModel

java.lang.Object
com.highdeal.pnr.hci.CounterSnapshotModel
All Implemented Interfaces:
XMLMarshallable, Comparable<CounterSnapshotModel>

public class CounterSnapshotModel extends Object implements XMLMarshallable, Comparable<CounterSnapshotModel>
This class represents a daily counter snapshot; Inside the snapshot, the counters are organized in a structure similar to the associated subscription (root subscription, sub-subscription(s), charge activation(s)).

A snapshot contains the following information:

  • Date of the snapshot
  • Maximum number of days in the past (corresponds to the difference between the date of the counter snapshot and the consumption date of the oldest late CDR rated on the counter snapshot)
  • Lowest transaction set ID which was generated by a rating performed on the counter snapshot (used during rerating to target the elements to cancel in the billing system before rerating)
  • A boolean specifying whether the snapshot is erroneous (a counter snapshot is erroneous if it contains too much data to be completely in database).

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="counterSnapshot">
   <xs:complexType>
     <xs:sequence>
       <xs:element ref="subscriptionSnapshotHolder" minOccurs="0" maxOccurs="1" />
     </xs:sequence>
     <xs:attribute name="date" type="xs:date" />
     <xs:attribute name="numberOfDaysInThePast" type="xs:int" />
     <xs:attribute name="minimalTransactionSetId" type="xs:long" />
     <xs:attribute name="inError" type="xs:boolean" />
   </xs:complexType>
 </xs:element>

  • Field Details

  • Constructor Details

  • Method Details

    • getDate

      public Date getDate()
      Gets the date of the counter snapshot
      Returns:
      The date of the counter snapshot
    • setDate

      public void setDate(Date date)
      Sets the date of the counter snapshot
      Parameters:
      date - The date of the counter snapshot
    • getNumberOfDaysInThePast

      public int getNumberOfDaysInThePast()
      Gets the maximum number of days in the past for the counter snapshot (corresponds to the difference between the date of the counter snapshot and the consumption date of the oldest late CDR rated on the counter snapshot).
      Returns:
      The maximum number of days in the past for the counter snapshot
    • setNumberOfDaysInThePast

      public void setNumberOfDaysInThePast(int numberOfDaysInThePast)
      Sets the maximum number of days in the past for the counter snapshot (corresponds to the difference between the date of the counter snapshot and the consumption date of the oldest late CDR rated on the counter snapshot).
      Parameters:
      numberOfDaysInThePast - the maximum number of days in the past for the counter snapshot
    • getMinimalTransactionSetId

      public long getMinimalTransactionSetId()
      Gets the lowest transaction set identifier which was generated by a rating performed on the counter snapshot
      Returns:
      The lowest transaction set identifier which was generated by a rating performed on the counter snapshot
    • setMinimalTransactionSetId

      public void setMinimalTransactionSetId(long minimalTransactionSetId)
      Sets the lowest transaction set identifier which was generated by a rating performed on the counter snapshot
      Parameters:
      minimalTransactionSetId - The lowest transaction set identifier which was generated by a rating performed on the counter snapshot
    • isInError

      public boolean isInError()
      Gets whether the counter snapshot is erroneous
      Returns:
      true if the counter snapshot is erroneous, false otherwise
    • setInError

      public void setInError(boolean inError)
      Sets whether the counter snapshot is erroneous
      Parameters:
      inError - true if the counter snapshot is erroneous, false otherwise
    • getRootSubscription

      public SubscriptionSnapshotHolderModel getRootSubscription()
      Gets the subscription snapshot holder corresponding to the root subscription
      Returns:
      The subscription snapshot holder corresponding to the root subscription
    • setRootSubscription

      public void setRootSubscription(SubscriptionSnapshotHolderModel rootSubscription)
      Sets the subscription snapshot holder corresponding to the root subscription
      Parameters:
      rootSubscription - The subscription snapshot holder corresponding to the root subscription
    • compareTo

      public int compareTo(CounterSnapshotModel that)
      Compare this counter snapshot with the one specified in argument, using their date
      Specified by:
      compareTo in interface Comparable<CounterSnapshotModel>
      Returns:
      A negative integer, zero, or a positive integer as the date of this counter snapshot is less than, equal to, or greater than the date of the specified counter snapshot
    • 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
    • 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
    • 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
    • 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