Interface DisconnectPeerAnswer
-
- All Superinterfaces:
Cloneable
,DiameterMessage
public interface DisconnectPeerAnswer extends DiameterMessage
Defines an interface representing the Disconnect-Peer-Answer command. From the Diameter Base Protocol (rfc6733.txt) specification:5.4.2. Disconnect-Peer-Answer The Disconnect-Peer-Answer (DPA), indicated by the Command Code set to 282 and the Command Flags' 'R' bit cleared, is sent as a response to the Disconnect-Peer-Request message. Upon receipt of this message, the transport connection is shut down. Message Format <Disconnect-Peer-Answer> ::= < Diameter Header: 282 > { Result-Code } { Origin-Host } { Origin-Realm } [ Error-Message ] * [ Failed-AVP ] * [ AVP ]
-
-
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.DiameterAvp[]
getExtensionAvps()
Returns the set of extension AVPs.FailedAvp[]
getFailedAvps()
Returns the set of Failed-AVP AVPs.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
getResultCode()
Returns the value of the Result-Code AVP, of type Unsigned32.boolean
hasErrorMessage()
Returns true if the Error-Message 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
hasResultCode()
Returns true if the Result-Code AVP is present in the message.void
removeErrorMessage()
Removes the Error-Message AVP from the message.void
removeExtensionAvps()
Removes all extension AVPs from the message.void
removeFailedAvps()
Removes all Failed-AVP AVPs from the message.void
removeOriginHost()
Removes the Origin-Host AVP from the message.void
removeOriginRealm()
Removes the Origin-Realm AVP from the message.void
removeResultCode()
Removes the Result-Code AVP from the message.void
setErrorMessage(String errorMessage)
Sets the value of the Error-Message AVP, of type UTF8String.void
setExtensionAvps(DiameterAvp[] avps)
Sets the set of extension AVPs with all the values in the given array.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
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
setResultCode(long resultCode)
Sets the value of the Result-Code AVP, of type Unsigned32.-
Methods inherited from interface org.jainslee.resources.diameter.base.DiameterMessage
clone, getAvps, getCommand, getDestinationHost, getDestinationRealm, getHeader, getSessionId, setDestinationHost, setDestinationRealm, 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. 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.
-
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.
-
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.
-
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:
NullPointerException
- iffailedAvp
isnull
.
-
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:
NullPointerException
- iffailedAvps
isnull
.
-
removeFailedAvps
void removeFailedAvps()
Removes all Failed-AVP AVPs from the message. If no Failed-AVP 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.
-
-