com.ibm.diameter.charging.util
Class RfAccountingResults

java.lang.Object
  extended by com.ibm.diameter.charging.util.RfAccountingResults

public class RfAccountingResults
extends java.lang.Object

The RfAccountingResults class is a simple representation of the Diameter Accounting Answer (ACA) command. It contains all the pertinent information returned by the CCF that an accounting client needs to manage an Accounting session.

The ACA command is defined in RFC 3588 - Diameter Base Protocol.


Constructor Summary
RfAccountingResults()
          Constructs an empty RfAccountingResults object representing the ACA Command.
RfAccountingResults(java.util.List<Avp> avps)
          Constructs a RfAccountingResults object representing the ACA Command.
 
Method Summary
 java.lang.Integer getAcctInterimInterval()
          Gets the value corresponding to the payload of the [Acct-Interim-Interval] Avp.
 java.lang.Long getEventTimestamp()
          Gets the value corresponding to the payload of the [Event-Timestamp] Avp.
 java.lang.Integer getOriginStateId()
          Gets the value corresponding to the payload of the [Origin-State-Id] Avp.
 java.lang.Integer getResultCode()
          Gets the value corresponding to the payload of the {Result-Code} Avp.
 void setAcctInterimInterval(java.lang.Integer acctInterimInterval)
          Sets the value corresponding to the payload of the [Acct-Interim-Interval] Avp.
 void setEventTimestamp(java.lang.Long eventTimestamp)
          Sets the value corresponding to the payload of the [Event-Timestamp] Avp.
 void setOriginStateId(java.lang.Integer originStateId)
          Sets the value corresponding to the payload of the [Origin-State-Id] Avp.
 void setResultCode(java.lang.Integer resultCode)
          Sets the value corresponding to the payload of the {Result-Code} Avp.
 java.util.Vector toAvps()
          Transforms the RfAccountingResults object into a Vector of Avps.
 void validate()
          Validates the members of the RoChargingResults object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RfAccountingResults

public RfAccountingResults()
Constructs an empty RfAccountingResults object representing the ACA Command.


RfAccountingResults

public RfAccountingResults(java.util.List<Avp> avps)
Constructs a RfAccountingResults object representing the ACA Command.

The method takes a List of Avps as an input. If an Avp code inside the list corresponds to a member of RfAccountingResults, the member will be populated with the Avp value during construction. If an Avp code is unknown, the value will be silently discarded.

Parameters:
avps - a list of Avps that can appear in the ACA
Throws:
AvpTransformationException - if the Avp value is in an unexpected format.
Method Detail

getAcctInterimInterval

public java.lang.Integer getAcctInterimInterval()
Gets the value corresponding to the payload of the [Acct-Interim-Interval] Avp.

The omission of this value or its inclusion with Value field set to 0 means that EVENT_RECORD, START_RECORD,and STOP_RECORD are produced, as appropriate for the service. The inclusion of the Value set to a non-zero value means that INTERIM_RECORD records MUST be produced between the START_RECORD and STOP_RECORD records. [Acct-Interim-Interval]

Returns:
the value corresponding to the payload of the {Acct-Interim-Interval} Avp.

setAcctInterimInterval

public void setAcctInterimInterval(java.lang.Integer acctInterimInterval)
Sets the value corresponding to the payload of the [Acct-Interim-Interval] Avp.

Parameters:
acctInterimInterval - the value corresponding to the payload of the [Acct-Interim-Interval] Avp.

getEventTimestamp

public java.lang.Long getEventTimestamp()
Gets the value corresponding to the payload of the [Event-Timestamp] Avp.

The event time stamp is defined as the difference in milliseconds between the current time and midnight, January 1, 1970 UTC.

Returns:
the value corresponding to the payload of the [Event-Timestamp] Avp.

setEventTimestamp

public void setEventTimestamp(java.lang.Long eventTimestamp)
Sets the value corresponding to the payload of the [Event-Timestamp] Avp.

Parameters:
eventTimestamp - the value corresponding to the payload of the [Event-Timestamp] Avp.

getOriginStateId

public java.lang.Integer getOriginStateId()
Gets the value corresponding to the payload of the [Origin-State-Id] Avp.

This is a monotonically increasing value that is advanced whenever a Diameter entity restarts with loss of previous state, for example upon reboot. A Diameter entity issuing it MUST create a higher value each time its state is reset. A Diameter entity MAY set it to the time of startup, or it MAY use an incrementing counter retained in non-volatile memory across restarts. [Origin-State-Id]

Returns:
originStateID

setOriginStateId

public void setOriginStateId(java.lang.Integer originStateId)
Sets the value corresponding to the payload of the [Origin-State-Id] Avp.

Parameters:
originStateId - the value corresponding to the payload of the [Origin-State-Id] Avp.

getResultCode

public java.lang.Integer getResultCode()
Gets the value corresponding to the payload of the {Result-Code} Avp.

It holds either 2001 (DIAMETER_SUCCESS) or 2002 (DIAMETER_LIMITED_SUCCESS). Error conditions will be reported via Exceptions.

Returns:
resultCode

setResultCode

public void setResultCode(java.lang.Integer resultCode)
Sets the value corresponding to the payload of the {Result-Code} Avp.

Parameters:
resultCode - the value corresponding to the payload of the {Result-Code} Avp.

validate

public void validate()
              throws ChargingValidationException
Validates the members of the RoChargingResults object. This method call peforms the same validation that is done by the Rf Web Service.

Throws:
ChargingValidationException - if a member of RoChargingResults is in an unexpected format.

toAvps

public java.util.Vector toAvps()
Transforms the RfAccountingResults object into a Vector of Avps.

Returns:
the list of Avps that form the ACA.


Copyright © 2006 IBM Corp. All Rights Reserved.