com.ibm.diameter.charging.util
Class RfAccountingInfo

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

public class RfAccountingInfo
extends java.lang.Object

RfAccountingInfo is a lightweight representation of the Accounting-Request (ACR) command. It includes all of the basic informational elements needed to manage offline charging for Events or Sessions. The Web service client creates an instance of RfAccountingInfo and must set all required fields before initiating a Web service request.

The Rf ACR command is defined in ETSI TS 132 299 V6.9.0 (2006-12) - Diameter charging applications, which references RFC 3588 - Diameter Base Protocol.


Constructor Summary
RfAccountingInfo()
          Constructs an empty RfAccountingInfo object representing the ACR command.
RfAccountingInfo(java.util.List<Avp> avps)
          Constructs a RfAccountingInfo object representing the ACR Command.
 
Method Summary
 java.lang.Integer getAccountingRecordNumber()
          Gets the value corresponding to the payload of the {Accounting-Record-Number} Avp.
 java.lang.Integer getAcctInterimInterval()
          Gets the value corresponding to the payload of the [Acct-Interim-Interval] Avp.
 java.lang.String getDestinationHost()
          Gets the value corresponding to the payload of the [Destination-Host] Avp.
 java.lang.String getDestinationRealm()
          Gets the value corresponding to the payload of the {Destination-Realm} 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.
 ServiceInformation getServiceInformation()
          Gets the value corresponding to the payload of the [Service-Information] Avp.
 java.lang.String getSessionId()
          Gets the value corresponding to the payload of the {Session-Id} Avp.
 java.lang.String getUserName()
          Gets the value corresponding to the payload of the [User-Name] Avp.
 void setAccountingRecordNumber(java.lang.Integer accountingRecordNumber)
          Sets the value corresponding to the payload of the {Accounting-Record-Number} Avp.
 void setAcctInterimInterval(java.lang.Integer acctInterimInterval)
          Sets the value corresponding to the payload of the [Acct-Interim-Interval] Avp.
 void setDestinationHost(java.lang.String destinationHost)
          Sets the value corresponding to the payload of the [Destination-Host] Avp.
 void setDestinationRealm(java.lang.String destinationRealm)
          Sets the value corresponding to the payload of the [Destination-Realm] 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 setServiceInformation(ServiceInformation serviceInfo)
          Sets the value corresponding to the payload of the [Service-Information] Avp.
 void setSessionId(java.lang.String sessionId)
          Sets the value corresponding to the payload of the {Session-Id} Avp.
 void setUserName(java.lang.String userName)
          Sets the value corresponding to the payload of the [User-Name] Avp.
 java.util.Vector toAvps()
          Transforms a RfAccountingInfo object into a Vector of Avps that forms the body of the ACR Diameter Packet.
 void validate()
          Validates the members of the RfAccountingInfo object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RfAccountingInfo

public RfAccountingInfo()
Constructs an empty RfAccountingInfo object representing the ACR command.


RfAccountingInfo

public RfAccountingInfo(java.util.List<Avp> avps)
                 throws AvpTransformationException
Constructs a RfAccountingInfo object representing the ACR Command.

The method takes a List of Avps as an input. If an Avp code inside the list corresponds to a member of RfAccountingInfo, 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 RAR
Throws:
AvpTransformationException - if the Avp value is in an unexpected format.
Method Detail

getAccountingRecordNumber

public java.lang.Integer getAccountingRecordNumber()
Gets the value corresponding to the payload of the {Accounting-Record-Number} Avp.

Identifies this record within one session. The combination of Session-Id and Accounting-Record-Number AVPs is globally unique, and can be used in matching accounting records with confirmations. An easy way to produce unique numbers is to set the value to 0 for records of type EVENT_RECORD and START_RECORD, and set the value to 1 for the first INTERIM_RECORD, 2 for the second, and so on until the value for STOP_RECORD is one more than for the last INTERIM_RECORD.

Returns:
the value corresponding to the payload of the {Accounting-Record-Number} Avp.

setAccountingRecordNumber

