net.java.slee.resource.diameter.base.events
Interface DiameterMessage

All Superinterfaces:
java.lang.Cloneable
All Known Subinterfaces:
AbortSessionAnswer, AbortSessionRequest, AccountingAnswer, AccountingRequest, CapabilitiesExchangeAnswer, CapabilitiesExchangeMessage, CapabilitiesExchangeRequest, DeviceWatchdogAnswer, DeviceWatchdogRequest, DisconnectPeerAnswer, DisconnectPeerRequest, ErrorAnswer, ExtensionDiameterMessage, ReAuthAnswer, ReAuthRequest, SessionTerminationAnswer, SessionTerminationMessage, SessionTerminationRequest
All Known Implementing Classes:
AbortSessionAnswerImpl, AbortSessionRequestImpl, AccountingAnswerImpl, AccountingMessageImpl, AccountingRequestImpl, CapabilitiesExchangeAnswerImpl, CapabilitiesExchangeMessageImpl, CapabilitiesExchangeRequestImpl, DeviceWatchdogAnswerImpl, DeviceWatchdogRequestImpl, DiameterMessageImpl, DisconnectPeerAnswerImpl, DisconnectPeerRequestImpl, ErrorAnswerImpl, ExtensionDiameterMessageImpl, ReAuthAnswerImpl, ReAuthRequestImpl, SessionTerminationAnswerImpl, SessionTerminationMessageImpl, SessionTerminationRequestImpl

public interface DiameterMessage
extends java.lang.Cloneable

A Diameter message containing a command code and a collection of AVPs.

This is a representation of the contents of a message that a client may be interested in.

Author:
Alexandre Mendonca , Bartosz Baranowski

Method Summary
 java.lang.Object clone()
          Creates and returns a deep copy of this Diameter message.
 DiameterAvp[] getAvps()
          Return the AVPs contained in this message, as an array of DiameterAvp objects.
 DiameterCommand getCommand()
          Return the DiameterCommand contained in the header of this message.
 DiameterIdentity getDestinationHost()
          Returns the value of the Destination-Host AVP, of type DiameterIdentity.
 DiameterIdentity getDestinationRealm()
          Returns the value of the Destination-Realm AVP, of type DiameterIdentity.
 DiameterAvp[] getExtensionAvps()
          Returns the set of extension AVPs.
 DiameterHeader getHeader()
          Return the org.mobicents.slee.resource.diameter.base.DiameterHeader in this message, if it exists.
 DiameterIdentity getOriginHost()
          Returns the value of the Origin-Host AVP, of type DiameterIdentity.
 DiameterIdentity getOriginRealm()
          Returns the value of the Origin-Realm AVP, of type DiameterIdentity.
 java.lang.String getSessionId()
          Returns the value of the Session-Id AVP, of type UTF8String.
 boolean hasDestinationHost()
          Returns true if the Destination-Host AVP is present in the message.
 boolean hasDestinationRealm()
          Returns true if the Destination-Realm AVP is present in the message.
 boolean hasOriginHost()
          Returns true if the Origin-Host AVP is present in the message.
 boolean hasOriginRealm()
          Returns true if the Origin-Realm AVP is present in the message.
 boolean hasSessionId()
          Returns true if the Session-Id AVP is present in the message.
 void setDestinationHost(DiameterIdentity destinationHost)
          Sets the value of the Destination-Host AVP, of type DiameterIdentity.
 void setDestinationRealm(DiameterIdentity destinationRealm)
          Sets the value of the Destination-Realm AVP, of type DiameterIdentity.
 void setExtensionAvps(DiameterAvp... avps)
          Sets the set of extension AVPs with all the values in the given array.
 void setOriginHost(DiameterIdentity originHost)
          Sets the value of the Origin-Host AVP, of type DiameterIdentity.
 void setOriginRealm(DiameterIdentity originRealm)
          Sets the value of the Origin-Realm AVP, of type DiameterIdentity.
 void setSessionId(java.lang.String sessionId)
          Sets the value of the Session-Id AVP, of type UTF8String.
 

Method Detail

getHeader

