Interface ErrorAnswer
-
- All Superinterfaces:
Cloneable
,DiameterMessage
public interface ErrorAnswer extends DiameterMessage
Defines an interface representing the Error-Answer command. From the Diameter Base Protocol (rfc6733.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 CCF specification for the command; instead, it and will conform to the following CCF: Message Format <Error-Answer> ::= < Diameter Header: 0, ERR [PXY] > 0*1< Session-Id > { Origin-Host } { Origin-Realm } { Result-Code } [ Origin-State-Id ] [ Error-Message ] [ Error-Reporting-Host ] [ Failed-AVP ] [ Experimental-Result ] * [ 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
Fields Modifier and Type Field Description static int
commandCode
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getErrorMessage()
Returns the value of the Error-Message AVP, of type UTF8String.DiameterIdentity
getErrorReportingHost()
Returns the value of the Error-Reporting-Host AVP, of type DiameterIdentity.ExperimentalResult
getExperimentalResult()
Returns the value of the Experimental-Result AVP, of type Grouped.DiameterAvp[]
getExtensionAvps()
Returns the set of extension AVPs.FailedAvp
getFailedAvp()
Returns the value of the Failed-AVP AVP, of type Grouped.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.long
getOriginStateId()
Returns the value of the Origin-State-Id AVP, of type Unsigned32.ProxyInfo[]
getProxyInfos()
Returns the set of Proxy-Info AVPs.long
getResultCode()
Returns the value of the Result-Code AVP, of type Unsigned32.String
getSessionId()
Returns the value of the Session-Id 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
hasExperimentalResult()
Returns true if the Experimental-Result AVP is present in the message.boolean
hasFailedAvp()
Returns true if the Failed-AVP 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
hasOriginStateId()
Returns true if the Origin-State-Id AVP is present in the message.boolean
hasResultCode()
Returns true if the Result-Code AVP is present in the message.boolean
hasSessionId()
Returns true if the Session-Id AVP is present in the message.void
removeErrorMessage()
Removes the Error-Message AVP from the message.void
removeErrorReportingHost()
Removes the Error-Reporting-Host AVP from the message.void
removeExperimentalResult()
Removes the Experimental-Result AVP from the message.void
removeExtensionAvps()
Removes all extension AVPs from the message.void
removeFailedAvp()
Removes the Failed-AVP AVP from the message.void
removeOriginHost()
Removes the Origin-Host AVP from the message.void
removeOriginRealm()
Removes the Origin-Realm AVP from the message.void
removeOriginStateId()
Removes the Origin-State-Id AVP from the message.void
removeProxyInfos()
Removes all Proxy-Info AVPs from the message.void
removeResultCode()
Removes the Result-Code AVP from the message.void
removeSessionId()
Removes the Session-Id AVP from the message.void
setErrorMessage(String errorMessage)
Sets the value of the Error-Message AVP, of type UTF8String.void
setErrorReportingHost(DiameterIdentity errorReportingHost)
Sets the value of the Error-Reporting-Host AVP, of type DiameterIdentity.void
setExperimentalResult(ExperimentalResult experimentalResult)
Sets the value of the Experimental-Result AVP, of type Grouped.void
setExtensionAvps(DiameterAvp[] avps)
Sets the set of extension AVPs with all the values in the given array.void
setFailedAvp(FailedAvp failedAvp)
Sets the value of the Failed-AVP AVP, of type Grouped.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
setOriginStateId(long originStateId)
Sets the value of the Origin-State-Id AVP, of type Unsigned32.void
setProxyInfo(ProxyInfo proxyInfo)
Sets a single Proxy-Info AVP in the message, of type Grouped.void
setProxyInfos(ProxyInfo[] proxyInfos)
Sets the set of Proxy-Info AVPs, with all the values in the given array.void
setResultCode(long resultCode)
Sets the value of the Result-Code AVP, of type Unsigned32.void
setSessionId(String sessionId)
Sets the value of the Session-Id AVP, of type UTF8String.-
Methods inherited from interface org.jainslee.resources.diameter.base.DiameterMessage
clone, getAvps, getCommand, getDestinationHost, getDestinationRealm, getHeader, setDestinationHost, setDestinationRealm
-
-
-
-
Field Detail
-
commandCode
static final int commandCode
- See Also:
- Constant Field Values
-
-
Method Detail
-
hasSessionId
boolean hasSessionId()
Returns true if the Session-Id AVP is present in the message.
-
getSessionId
String getSessionId()
Returns the value of the Session-Id AVP, of type UTF8String.- Specified by:
getSessionId
in interfaceDiameterMessage
- Returns:
- the value of the Session-Id AVP or null if it has not been set on this message
-
setSessionId
void setSessionId(String sessionId)
Sets the value of the Session-Id AVP, of type UTF8String.- Specified by:
setSessionId
in interfaceDiameterMessage
- Throws:
NullPointerException
- ifsessionId
isnull
.
-
removeSessionId
void removeSessionId()
Removes the Session-Id AVP from the message. If the Session-Id AVP is not present, this method returns silently.
-
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.- Specified by:
getOriginHost
in interfaceDiameterMessage
- Returns:
- the value of the Origin-Host AVP or null if it has not been set on this message
-
setOriginHost
void setOriginHost(DiameterIdentity originHost)
Sets the value of the Origin-Host AVP, of type DiameterIdentity.- Specified by:
setOriginHost
in interfaceDiameterMessage
- Throws:
NullPointerException
- iforiginHost
isnull
.
-
removeOriginHost
void removeOriginHost()
Removes the Origin-Host AVP from the message. If the Origin-Host AVP is not present, this method returns silently.
-
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.- Specified by:
getOriginRealm
in interfaceDiameterMessage
- Returns:
- the value of the Origin-Realm AVP or null if it has not been set on this message
-
setOriginRealm
void setOriginRealm(DiameterIdentity originRealm)
Sets the value of the Origin-Realm AVP, of type DiameterIdentity.- Specified by:
setOriginRealm
in interfaceDiameterMessage
- Throws:
NullPointerException
- iforiginRealm
isnull
.
-
removeOriginRealm
void removeOriginRealm()
Removes the Origin-Realm AVP from the message. If the Origin-Realm AVP is not present, this method returns silently.
-
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. UsehasResultCode()
to check the existence of this AVP.- Returns:
- the value of the Result-Code AVP
- Throws:
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.
-
removeResultCode
void removeResultCode()
Removes the Result-Code AVP from the message. If the Result-Code AVP is not present, this method returns silently.
-
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. UsehasOriginStateId()
to check the existence of this AVP.- Returns:
- the value of the Origin-State-Id AVP
- Throws:
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.
-
removeOriginStateId
void removeOriginStateId()
Removes the Origin-State-Id AVP from the message. If the Origin-State-Id AVP is not present, this method returns silently.
-
hasErrorMessage
boolean hasErrorMessage()
Returns true if the Error-Message AVP is present in the message.
-
getErrorMessage
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(String errorMessage)
Sets the value of the Error-Message AVP, of type UTF8String.- Throws:
NullPointerException
- iferrorMessage
isnull
.
-
removeErrorMessage
void removeErrorMessage()
Removes the Error-Message AVP from the message. If the Error-Message AVP is not present, this method returns silently.
-
hasErrorReportingHost
boolean hasErrorReportingHost()
Returns true if the Error-Reporting-Host AVP is present in the message.
-
getErrorReportingHost
DiameterIdentity 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(DiameterIdentity errorReportingHost)
Sets the value of the Error-Reporting-Host AVP, of type DiameterIdentity.- Throws:
NullPointerException
- iferrorReportingHost
isnull
.
-
removeErrorReportingHost
void removeErrorReportingHost()
Removes the Error-Reporting-Host AVP from the message. If the Error-Reporting-Host AVP is not present, this method returns silently.
-
hasFailedAvp
boolean hasFailedAvp()
Returns true if the Failed-AVP AVP is present in the message.
-
getFailedAvp
FailedAvp getFailedAvp()
Returns the value of the Failed-AVP AVP, of type Grouped.- Returns:
- the value of the Failed-AVP AVP or null if it has not been set on this message
-
setFailedAvp
void setFailedAvp(FailedAvp failedAvp)
Sets the value of the Failed-AVP AVP, of type Grouped.- Throws:
NullPointerException
- iffailedAvp
isnull
.
-
removeFailedAvp
void removeFailedAvp()
Removes the Failed-AVP AVP from the message. If the Failed-AVP AVP is not present, this method returns silently.
-
hasExperimentalResult
boolean hasExperimentalResult()
Returns true if the Experimental-Result AVP is present in the message.
-
getExperimentalResult
ExperimentalResult getExperimentalResult()
Returns the value of the Experimental-Result AVP, of type Grouped.- Returns:
- the value of the Experimental-Result AVP or null if it has not been set on this message
-
setExperimentalResult
void setExperimentalResult(ExperimentalResult experimentalResult)
Sets the value of the Experimental-Result AVP, of type Grouped.- Throws:
NullPointerException
- ifexperimentalResult
isnull
.
-
removeExperimentalResult
void removeExperimentalResult()
Removes the Experimental-Result AVP from the message. If the Experimental-Result AVP is not present, this method returns silently.
-
getProxyInfos
ProxyInfo[] 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(ProxyInfo proxyInfo)
Sets a single Proxy-Info AVP in the message, of type Grouped.- Throws:
NullPointerException
- ifproxyInfo
isnull
.
-
setProxyInfos
void setProxyInfos(ProxyInfo[] 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:
NullPointerException
- ifproxyInfos
isnull
.
-
removeProxyInfos
void removeProxyInfos()
Removes all Proxy-Info AVPs from the message. If no Proxy-Info AVPs are present, this method returns silently.
-
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)NullPointerException
- ifavps
isnull
.
-
removeExtensionAvps
void removeExtensionAvps()
Removes all extension AVPs from the message. If no extension AVPs are present, this method returns silently.
-
-