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

All Superinterfaces:
java.lang.Cloneable
All Known Subinterfaces:
AbortSessionAnswer, AbortSessionRequest, AccountingAnswer, AccountingRequest, CapabilitiesExchangeAnswer, CapabilitiesExchangeRequest, DeviceWatchdogAnswer, DeviceWatchdogRequest, DisconnectPeerAnswer, DisconnectPeerRequest, ErrorAnswer, ExtensionDiameterMessage, ReAuthAnswer, ReAuthRequest, SessionTerminationAnswer, SessionTerminationRequest
All Known Implementing Classes:
AbortSessionAnswerImpl, AbortSessionRequestImpl, AccountingAnswerImpl, AccountingRequestImpl, CapabilitiesExchangeAnswerImpl, CapabilitiesExchangeRequestImpl, DeviceWatchdogAnswerImpl, DeviceWatchdogRequestImpl, DiameterMessageImpl, DisconnectPeerAnswerImpl, DisconnectPeerRequestImpl, ErrorAnswerImpl, ExtensionDiameterMessageImpl, ReAuthAnswerImpl, ReAuthRequestImpl, SessionTerminationAnswerImpl, 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:
Open Cloud

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.
 DiameterIdentityAvp getDestinationHost()
          Returns the value of the Destination-Host AVP, of type DiameterIdentity.
 DiameterIdentityAvp 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.
 DiameterIdentityAvp getOriginHost()
          Returns the value of the Origin-Host AVP, of type DiameterIdentity.
 DiameterIdentityAvp 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 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(DiameterIdentityAvp destinationHost)
          Sets the value of the Destination-Host AVP, of type DiameterIdentity.
 void setDestinationRealm(DiameterIdentityAvp 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(DiameterIdentityAvp originHost)
          Sets the value of the Origin-Host AVP, of type DiameterIdentity.
 void setOriginRealm(DiameterIdentityAvp 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 net.java.slee.resource.diameter.base.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

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

getOriginHost

DiameterIdentityAvp 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(DiameterIdentityAvp originHost)
Sets the value of the Origin-Host AVP, of type DiameterIdentity.

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

getOriginRealm

DiameterIdentityAvp 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(DiameterIdentityAvp originRealm)
Sets the value of the Origin-Realm AVP, of type DiameterIdentity.

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

getDestinationRealm

DiameterIdentityAvp 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(DiameterIdentityAvp destinationRealm)
Sets the value of the Destination-Realm AVP, of type DiameterIdentity.

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

getDestinationHost

DiameterIdentityAvp 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(DiameterIdentityAvp 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.

hasSessionId

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


hasOriginHost

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


hasOriginRealm

boolean hasOriginRealm()
Returns true if the Origin-Realm AVP is present in the 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 © 2008. All Rights Reserved.