DiameterHeader getHeader()
Return the org.mobicents.slee.resource.diameter.base.DiameterHeader in this message, if it exists. The header will not exist for outgoing messages created via the DiameterMessageFactory.

Returns:
DiameterHeader if one exists, otherwise null

getCommand

DiameterCommand getCommand()
Return the DiameterCommand contained in the header of this message.

Returns:
a DiameterCommand instance

getAvps

DiameterAvp[] getAvps()
Return the AVPs contained in this message, as an array of DiameterAvp objects. AVPs are returned in the same order in which they appear in the message.

Returns:
a list of AVPs

hasSessionId

boolean hasSessionId()
Returns true if the Session-Id AVP is present in the message.


getSessionId

java.lang.String getSessionId()
Returns the value of the Session-Id AVP, of type UTF8String. A return value of null implies that the AVP has not been set.


setSessionId

void setSessionId(java.lang.String sessionId)
Sets the value of the Session-Id AVP, of type UTF8String.

Throws:
java.lang.IllegalStateException - if setSessionId has already been called

hasOriginHost

boolean hasOriginHost()
Returns true if the Origin-Host AVP is present in the message.


getOriginHost

DiameterIdentity getOriginHost()
Returns the value of the Origin-Host AVP, of type DiameterIdentity. A return value of null implies that the AVP has not been set.


setOriginHost

void setOriginHost(DiameterIdentity originHost)
Sets the value of the Origin-Host AVP, of type DiameterIdentity.

Throws:
java.lang.IllegalStateException - if setOriginHost has already been called

hasOriginRealm

boolean hasOriginRealm()
Returns true if the Origin-Realm AVP is present in the message.


getOriginRealm

DiameterIdentity getOriginRealm()
Returns the value of the Origin-Realm AVP, of type DiameterIdentity. A return value of null implies that the AVP has not been set.


setOriginRealm

void setOriginRealm(DiameterIdentity originRealm)
Sets the value of the Origin-Realm AVP, of type DiameterIdentity.

Throws:
java.lang.IllegalStateException - if setOriginRealm has already been called

hasDestinationRealm

boolean hasDestinationRealm()
Returns true if the Destination-Realm AVP is present in the message.


getDestinationRealm

DiameterIdentity getDestinationRealm()
Returns the value of the Destination-Realm AVP, of type DiameterIdentity. A return value of null implies that the AVP has not been set.


setDestinationRealm

void setDestinationRealm(DiameterIdentity destinationRealm)
Sets the value of the Destination-Realm AVP, of type DiameterIdentity.

Throws:
java.lang.IllegalStateException - if setDestinationRealm has already been called

hasDestinationHost

boolean hasDestinationHost()
Returns true if the Destination-Host AVP is present in the message.


getDestinationHost

DiameterIdentity getDestinationHost()
Returns the value of the Destination-Host AVP, of type DiameterIdentity. A return value of null implies that the AVP has not been set.


setDestinationHost

void setDestinationHost(DiameterIdentity destinationHost)
Sets the value of the Destination-Host AVP, of type DiameterIdentity.

Throws:
java.lang.IllegalStateException - if setDestinationHost has already been called

clone

java.lang.Object clone()
Creates and returns a deep copy of this Diameter message.

Returns:
a deep copy of this message.

getExtensionAvps

DiameterAvp[] getExtensionAvps()
Returns the set of extension AVPs. The returned array contains the extension AVPs in the order they appear in the message. A return value of null implies that no extensions AVPs have been set.


setExtensionAvps

void setExtensionAvps(DiameterAvp... avps)
                      throws AvpNotAllowedException
Sets the set of extension AVPs with all the values in the given array. The AVPs will be added to message in the order in which they appear in the array. Note: the array must not be altered by the caller following this call, and getExtensionAvps() is not guaranteed to return the same array instance, e.g. an "==" check would fail.

Throws:
AvpNotAllowedException - if an AVP is encountered of a type already known to this class (i.e. an AVP for which get/set methods already appear in this class)
java.lang.IllegalStateException - if setExtensionAvps has already been called


Copyright © 2011. All Rights Reserved.