Class LimiterInstruction
- java.lang.Object
-
- com.opencloud.javax.sip.slee.overload.LimiterInstruction
-
public final class LimiterInstruction extends Object
Represents an instruction from theSipOverloadControlPluginfor further processing of a request.Every LimiterInstruction has an
LimiterInstruction.Action.A LimiterInstruction with an action of
LimiterInstruction.Action.REJECTcan include an optional SIP response. If the response is non-null, it will be sent by the SIP RA in place of the default overload control response. The SIP RA ignores a response set in a LimiterInstruction with any other action.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLimiterInstruction.ActionRepresents the Action for aLimiterInstruction
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LimiterInstructionaccept()A limiter instruction indicating that the request has been accepted.static LimiterInstructiondiscard()A limiter instruction indicating that the request should be discarded.static LimiterInstructionexempt()A limiter instruction indicating that the request is exempt from overload control.LimiterInstruction.ActiongetAction()The action for further request processing by the SIP RA.javax.sip.message.ResponsegetResponse()The error response to send in the case of aLimiterInstruction.Action.REJECTaction.booleanhasResponse()Determine if this LimiterInstruction contains a response object.booleanisAccept()booleanisDiscard()booleanisExempt()booleanisReject()static LimiterInstructionreject()A limiter instruction indicating that the request should be rejected and the default overload control response be sent.static LimiterInstructionreject(javax.sip.message.Response response)A limiter instruction indicating that the request should be rejected and the specified response be sent.
-
-
-
Method Detail
-
accept
public static LimiterInstruction accept()
A limiter instruction indicating that the request has been accepted.- Returns:
- an instruction with an action of
LimiterInstruction.Action.ACCEPT.
-
exempt
public static LimiterInstruction exempt()
A limiter instruction indicating that the request is exempt from overload control.- Returns:
- an instruction with an action of
LimiterInstruction.Action.EXEMPT.
-
discard
public static LimiterInstruction discard()
A limiter instruction indicating that the request should be discarded.- Returns:
- an instruction with an action of
LimiterInstruction.Action.DISCARD.
-
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.REJECTand null response.
-
reject
public static LimiterInstruction reject(javax.sip.message.Response 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.REJECTand the specified response.
-
getResponse
public javax.sip.message.Response getResponse()
The error response to send in the case of aLimiterInstruction.Action.REJECTaction. 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 SIP RA.- Returns:
- the action for how the SIP RA should further process the request.
-
isAccept
public boolean isAccept()
-
isExempt
public boolean isExempt()
-
isReject
public boolean isReject()
-
isDiscard
public boolean isDiscard()
-
-