com.ibm.diameter.charging.util
Class ServerCapabilities

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

public class ServerCapabilities
extends java.lang.Object

ServerCapabilities is a lightweight representation of the Grouped [Server-Capabilities] Avp. It holds the capabilities of a SIP server.

The [Server-Capabilities] Avp is defined by the 3GPP in ETSI TS 132 299 V6.9.0 (2006-12) - Diameter charging applications.


Constructor Summary
ServerCapabilities()
          Constructs an empty ServerCapabilities object representing the [Server-Capabilities] Avp.
ServerCapabilities(java.util.List<Avp> avps)
          Constructs a ServerCapabilities object representing the Grouped [Server-Capabilities] Avp.
 
Method Summary
 java.lang.Integer[] getMandatoryCapabilities()
          Gets the values corresponding to the payloads of the [Mandatory-Capability] Avps.
 java.lang.Integer[] getOptionalCapabilities()
          Gets the values corresponding to the payloads of the [Optional-Capability] Avps.
 java.lang.String[] getServerNames()
          Gets the values corresponding to the payloads of the [Server-Name] Avps.
 void setMandatoryCapabilities(java.lang.Integer[] mandatoryCapabilities)
          Sets the values corresponding to the payloads of the [Mandatory-Capability] Avps.
 void setOptionalCapabilities(java.lang.Integer[] optionalCapabilities)
          Sets the values corresponding to the payloads of the [Optional-Capability] Avps.
 void setServerNames(java.lang.String[] serverName)
          Sets the values corresponding to the payloads of the [Server-Name] Avps.
 Avp toAvp()
          Transforms a ServerCapabilities object into a Grouped [Server-Capabilities] Avp.
 void validate()
          Validates the members of the ServerCapabilities object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerCapabilities

public ServerCapabilities()
Constructs an empty ServerCapabilities object representing the [Server-Capabilities] Avp.


ServerCapabilities

public ServerCapabilities(java.util.List<Avp> avps)
                   throws AvpTransformationException
Constructs a ServerCapabilities object representing the Grouped [Server-Capabilities] Avp.

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

getMandatoryCapabilities

public java.lang.Integer[] getMandatoryCapabilities()
Gets the values corresponding to the payloads of the [Mandatory-Capability] Avps.

Returns:
the values corresponding to the payloads of the [Mandatory-Capability] Avps.

setMandatoryCapabilities

public void setMandatoryCapabilities(java.lang.Integer[] mandatoryCapabilities)
Sets the values corresponding to the payloads of the [Mandatory-Capability] Avps.

Parameters:
mandatoryCapabilities - the values corresponding to the payloads of the [Mandatory-Capability] Avps.

getOptionalCapabilities

public java.lang.Integer[] getOptionalCapabilities()
Gets the values corresponding to the payloads of the [Optional-Capability] Avps.

Returns:
the values corresponding to the payloads of the [Optional-Capability] Avps.

setOptionalCapabilities

public void setOptionalCapabilities(java.lang.Integer[] optionalCapabilities)
Sets the values corresponding to the payloads of the [Optional-Capability] Avps.

Parameters:
optionalCapabilities - the values corresponding to the payloads of the [Optional-Capability] Avps.

getServerNames

public java.lang.String[] getServerNames()
Gets the values corresponding to the payloads of the [Server-Name] Avps.

Returns:
the values corresponding to the payloads of the [Server-Name] Avps.

setServerNames

public void setServerNames(java.lang.String[] serverName)
Sets the values corresponding to the payloads of the [Server-Name] Avps.

Parameters:
serverNames - the values corresponding to the payloads of the [Server-Name] Avps.

validate

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

toAvp

public Avp toAvp()
          throws AvpTransformationException
Transforms a ServerCapabilities object into a Grouped [Server-Capabilities] Avp.

All non-null members of ServerCapabilities will be transformed into Avps nested inside of the [Server-Capabilities] Avp.

Returns:
the [Server-Capabilities] Avp.
Throws:
AvpTransformationException - if a member of ServerCapabilities is in an unexpected format.


Copyright © 2006 IBM Corp. All Rights Reserved.