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

All Superinterfaces:
java.lang.Cloneable, DiameterMessage
All Known Implementing Classes:
SessionTerminationAnswerImpl, SessionTerminationRequestImpl

public interface SessionTerminationAnswer
extends DiameterMessage

Defines an interface representing the Session-Termination-Answer command. From the Diameter Base Protocol (rfc3588.txt) specification:

 8.4.2.  Session-Termination-Answer
 
    The Session-Termination-Answer (STA), indicated by the Command-Code
    set to 275 and the message flags' 'R' bit clear, is sent by the
    Diameter Server to acknowledge the notification that the session has
    been terminated.  The Result-Code AVP MUST be present, and MAY
    contain an indication that an error occurred while servicing the STR.
 
    Upon sending or receipt of the STA, the Diameter Server MUST release
    all resources for the session indicated by the Session-Id AVP.  Any
    intermediate server in the Proxy-Chain MAY also release any
    resources, if necessary.
 
    Message Format
 
       <Session-Termination-Answer>  ::= < Diameter Header: 275, PXY >
                  < Session-Id >
                  { Result-Code }
                  { Origin-Host }
                  { Origin-Realm }
                  [ User-Name ]
                * [ Class ]
                  [ Error-Message ]
                  [ Error-Reporting-Host ]
                * [ Failed-AVP ]
                  [ Origin-State-Id ]
                * [ Redirect-Host ]
                  [ Redirect-Host-Usage ]
                  [ Redirect-Max-Cache-Time ]
                * [ Proxy-Info ]
                * [ AVP ]
 


Field Summary
static int commandCode
           
 
Method Summary
 byte[][] getClassAvps()
          Returns the set of Class AVPs.
 java.lang.String getErrorMessage()
          Returns the value of the Error-Message AVP, of type UTF8String.
 DiameterIdentityAvp getErrorReportingHost()
          Returns the value of the Error-Reporting-Host AVP, of type DiameterIdentity.
 FailedAvp[] getFailedAvps()
          Returns the set of Failed-AVP AVPs.
 long getOriginStateId()
          Returns the value of the Origin-State-Id AVP, of type Unsigned32.
 ProxyInfoAvp[] getProxyInfos()
          Returns the set of Proxy-Info AVPs.
 DiameterURIAvp[] getRedirectHosts()
          Returns the set of Redirect-Host AVPs.
 RedirectHostUsageType getRedirectHostUsage()
          Returns the value of the Redirect-Host-Usage AVP, of type Enumerated.
 long getRedirectMaxCacheTime()
          Returns the value of the Redirect-Max-Cache-Time AVP, of type Unsigned32.
 long getResultCode()
          Returns the value of the Result-Code AVP, of type Unsigned32.
 java.lang.String getUserName()
          Returns the value of the User-Name AVP, of type UTF8String.
 boolean hasErrorMessage()
          Returns true if the Error-Message AVP is present in the message.
 boolean hasErrorReportingHost()
          Returns true if the Error-Reporting-Host AVP is present in the message.
 boolean hasOriginStateId()
          Returns true if the Origin-State-Id AVP is present in the message.
 boolean hasRedirectHostUsage()
          Returns true if the Redirect-Host-Usage AVP is present in the message.
 boolean hasRedirectMaxCacheTime()
          Returns true if the Redirect-Max-Cache-Time AVP is present in the message.
 boolean hasResultCode()
          Returns true if the Result-Code AVP is present in the message.
 boolean hasUserName()
          Returns true if the User-Name AVP is present in the message.
 void setClassAvp(byte[] classAvp)
          Sets a single Class AVP in the message, of type OctetString.
 void setClassAvps(byte[][] classAvps)
          Sets the set of Class AVPs, with all the values in the given array.
 void setErrorMessage(java.lang.String errorMessage)
          Sets the value of the Error-Message AVP, of type UTF8String.
 void setErrorReportingHost(DiameterIdentityAvp errorReportingHost)
          Sets the value of the Error-Reporting-Host AVP, of type DiameterIdentity.
 void setFailedAvp(FailedAvp failedAvp)
          Sets a single Failed-AVP AVP in the message, of type Grouped.
 void setFailedAvps(FailedAvp[] failedAvps)
          Sets the set of Failed-AVP AVPs, with all the values in the given array.
 void setOriginStateId(long originStateId)
          Sets the value of the Origin-State-Id AVP, of type Unsigned32.
 void setProxyInfo(ProxyInfoAvp proxyInfo)
          Sets a single Proxy-Info AVP in the message, of type Grouped.
 void setProxyInfos(ProxyInfoAvp[] proxyInfos)
          Sets the set of Proxy-Info AVPs, with all the values in the given array.
 void setRedirectHost(DiameterURIAvp redirectHost)
          Sets a single Redirect-Host AVP in the message, of type DiameterURI.
 void setRedirectHosts(DiameterURIAvp[] redirectHosts)
          Sets the set of Redirect-Host AVPs, with all the values in the given array.
 void setRedirectHostUsage(RedirectHostUsageType redirectHostUsage)
          Sets the value of the Redirect-Host-Usage AVP, of type Enumerated.
 void setRedirectMaxCacheTime(long redirectMaxCacheTime)
          Sets the value of the Redirect-Max-Cache-Time AVP, of type Unsigned32.
 void setResultCode(long resultCode)
          Sets the value of the Result-Code AVP, of type Unsigned32.
 void setUserName(java.lang.String userName)
          Sets the value of the User-Name AVP, of type UTF8String.
 
