Interface LimitAlgorithm.Outcome
- All Known Subinterfaces:
LimitAlgorithm.Outcome.Accepted
,LimitAlgorithm.Outcome.Deferred
- Enclosing interface:
LimitAlgorithm
public static interface LimitAlgorithm.Outcome
Represents the outcome of a limit algorithm decision.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Behavior of anLimitAlgorithm.Outcome
representing an accepted work item.static interface
Behavior of anLimitAlgorithm.Outcome
representing a deferred decision.static enum
Disposition of the work item.static enum
When the algorithm made its decision relative to the moment when it was asked about a particular work item. -
Method Summary
Modifier and TypeMethodDescriptionName of the limit algorithm which decided whether to allow or prevent processing of the work item.static LimitAlgorithm.Outcome
deferredAcceptance
(String originName, String algorithmType, LimitAlgorithm.Token token, long waitStartNanos, long waitEndNanos) Creates a newLimitAlgorithm.Outcome
representing a deferred acceptance of a work item.static LimitAlgorithm.Outcome
deferredRejection
(String originName, String algorithmType, long waitStartNanos, long waitEndNanos) Creates a newLimitAlgorithm.Outcome
representing a deferred rejection of a work item.TheLimitAlgorithm.Outcome.Disposition
of the work item.static LimitAlgorithm.Outcome
immediateAcceptance
(String originName, String algorithmType, LimitAlgorithm.Token token) Creates a newLimitAlgorithm.Outcome
representing an immediate acceptance of a work item.static LimitAlgorithm.Outcome
immediateRejection
(String originName, String algorithmType) Creates a newLimitAlgorithm.Outcome
representing an immediate rejection of a work item.Origin (e.g., socket name) of the work item.timing()
TheLimitAlgorithm.Outcome.Timing
of the decision about the work item.
-
Method Details
-
immediateAcceptance
static LimitAlgorithm.Outcome immediateAcceptance(String originName, String algorithmType, LimitAlgorithm.Token token) Creates a newLimitAlgorithm.Outcome
representing an immediate acceptance of a work item.- Parameters:
originName
- origin namealgorithmType
- algorithm typetoken
-LimitAlgorithm.Token
- Returns:
- immediate acceptance outcome
-
deferredAcceptance
static LimitAlgorithm.Outcome deferredAcceptance(String originName, String algorithmType, LimitAlgorithm.Token token, long waitStartNanos, long waitEndNanos) Creates a newLimitAlgorithm.Outcome
representing a deferred acceptance of a work item.- Parameters:
originName
- origin namealgorithmType
- algorithm typetoken
-LimitAlgorithm.Token
waitStartNanos
- start time of the wait for the decisionwaitEndNanos
- end time of the wait for the decision- Returns:
- deferred acceptance outcome
-
immediateRejection
Creates a newLimitAlgorithm.Outcome
representing an immediate rejection of a work item. }- Parameters:
originName
- origin namealgorithmType
- algorithm type- Returns:
- immediate rejection outcome
-
deferredRejection
static LimitAlgorithm.Outcome deferredRejection(String originName, String algorithmType, long waitStartNanos, long waitEndNanos) Creates a newLimitAlgorithm.Outcome
representing a deferred rejection of a work item.- Parameters:
originName
- origin namealgorithmType
- algorithm typewaitStartNanos
- start time of the wait for the decisionwaitEndNanos
- end time of the wait for the decision- Returns:
- deferred rejection outcome
-
originName
String originName()Origin (e.g., socket name) of the work item.- Returns:
- origin
-
algorithmType
String algorithmType()Name of the limit algorithm which decided whether to allow or prevent processing of the work item.- Returns:
- algorithm name
-
disposition
LimitAlgorithm.Outcome.Disposition disposition()TheLimitAlgorithm.Outcome.Disposition
of the work item.- Returns:
- disposition
-
timing
LimitAlgorithm.Outcome.Timing timing()TheLimitAlgorithm.Outcome.Timing
of the decision about the work item.- Returns:
- timing of the decision
-