com.ibm.diameter.charging.util
Class GrantedServiceUnit

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

public class GrantedServiceUnit
extends java.lang.Object

GrantedServiceUnit is a lightweight representation of the Grouped [Granted-Service-Unit] Avp. The GrantedServiceUnit contains the amount of units that can be provided to the end user until the service is released or a new Credit-Control-Request is sent.

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


Constructor Summary
GrantedServiceUnit()
          Constructs an empty GrantedServiceUnit object representing the [Granted-Service-Unit] Avp.
GrantedServiceUnit(java.util.List<Avp> avps)
          Constructs a GrantedServiceUnit object representing the Grouped [Granted-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 GrantedServiceUnit object into a Grouped [Granted-Service-Unit] Avp.
 void validate()
          Validates the members of the GrantedServiceUnit object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrantedServiceUnit

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


GrantedServiceUnit

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

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 GrantedServiceUnit 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 GrantedServiceUnit is in an unexpected format.

toAvp

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

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

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


Copyright © 2006 IBM Corp. All Rights Reserved.