Methods inherited from interface net.java.slee.resource.diameter.base.events.DiameterMessage
clone, getAvps, getCommand, getDestinationHost, getDestinationRealm, getExtensionAvps, getHeader, getOriginHost, getOriginRealm, getSessionId, hasOriginHost, hasOriginRealm, hasSessionId, setDestinationHost, setDestinationRealm, setExtensionAvps, setOriginHost, setOriginRealm, setSessionId
 

Field Detail

commandCode

static final int commandCode
See Also:
Constant Field Values
Method Detail

hasResultCode

boolean hasResultCode()
Returns true if the Result-Code AVP is present in the message.


getResultCode

long getResultCode()
Returns the value of the Result-Code AVP, of type Unsigned32. Use hasResultCode() to check the existence of this AVP.

Returns:
the value of the Result-Code AVP
Throws:
java.lang.IllegalStateException - if the Result-Code AVP has not been set on this message

setResultCode

void setResultCode(long resultCode)
Sets the value of the Result-Code AVP, of type Unsigned32.

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

hasUserName

boolean hasUserName()
Returns true if the User-Name AVP is present in the message.


getUserName

java.lang.String getUserName()
Returns the value of the User-Name AVP, of type UTF8String.

Returns:
the value of the User-Name AVP or null if it has not been set on this message

setUserName

void setUserName(java.lang.String userName)
Sets the value of the User-Name AVP, of type UTF8String.

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

getClassAvps

byte[][] getClassAvps()
Returns the set of Class AVPs. The returned array contains the AVPs in the order they appear in the message. A return value of null implies that no Class AVPs have been set. The elements in the given array are byte[] objects.


setClassAvp

void setClassAvp(byte[] classAvp)
Sets a single Class AVP in the message, of type OctetString.

Throws:
java.lang.IllegalStateException - if setClassAvp or setClassAvps has already been called

setClassAvps

void setClassAvps(byte[][] classAvps)
Sets the set of Class 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 getClassAvps() is not guaranteed to return the same array instance, e.g. an "==" check would fail.

Throws:
java.lang.IllegalStateException - if setClassAvp or setClassAvps has already been called

hasErrorMessage

boolean hasErrorMessage()
Returns true if the Error-Message AVP is present in the message.


getErrorMessage

java.lang.String getErrorMessage()
Returns the value of the Error-Message AVP, of type UTF8String.

Returns:
the value of the Error-Message AVP or null if it has not been set on this message

setErrorMessage

void setErrorMessage(java.lang.String errorMessage)
Sets the value of the Error-Message AVP, of type UTF8String.

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

hasErrorReportingHost

boolean hasErrorReportingHost()
Returns true if the Error-Reporting-Host AVP is present in the message.


getErrorReportingHost

DiameterIdentityAvp getErrorReportingHost()
Returns the value of the Error-Reporting-Host AVP, of type DiameterIdentity.

Returns:
the value of the Error-Reporting-Host AVP or null if it has not been set on this message

setErrorReportingHost

void setErrorReportingHost(DiameterIdentityAvp errorReportingHost)
Sets the value of the Error-Reporting-Host AVP, of type DiameterIdentity.

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

getFailedAvps

