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 intcommandCode
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetErrorMessage()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.DiameterIdentitygetOriginHost()Returns the value of the Origin-Host AVP, of type DiameterIdentity.DiameterIdentitygetOriginRealm()Returns the value of the Origin-Realm AVP, of type DiameterIdentity.longgetResultCode()Returns the value of the Result-Code AVP, of type Unsigned32.booleanhasErrorMessage()Returns true if the Error-Message AVP is present in the message.booleanhasOriginHost()Returns true if the Origin-Host AVP is present in the message.booleanhasOriginRealm()Returns true if the Origin-Realm AVP is present in the message.booleanhasResultCode()Returns true if the Result-Code AVP is present in the message.voidremoveErrorMessage()Removes the Error-Message AVP from the message.voidremoveExtensionAvps()Removes all extension AVPs from the message.voidremoveFailedAvps()Removes all Failed-AVP AVPs from the message.voidremoveOriginHost()Removes the Origin-Host AVP from the message.voidremoveOriginRealm()Removes the Origin-Realm AVP from the message.voidremoveResultCode()Removes the Result-Code AVP from the message.voidsetErrorMessage(String errorMessage)Sets the value of the Error-Message AVP, of type UTF8String.voidsetExtensionAvps(DiameterAvp[] avps)Sets the set of extension AVPs with all the values in the given array.voidsetFailedAvp(FailedAvp failedAvp)Sets a single Failed-AVP AVP in the message, of type Grouped.voidsetFailedAvps(FailedAvp[] failedAvps)Sets the set of Failed-AVP AVPs, with all the values in the given array.voidsetOriginHost(DiameterIdentity originHost)Sets the value of the Origin-Host AVP, of type DiameterIdentity.voidsetOriginRealm(DiameterIdentity originRealm)Sets the value of the Origin-Realm AVP, of type DiameterIdentity.voidsetResultCode(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:
getOriginHostin 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:
setOriginHostin interfaceDiameterMessage- Throws:
NullPointerException- iforiginHostisnull.
-
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:
getOriginRealmin 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:
setOriginRealmin interfaceDiameterMessage- Throws:
NullPointerException- iforiginRealmisnull.
-
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- iferrorMessageisnull.
-
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- iffailedAvpisnull.
-
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- iffailedAvpsisnull.
-
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- ifavpsisnull.
-
removeExtensionAvps
void removeExtensionAvps()
Removes all extension AVPs from the message. If no extension AVPs are present, this method returns silently.
-
-