com.ibm.diameter.charging.util
Class UsedServiceUnit

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

public class UsedServiceUnit
extends java.lang.Object

UsedServiceUnit is a lightweight representation of the Grouped [Used-Service-Unit] Avp. It reports how many units of quota has been used since the service became active or how many units of quota has been used since the last interim/update.

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


Constructor Summary
UsedServiceUnit()
          Constructs an empty UsedServiceUnit object representing the [Used-Service-Unit] Avp.
UsedServiceUnit(java.util.List<Avp> avps)
          Constructs a UsedServiceUnit object representing the Grouped [Used-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.
 java.lang.Long getTariffTimeChange()
          Gets the value corresponding to the payload of the [Tariff-Time-Change] 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.
 void setTariffTimeChange(java.lang.Long tariffTimeChange)
          Sets the value corresponding to the payload of the [Tariff-Time-Change] Avp.
 Avp toAvp()
          Transforms a UsedServiceUnit object into a Grouped [Used-Service-Unit] Avp.
 void validate()
          Validates the members of the UsedServiceUnit object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsedServiceUnit

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


UsedServiceUnit

public UsedServiceUnit(java.util.List<Avp> avps)
                throws AvpTransformationException
Constructs a UsedServiceUnit object representing the Grouped [Used-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 UsedServiceUnit, 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 [Used-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-Timee] 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.

getTariffTimeChange

public java.lang.Long getTariffTimeChange()
Gets the value corresponding to the payload of the [Tariff-Time-Change] Avp.

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

setTariffTimeChange

public void setTariffTimeChange(java.lang.Long tariffTimeChange)
Sets the value corresponding to the payload of the [Tariff-Time-Change] Avp.

Parameters:
tariffTimeChange - the value corresponding to the payload of the [Tariff-Time-Change] Avp.

validate

public void validate()
              throws ChargingValidationException
Validates the members of the UsedServiceUnit 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 UsedServiceUnit is in an unexpected format.

toAvp

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

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

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


Copyright © 2006 IBM Corp. All Rights Reserved.