FailedAvp[] getFailedAvps()
Returns the set of Failed-AVP AVPs. The returned array contains the AVPs in the order they appear in the message. A return value of null implies that no Failed-AVP AVPs have been set. The elements in the given array are FailedAvp objects.


setFailedAvp

void setFailedAvp(FailedAvp failedAvp)
Sets a single Failed-AVP AVP in the message, of type Grouped.

Throws:
java.lang.IllegalStateException - if setFailedAvp or setFailedAvps has already been called

setFailedAvps

void setFailedAvps(FailedAvp[] failedAvps)
Sets the set of Failed-AVP 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 getFailedAvps() is not guaranteed to return the same array instance, e.g. an "==" check would fail.

Throws:
java.lang.IllegalStateException - if setFailedAvp or setFailedAvps has already been called

hasOriginStateId

boolean hasOriginStateId()
Returns true if the Origin-State-Id AVP is present in the message.


getOriginStateId

long getOriginStateId()
Returns the value of the Origin-State-Id AVP, of type Unsigned32. Use hasOriginStateId() to check the existence of this AVP.

Returns:
the value of the Origin-State-Id AVP
Throws:
java.lang.IllegalStateException - if the Origin-State-Id AVP has not been set on this message

setOriginStateId

void setOriginStateId(long originStateId)
Sets the value of the Origin-State-Id AVP, of type Unsigned32.

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

getRedirectHosts

DiameterURIAvp[] getRedirectHosts()
Returns the set of Redirect-Host AVPs. The returned array contains the AVPs in the order they appear in the message. A return value of null implies that no Redirect-Host AVPs have been set. The elements in the given array are DiameterURI objects.


setRedirectHost

void setRedirectHost(DiameterURIAvp redirectHost)
Sets a single Redirect-Host AVP in the message, of type DiameterURI.

Throws:
java.lang.IllegalStateException - if setRedirectHost or setRedirectHosts has already been called

setRedirectHosts

void setRedirectHosts(DiameterURIAvp[] redirectHosts)
Sets the set of Redirect-Host 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 getRedirectHosts() is not guaranteed to return the same array instance, e.g. an "==" check would fail.

Throws:
java.lang.IllegalStateException - if setRedirectHost or setRedirectHosts has already been called

hasRedirectHostUsage

boolean hasRedirectHostUsage()
Returns true if the Redirect-Host-Usage AVP is present in the message.


getRedirectHostUsage

RedirectHostUsageType getRedirectHostUsage()
Returns the value of the Redirect-Host-Usage AVP, of type Enumerated.

Returns:
the value of the Redirect-Host-Usage AVP or null if it has not been set on this message

setRedirectHostUsage

void setRedirectHostUsage(RedirectHostUsageType redirectHostUsage)
Sets the value of the Redirect-Host-Usage AVP, of type Enumerated.

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

hasRedirectMaxCacheTime

boolean hasRedirectMaxCacheTime()
Returns true if the Redirect-Max-Cache-Time AVP is present in the message.


getRedirectMaxCacheTime

long getRedirectMaxCacheTime()
Returns the value of the Redirect-Max-Cache-Time AVP, of type Unsigned32. Use hasRedirectMaxCacheTime() to check the existence of this AVP.

Returns:
the value of the Redirect-Max-Cache-Time AVP
Throws:
java.lang.IllegalStateException - if the Redirect-Max-Cache-Time AVP has not been set on this message

setRedirectMaxCacheTime

void setRedirectMaxCacheTime(long redirectMaxCacheTime)
Sets the value of the Redirect-Max-Cache-Time AVP, of type Unsigned32.

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

getProxyInfos

ProxyInfoAvp[] getProxyInfos()
Returns the set of Proxy-Info AVPs. The returned array contains the AVPs in the order they appear in the message. A return value of null implies that no Proxy-Info AVPs have been set. The elements in the given array are ProxyInfo objects.


setProxyInfo

void setProxyInfo(ProxyInfoAvp proxyInfo)
Sets a single Proxy-Info AVP in the message, of type Grouped.

Throws:
java.lang.IllegalStateException - if setProxyInfo or setProxyInfos has already been called

setProxyInfos

void setProxyInfos(ProxyInfoAvp[] proxyInfos)
Sets the set of Proxy-Info 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 getProxyInfos() is not guaranteed to return the same array instance, e.g. an "==" check would fail.

Throws:
java.lang.IllegalStateException - if setProxyInfo or setProxyInfos has already been called


Copyright © 2008. All Rights Reserved.