Interface SessionTerminationAnswer

  • All Superinterfaces:
    Cloneable, DiameterMessage

    public interface SessionTerminationAnswer
    extends DiameterMessage
    Defines an interface representing the Session-Termination-Answer command. From the Diameter Base Protocol (rfc6733.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 it 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 ]
     
    • 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 interface DiameterMessage
        Returns:
        the value of the Session-Id AVP or null if it has not been set on this message
      • removeSessionId

        void removeSessionId()
        Removes the Session-Id AVP from the message. If the Session-Id 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. Use hasResultCode() 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 interface DiameterMessage
        Returns:
        the value of the Origin-Host AVP or null if it has not been set on this message
      • 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 interface DiameterMessage
        Returns:
        the value of the Origin-Realm AVP or null if it has not been set on this message
      • removeOriginRealm

        void removeOriginRealm()
        Removes the Origin-Realm AVP from the message. If the Origin-Realm AVP is not present, this method returns silently.
      • hasUserName

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

        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​(String userName)
        Sets the value of the User-Name AVP, of type UTF8String.
        Throws:
        NullPointerException - if userName is null.
      • removeUserName

        void removeUserName()
        Removes the User-Name AVP from the message. If the User-Name AVP is not present, this method returns silently.
      • 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:
        NullPointerException - if classAvp is null.
      • 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:
        NullPointerException - if classAvps is null.
      • removeClassAvps

        void removeClassAvps()
        Removes all Class AVPs from the message. If no Class AVPs are 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 - if errorMessage is null.
      • 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 - if errorReportingHost is null.
      • 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.
      • 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 - if failedAvp is null.
      • 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 - if failedAvps is null.
      • removeFailedAvps

        void removeFailedAvps()
        Removes all Failed-AVP AVPs from the message. If no Failed-AVP AVPs are 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. Use hasOriginStateId() 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.
      • getRedirectHosts

        DiameterURI[] 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​(DiameterURI redirectHost)
        Sets a single Redirect-Host AVP in the message, of type DiameterURI.
        Throws:
        NullPointerException - if redirectHost is null.
      • setRedirectHosts

        void setRedirectHosts​(DiameterURI[] 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:
        NullPointerException - if redirectHosts is null.
      • removeRedirectHosts

        void removeRedirectHosts()
        Removes all Redirect-Host AVPs from the message. If no Redirect-Host AVPs are present, this method returns silently.
      • hasRedirectHostUsage

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

        RedirectHostUsage 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​(RedirectHostUsage redirectHostUsage)
        Sets the value of the Redirect-Host-Usage AVP, of type Enumerated.
        Throws:
        NullPointerException - if redirectHostUsage is null.
      • removeRedirectHostUsage

        void removeRedirectHostUsage()
        Removes the Redirect-Host-Usage AVP from the message. If the Redirect-Host-Usage AVP is not present, this method returns silently.
      • 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:
        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.
      • removeRedirectMaxCacheTime

        void removeRedirectMaxCacheTime()
        Removes the Redirect-Max-Cache-Time AVP from the message. If the Redirect-Max-Cache-Time 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 - if proxyInfo is null.
      • 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 - if proxyInfos is null.
      • 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 - if avps is null.
      • removeExtensionAvps

        void removeExtensionAvps()
        Removes all extension AVPs from the message. If no extension AVPs are present, this method returns silently.