com.ibm.diameter.charging.util
Class TimeStamps

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

public class TimeStamps
extends java.lang.Object

TimeStamps is a lightweight representation of the Grouped [Time-Stamps] Avp. It holds the time of the initial SIP request and the time of the response to the initial SIP Request.

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


Constructor Summary
TimeStamps()
          Constructs an empty TimeStamps object representing the [Time-Stamps] Avp.
TimeStamps(java.util.List<Avp> avps)
          Constructs a TimeStamps object representing the Grouped [Time-Stamps] Avp.
 
Method Summary
 java.lang.Long getSipRequestTimeStamp()
          Gets the value corresponding to the payload of the [SIP-Request-Timestamp] Avp.
 java.lang.Long getSipResponseTimeStamp()
          Gets the value corresponding to the payload of the [SIP-Request-Timestamp] Avp.
 void setSipRequestTimeStamp(java.lang.Long sipRequestTimeStamp)
          Sets the value corresponding to the payload of the [SIP-Request-Timestamp] Avp.
 void setSipResponseTimeStamp(java.lang.Long sipResponseTimeStamp)
          Sets the value corresponding to the payload of the [SIP-Response-Timestamp] Avp.
 Avp toAvp()
          Transforms a TimeStamps object into a Grouped [Time-Stamps] Avp.
 void validate()
          Validates the members of the TimeStamps object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeStamps

public TimeStamps()
Constructs an empty TimeStamps object representing the [Time-Stamps] Avp.


TimeStamps

public TimeStamps(java.util.List<Avp> avps)
           throws AvpTransformationException
Constructs a TimeStamps object representing the Grouped [Time-Stamps] Avp.

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

getSipRequestTimeStamp

public java.lang.Long getSipRequestTimeStamp()
Gets the value corresponding to the payload of the [SIP-Request-Timestamp] Avp.

Returns:
the value corresponding to the payload of the [SIP-Request-Timestamp] Avp.

setSipRequestTimeStamp

public void setSipRequestTimeStamp(java.lang.Long sipRequestTimeStamp)
Sets the value corresponding to the payload of the [SIP-Request-Timestamp] Avp.

Parameters:
sipRequestTimeStamp - the value corresponding to the payload of the [SIP-Request-Timestamp] Avp.

getSipResponseTimeStamp

public java.lang.Long getSipResponseTimeStamp()
Gets the value corresponding to the payload of the [SIP-Request-Timestamp] Avp.

Returns:
the value corresponding to the payload of the [SIP-Response-Timestamp] Avp.

setSipResponseTimeStamp

public void setSipResponseTimeStamp(java.lang.Long sipResponseTimeStamp)
Sets the value corresponding to the payload of the [SIP-Response-Timestamp] Avp.

Parameters:
sipResponseTimeStamp - the value corresponding to the payload of the [SIP-Response-Timestamp] Avp.

validate

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

toAvp

public Avp toAvp()
          throws AvpTransformationException
Transforms a TimeStamps object into a Grouped [Time-Stamps] Avp.

All non-null members of TimeStamps will be transformed into Avps nested inside of the [Time-Stamps] Avp.

Returns:
the [Time-Stamps] Avp.
Throws:
AvpTransformationException - if a member of TimeStamps is in an unexpected format.


Copyright © 2006 IBM Corp. All Rights Reserved.