Class LimiterInstruction


  • public final class LimiterInstruction
    extends Object
    Represents an instruction from the SipOverloadControlPlugin for further processing of a request.

    Every LimiterInstruction has an LimiterInstruction.Action.

    A LimiterInstruction with an action of LimiterInstruction.Action.REJECT can include an optional SIP response. If the response is non-null, it will be sent by the SIS in place of the default overload control response. SIS ignores a response set in a LimiterInstruction with any other action.

    • Method Detail

      • reject

        public static LimiterInstruction reject()
        A limiter instruction indicating that the request should be rejected and the default overload control response be sent.
        Returns:
        an instruction with an action of LimiterInstruction.Action.REJECT and null response.
      • reject

        public static LimiterInstruction reject​(SipResponse response)
        A limiter instruction indicating that the request should be rejected and the specified response be sent. The response is expected to be an error response, i.e. have a 4xx, 5xx, or 6xx response code.
        Parameters:
        response - the response object. May be null.
        Returns:
        an instruction with an action of LimiterInstruction.Action.REJECT and the specified response.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getResponse

        public SipResponse getResponse()
        The error response to send in the case of a LimiterInstruction.Action.REJECT action. The response is ignored for any other action.
        Returns:
        the SIP response, or null if a response has not been set.
      • hasResponse

        public boolean hasResponse()
        Determine if this LimiterInstruction contains a response object.
        Returns:
        true if a response object is present, false otherwise.
      • getAction

        public LimiterInstruction.Action getAction()
        The action for further request processing by the SIS.
        Returns:
        the action for how the SIS should further process the request.