Package com.highdeal.pnr.hci
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(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.intCompare this counter snapshot with the one specified in argument, using theirdategetDate()Gets the date of the counter snapshotlongGets the lowest transaction set identifier which was generated by a rating performed on the counter snapshotintGets 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).Gets thesubscription snapshot holdercorresponding to the rootsubscriptionbooleanGets whether the counter snapshot is erroneousvoidmarshal(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.voidSets the date of the counter snapshotvoidsetInError(boolean inError) Sets whether the counter snapshot is erroneousvoidsetMinimalTransactionSetId(long minimalTransactionSetId) Sets the lowest transaction set identifier which was generated by a rating performed on the counter snapshotvoidsetNumberOfDaysInThePast(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).voidsetRootSubscription(SubscriptionSnapshotHolderModel rootSubscription) Sets thesubscription snapshot holdercorresponding to the rootsubscription
-
Field Details
-
MODEL_NAME
The XML name of the object: counterSnapshot- See Also:
-
-
Constructor Details
-
CounterSnapshotModel
public CounterSnapshotModel()Builds an emptyCounterSnapshotModelobject
-
-
Method Details
-
getDate
Gets the date of the counter snapshot- Returns:
- The date of the counter snapshot
-
setDate
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:
trueif the counter snapshot is erroneous,falseotherwise
-
setInError
public void setInError(boolean inError) Sets whether the counter snapshot is erroneous- Parameters:
inError-trueif the counter snapshot is erroneous,falseotherwise
-
getRootSubscription
Gets thesubscription snapshot holdercorresponding to the rootsubscription- Returns:
- The
subscription snapshot holdercorresponding to the rootsubscription
-
setRootSubscription
Sets thesubscription snapshot holdercorresponding to the rootsubscription- Parameters:
rootSubscription- Thesubscription snapshot holdercorresponding to the rootsubscription
-
compareTo
Compare this counter snapshot with the one specified in argument, using theirdate- Specified by:
compareToin interfaceComparable<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
Description copied from interface:XMLMarshallableAdds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data to be added
-
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
-
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
-
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
-