com.ibm.diameter.charging.util
Class RequestedServiceUnit

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

public class RequestedServiceUnit
extends java.lang.Object

RequestedServiceUnit is a lightweight representation of the Grouped [Requested-Service-Unit] Avp. It contains the amount of units requested by the credit-control client.

The [Requested-Service-Unit] Avp is defined in RFC 4006 - Diameter Credit-Control Application.


Constructor Summary
RequestedServiceUnit()
          Constructs an empty RequestedServiceUnit object representing the [Requested-Service-Unit] Avp.
RequestedServiceUnit(java.util.List<Avp> avps)
          Constructs a RequestedServiceUnit object representing the Grouped [Requested-Service-Unit] Avp.
 
Method Summary
 java.lang.Long getCcInputOctets()
          Gets the value corresponding to the payload of the [CC-Input-Octets] Avp.
 java.lang.Long getCcOutputOctets()
          Gets the value corresponding to the payload of the [CC-Output-Octets] Avp.
 java.lang.Long getCcServiceSpecificUnits()
          Gets the value corresponding to the payload of the [CC-Service-Specific-Units] Avp.
 java.lang.Integer getCcTime()
          Gets the value corresponding to the payload of the [CC-Time] Avp.
 java.lang.Long getCcTotalOctets()
          Gets the value corresponding to the payload of the [CC-Total-Octets] Avp.
 void setCcInputOctets(java.lang.Long ccInputOctets)
          Sets the value corresponding to the payload of the [CC-Input-Octets] Avp.
 void setCcOutputOctets(java.lang.Long ccOutputOctets)
          Sets the value corresponding to the payload of the [CC-Output-Octets] Avp.
 void setCcServiceSpecificUnits(java.lang.Long ccServiceSpecificUnits)
          Sets the value corresponding to the payload of the [CC-Service-Specific-Units] Avp.
 void setCcTime(java.lang.Integer ccTime)
          Sets the value corresponding to the payload of the [CC-Time] Avp.
 void setCcTotalOctets(java.lang.Long ccTotalOctets)
          Sets the value corresponding to the payload of the [CC-Total-Octets] Avp.
 Avp toAvp()
          Transforms a RequestedServiceUnit object into a Grouped [Requested-Service-Unit] Avp.
 void validate()
          Validates the members of the RequestedServiceUnit object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestedServiceUnit

public RequestedServiceUnit()
Constructs an empty RequestedServiceUnit object representing the [Requested-Service-Unit] Avp.


RequestedServiceUnit

public RequestedServiceUnit(java.util.List<Avp> avps)
                     throws AvpTransformationException
Constructs a RequestedServiceUnit object representing the Grouped [Requested-Service-Unit] Avp.

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

getCcInputOctets

public java.lang.Long getCcInputOctets()
Gets the value corresponding to the payload of the [CC-Input-Octets] Avp.

Returns:
the value corresponding to the payload of the [CC-Input-Octets] Avp.

setCcInputOctets

public void setCcInputOctets(java.lang.Long ccInputOctets)
Sets the value corresponding to the payload of the [CC-Input-Octets] Avp.

Parameters:
ccInputOctets - the value corresponding to the payload of the [CC-Input-Octets] Avp.

getCcOutputOctets

public java.lang.Long getCcOutputOctets()
Gets the value corresponding to the payload of the [CC-Output-Octets] Avp.

Returns:
the value corresponding to the payload of the [CC-Output-Octets] Avp.

setCcOutputOctets

public void setCcOutputOctets(java.lang.Long ccOutputOctets)
Sets the value corresponding to the payload of the [CC-Output-Octets] Avp.

Parameters:
ccOutputOctets - the value corresponding to the payload of the [CC-Output-Octets] Avp.

getCcServiceSpecificUnits

public java.lang.Long getCcServiceSpecificUnits()
Gets the value corresponding to the payload of the [CC-Service-Specific-Units] Avp.

Returns:
the value corresponding to the payload of the [CC-Service-Specific-Units] Avp.

setCcServiceSpecificUnits

public void setCcServiceSpecificUnits(java.lang.Long ccServiceSpecificUnits)
Sets the value corresponding to the payload of the [CC-Service-Specific-Units] Avp.

Parameters:
ccServiceSpecificUnits - the value corresponding to the payload of the [CC-Service-Specific-Units] Avp.

getCcTime

public java.lang.Integer getCcTime()
Gets the value corresponding to the payload of the [CC-Time] Avp.

Returns:
the value corresponding to the payload of the [CC-Time] Avp.

setCcTime

public void setCcTime(java.lang.Integer ccTime)
Sets the value corresponding to the payload of the [CC-Time] Avp.

Parameters:
ccTime - the value corresponding to the payload of the [CC-Time] Avp.

getCcTotalOctets

public java.lang.Long getCcTotalOctets()
Gets the value corresponding to the payload of the [CC-Total-Octets] Avp.

Returns:
the value corresponding to the payload of the [CC-Total-Octets] Avp.

setCcTotalOctets

public void setCcTotalOctets(java.lang.Long ccTotalOctets)
Sets the value corresponding to the payload of the [CC-Total-Octets] Avp.

Parameters:
ccTotalOctets - the value corresponding to the payload of the [CC-Total-Octets] Avp.

validate

public void validate()
              throws ChargingValidationException
Validates the members of the RequestedServiceUnit object. The charging Web Services call this method before transforming the object into a Grouped Avp. This ensures that improperly formed Avps are not sent to the Diameter peer.

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

toAvp

public Avp toAvp()
          throws AvpTransformationException
Transforms a RequestedServiceUnit object into a Grouped [Requested-Service-Unit] Avp.

All non-null members of RequestedServiceUnit will be transformed into Avps nested inside of the [Requested-Service-Unit] Avp.

Returns:
the [Requested-Service-Unit] Avp.
Throws:
AvpTransformationException - if a member of RequestedServiceUnit is in an unexpected format.


Copyright © 2006 IBM Corp. All Rights Reserved.