com.ibm.diameter.charging.util
Class SubscriptionId

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

public class SubscriptionId
extends java.lang.Object

SubscriptionId is a lightweight representation of the Grouped [Subscription-Id] Avp. It identifies an end user's subscription.

The [Subscription-Id] Avp is defined in RFC 4006 - Diameter Credit-Control Application.


Constructor Summary
SubscriptionId()
          Constructs an empty SubscriptionId object representing the [Subscription-Id] Avp.
SubscriptionId(java.util.List<Avp> avps)
          Constructs a SubscriptionId object representing the Grouped [Subscription-Id] Avp.
 
Method Summary
 java.lang.String getSubscriptionIdData()
          Gets the value corresponding to the payload of the {Subscription-Id-Data} Avp.
 java.lang.Integer getSubscriptionIdType()
          Gets the value corresponding to the payload of the {Subscription-Id-Type} Avp.
 void setSubscriptionIdData(java.lang.String subscriptionIdData)
          Sets the value corresponding to the payload of the {Subscription-Id-Data} Avp.
 void setSubscriptionIdType(java.lang.Integer subscriptionIdType)
          Sets the value corresponding to the payload of the {Subscription-Id-Type} Avp.
 Avp toAvp()
          Transforms a SubscriptionId object into a Grouped [Subscription-Id] Avp.
 void validate()
          Validates the members of the SubscriptionId object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscriptionId

public SubscriptionId()
Constructs an empty SubscriptionId object representing the [Subscription-Id] Avp.


SubscriptionId

public SubscriptionId(java.util.List<Avp> avps)
               throws AvpTransformationException
Constructs a SubscriptionId object representing the Grouped [Subscription-Id] Avp.

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

getSubscriptionIdData

public java.lang.String getSubscriptionIdData()
Gets the value corresponding to the payload of the {Subscription-Id-Data} Avp.

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

setSubscriptionIdData

public void setSubscriptionIdData(java.lang.String subscriptionIdData)
Sets the value corresponding to the payload of the {Subscription-Id-Data} Avp.

Parameters:
subscriptionIdData - the value corresponding to the payload of the {Subscription-Id-Data} Avp.

getSubscriptionIdType

public java.lang.Integer getSubscriptionIdType()
Gets the value corresponding to the payload of the {Subscription-Id-Type} Avp.

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

setSubscriptionIdType

public void setSubscriptionIdType(java.lang.Integer subscriptionIdType)
Sets the value corresponding to the payload of the {Subscription-Id-Type} Avp.

Parameters:
subscriptionIdType - the value corresponding to the payload of the {Subscription-Id-Type} Avp.

validate

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

toAvp

public Avp toAvp()
          throws AvpTransformationException
Transforms a SubscriptionId object into a Grouped [Subscription-Id] Avp.

All non-null members of SubscriptionId will be transformed into Avps nested inside of the [Subscription-Id] Avp.

Returns:
the [Subscription-Id] Avp.
Throws:
AvpTransformationException - if a member of SubscriptionId is in an unexpected format.


Copyright © 2006 IBM Corp. All Rights Reserved.