com.ibm.diameter.charging.util
Class MessageBody

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

public class MessageBody
extends java.lang.Object

MessageBody is a lightweight representation of the Grouped [WLAN-Radio-Container] Avp. It contains information about the SIP message body including user-to-user data.

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


Constructor Summary
MessageBody()
          Constructs an empty MessageBody object representing the [Message-Body] Avp.
MessageBody(java.util.List<Avp> avps)
          Constructs a MessageBody object representing the Grouped [Message-Body] Avp.
 
Method Summary
 java.lang.String getContentDisposition()
          Gets the value corresponding to the payload of the [Content-Disposition] Avp.
 java.lang.Integer getContentLength()
          Gets the value corresponding to the payload of the {Content-Length} Avp.
 java.lang.String getContentType()
          Gets the value corresponding to the payload of the {Content-Type} Avp.
 java.lang.Integer getOriginator()
          Gets the value corresponding to the payload of the [Originator] Avp.
 void setContentDisposition(java.lang.String contentDisposition)
          Sets the value corresponding to the payload of the [Content-Disposition] Avp.
 void setContentLength(java.lang.Integer contentLength)
          Sets the value corresponding to the payload of the {Content-Length} Avp.
 void setContentType(java.lang.String contentType)
          Sets the value corresponding to the payload of the {Content-Type} Avp.
 void setOriginator(java.lang.Integer originator)
          Sets the value corresponding to the payload of the [Originator] Avp.
 Avp toAvp()
          Transforms a MessageBody object into a Grouped [Message-Body] Avp.
 void validate()
          Validates the members of the MessageBody object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageBody

public MessageBody()
Constructs an empty MessageBody object representing the [Message-Body] Avp.


MessageBody

public MessageBody(java.util.List<Avp> avps)
            throws AvpTransformationException
Constructs a MessageBody object representing the Grouped [Message-Body] Avp.

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

getContentDisposition

public java.lang.String getContentDisposition()
Gets the value corresponding to the payload of the [Content-Disposition] Avp.

Returns:
the value corresponding to the payload of the [Content-Disposition] Avp.

setContentDisposition

public void setContentDisposition(java.lang.String contentDisposition)
Sets the value corresponding to the payload of the [Content-Disposition] Avp.

Parameters:
contentDisposition - the value corresponding to the payload of the [Content-Disposition] Avp.

getContentLength

public java.lang.Integer getContentLength()
Gets the value corresponding to the payload of the {Content-Length} Avp.

Returns:
the value corresponding to the payload of the {Content-Length} Avp.

setContentLength

public void setContentLength(java.lang.Integer contentLength)
Sets the value corresponding to the payload of the {Content-Length} Avp.

Parameters:
contentLength - the value corresponding to the payload of the {Content-Length} Avp.

getContentType

public java.lang.String getContentType()
Gets the value corresponding to the payload of the {Content-Type} Avp.

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

setContentType

public void setContentType(java.lang.String contentType)
Sets the value corresponding to the payload of the {Content-Type} Avp.

Parameters:
contentType - the value corresponding to the payload of the {Content-Type} Avp.

getOriginator

public java.lang.Integer getOriginator()
Gets the value corresponding to the payload of the [Originator] Avp.

Returns:
the value corresponding to the payload of the [Originator] Avp.

setOriginator

public void setOriginator(java.lang.Integer originator)
Sets the value corresponding to the payload of the [Originator] Avp.

Parameters:
originator - the value corresponding to the payload of the [Originator] Avp.

validate

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

toAvp

public Avp toAvp()
          throws AvpTransformationException
Transforms a MessageBody object into a Grouped [Message-Body] Avp.

All non-null members of MessageBody will be transformed into Avps nested inside of the [Message-Body] Avp.

Returns:
the [Message-Body] Avp.
Throws:
AvpTransformationException - if a member of MessageBody is in an unexpected format.


Copyright © 2006 IBM Corp. All Rights Reserved.