public void setAccountingRecordNumber(java.lang.Integer accountingRecordNumber)
Sets the value corresponding to the payload of the {Accounting-Record-Number} Avp.

Parameters:
ccRequestNumber - the value corresponding to the payload of the {Accounting-Record-Number} Avp.

getAcctInterimInterval

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

Obtains the value of acctInterimInterval. 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:
ccRequestNumber - the value corresponding to the payload of the [Acct-Interim-Interval] Avp.

getDestinationHost

public java.lang.String getDestinationHost()
Gets the value corresponding to the payload of the [Destination-Host] Avp.

Contains the host the message is to be routed to.

Returns:
the value corresponding to the payload of the [Destination-Host] Avp.

setDestinationHost

public void setDestinationHost(java.lang.String destinationHost)
Sets the value corresponding to the payload of the [Destination-Host] Avp.

Parameters:
ccRequestNumber - the value corresponding to the payload of the [Destination-Host] Avp.

getDestinationRealm

public java.lang.String getDestinationRealm()
Gets the value corresponding to the payload of the {Destination-Realm} Avp.

Contains the realm the message is to be routed to.

Returns:
the value corresponding to the payload of the [Destination-Realm] Avp.

setDestinationRealm

public void setDestinationRealm(java.lang.String destinationRealm)
Sets the value corresponding to the payload of the [Destination-Realm] Avp.

Parameters:
ccRequestNumber - the value corresponding to the payload of the [Destination-Realm] Avp.

getEventTimestamp

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

Obtains the value of eventTimeStamp. 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:
ccRequestNumber - 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.

Obtains the value of originStateId. 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:
the value corresponding to the payload of the [Origin-State-Id] Avp.

setOriginStateId

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

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

getServiceInformation

public ServiceInformation getServiceInformation()
Gets the value corresponding to the payload of the [Service-Information] Avp.

Contains service specific diameter charging information. Service-Information [ PS-Information ] [ WLAN-Information ] [ IMS-Information ] [ PoC-Information ] [ MBMS-Information ]

Returns:
the value corresponding to the payload of the [Service-Information] Avp.

setServiceInformation

public void setServiceInformation(ServiceInformation serviceInfo)
Sets the value corresponding to the payload of the [Service-Information] Avp.

Parameters:
ccRequestNumber - the value corresponding to the payload of the [Service-Information] Avp.

getSessionId

public java.lang.String getSessionId()
Gets the value corresponding to the payload of the {Session-Id} Avp.

Returns:
the value corresponding to the payload of the {Session-Id} Avp.

setSessionId

public void setSessionId(java.lang.String sessionId)
Sets the value corresponding to the payload of the {Session-Id} Avp.

Parameters:
ccRequestNumber - the value corresponding to the payload of the {Session-Id} Avp.

getUserName

public java.lang.String getUserName()
Gets the value corresponding to the payload of the [User-Name] Avp.

Identifies a user in the accounting server in a format consistent with the NAI specification.

Returns:
the value corresponding to the payload of the [User-Name] Avp.

setUserName

public void setUserName(java.lang.String userName)
Sets the value corresponding to the payload of the [User-Name] Avp.

Parameters:
ccRequestNumber - the value corresponding to the payload of the [User-Name] Avp.

validate

public void validate()
              throws DiameterRfException
Validates the members of the RfAccountingInfo object. The Rf Web Service calls this method before sending the ACR Diameter packet. This ensures that improperly formatted members are not sent to the CCF.

Throws:
DiameterRfException - if a member of RfAccountingInfo is in an unexpected format.

toAvps

public java.util.Vector toAvps()
                        throws AvpTransformationException
Transforms a RfAccountingInfo object into a Vector of Avps that forms the body of the ACR Diameter Packet.

All non-null members of RfAccountingInfo will be created as Avps in the Vector.

Returns:
the Vector of Avps that form the ACR Diameter Packet.
Throws:
AvpTransformationException - if a member of RfAccountingInfo is in an unexpected format.


Copyright © 2006 IBM Corp. All Rights Reserved.