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

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

public interface ErrorAnswer
extends DiameterMessage

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

 7.2.  Error Bit
 
    The 'E' (Error Bit) in the Diameter header is set when the request
    caused a protocol-related error (see Section 7.1.3).  A message with
    the 'E' bit MUST NOT be sent as a response to an answer message.
    Note that a message with the 'E' bit set is still subjected to the
    processing rules defined in Section 6.2.  When set, the answer
    message will not conform to the ABNF specification for the command,
    and will instead conform to the following ABNF:
 
    Message Format
 
    <Error-Answer> ::= < Diameter Header: 0, ERR [PXY] >
                      0*1< Session-Id >
                         { Origin-Host }
                         { Origin-Realm }
                         { Result-Code }
                         [ Origin-State-Id ]
                         [ Error-Reporting-Host ]
                         [ Proxy-Info ]
                       * [ AVP ]
    Note that the code used in the header is the same than the one found
    in the request message, but with the 'R' bit cleared and the 'E' bit
    set.  The 'P' bit in the header is set to the same value as the one
    found in the request message.
 
 


Field Summary
static int commandCode
           
 
Method Summary
 DiameterIdentityAvp getErrorReportingHost()
          Returns the value of the Error-Reporting-Host AVP, of type DiameterIdentity.
 DiameterAvp[] getExtensionAvps()
          Returns the set of extension AVPs.
 long getOriginStateId()
          Returns the value of the Origin-State-Id AVP, of type Unsigned32.
 ProxyInfoAvp getProxyInfo()
          Returns the value of the Proxy-Info AVP, of type Grouped.
 long getResultCode()
          Returns the value of the Result-Code AVP, of type Unsigned32.
 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 hasProxyInfo()
          Returns true if the Proxy-Info AVP is present in the message.
 boolean hasResultCode()
          Returns true if the Result-Code AVP is present in the message.
 void setErrorReportingHost(DiameterIdentityAvp errorReportingHost)
          Sets the value of the Error-Reporting-Host AVP, of type DiameterIdentity.
 void setExtensionAvps(DiameterAvp[] avps)
          Sets the set of extension 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 the value of the Proxy-Info AVP, of type Grouped.
 void setResultCode(long resultCode)
          Sets the value of the Result-Code AVP, of type Unsigned32.
 
Methods inherited from interface net.java.slee.resource.diameter.base.events.DiameterMessage
clone, getAvps, getCommand, getDestinationHost, getDestinationRealm, getHeader, getOriginHost, getOriginRealm, getSessionId, hasOriginHost, hasOriginRealm, hasSessionId, setDestinationHost, setDestinationRealm, 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

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

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

hasProxyInfo

boolean hasProxyInfo()
Returns true if the Proxy-Info AVP is present in the message.


getProxyInfo

ProxyInfoAvp getProxyInfo()
Returns the value of the Proxy-Info AVP, of type Grouped.

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

setProxyInfo

void setProxyInfo(ProxyInfoAvp proxyInfo)
Sets the value of the Proxy-Info AVP, of type Grouped.

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

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.

Specified by:
getExtensionAvps in interface DiameterMessage

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.

Specified by:
setExtensionAvps in interface DiameterMessage
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.