Class LimiterInstruction
- java.lang.Object
-
- com.opencloud.javax.sip.slee.overload.LimiterInstruction
-
public final class LimiterInstruction extends Object
Represents an instruction from theSipOverloadControlPlugin
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 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 class
LimiterInstruction.Action
Represents the Action for aLimiterInstruction
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LimiterInstruction
accept()
A limiter instruction indicating that the request has been accepted.static LimiterInstruction
discard()
A limiter instruction indicating that the request should be discarded.static LimiterInstruction
exempt()
A limiter instruction indicating that the request is exempt from overload control.LimiterInstruction.Action
getAction()
The action for further request processing by the SIP RA.javax.sip.message.Response
getResponse()
The error response to send in the case of aLimiterInstruction.Action.REJECT
action.boolean
hasResponse()
Determine if this LimiterInstruction contains a response object.boolean
isAccept()
boolean
isDiscard()
boolean
isExempt()
boolean
isReject()
static LimiterInstruction
reject()
A limiter instruction indicating that the request should be rejected and the default overload control response be sent.static LimiterInstruction
reject(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.REJECT
and 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.REJECT
and the specified response.
-
getResponse
public javax.sip.message.Response getResponse()
The error response to send in the case of aLimiterInstruction.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 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()
-
-