public class AssignmentFilter extends Object implements Filter
Modifier and Type | Class and Description |
---|---|
static class |
AssignmentFilter.Heaplet
Creates and initializes an assignment filter in a heap environment.
|
Constructor and Description |
---|
AssignmentFilter() |
Modifier and Type | Method and Description |
---|---|
AssignmentFilter |
addRequestBinding(Expression<Boolean> condition,
LeftValueExpression<?> target,
Expression<?> value)
Registers a conditional binding on the request flow.
|
AssignmentFilter |
addRequestBinding(LeftValueExpression<?> target)
Registers an unconditional (always executed) binding on the request flow.
|
AssignmentFilter |
addRequestBinding(LeftValueExpression<?> target,
Expression<?> value)
Registers an unconditional (always executed) binding on the request flow.
|
AssignmentFilter |
addResponseBinding(Expression<Boolean> condition,
LeftValueExpression<?> target,
Expression<?> value)
Registers a conditional binding on the response flow.
|
AssignmentFilter |
addResponseBinding(LeftValueExpression<?> target)
Registers an unconditional (always executed) binding on the response flow.
|
AssignmentFilter |
addResponseBinding(LeftValueExpression<?> target,
Expression<?> value)
Registers an unconditional (always executed) binding on the response flow.
|
Promise<Response,NeverThrowsException> |
filter(Context context,
Request request,
Handler next)
Filters the request and/or response of an exchange.
|
public AssignmentFilter()
public AssignmentFilter addRequestBinding(LeftValueExpression<?> target)
target
- Expression that yields the target object whose value is to be setpublic AssignmentFilter addRequestBinding(LeftValueExpression<?> target, Expression<?> value)
Expression
.target
- Expression that yields the target object whose value is to be setvalue
- Expression that yields the value to be set in the target (may be null)public AssignmentFilter addRequestBinding(Expression<Boolean> condition, LeftValueExpression<?> target, Expression<?> value)
Expression
.condition
- Condition to evaluate to determine if assignment should occur (may be null, aka
unconditional)target
- Expression that yields the target object whose value is to be setvalue
- Expression that yields the value to be set in the target (may be null)public AssignmentFilter addResponseBinding(LeftValueExpression<?> target)
target
- Expression that yields the target object whose value is to be setpublic AssignmentFilter addResponseBinding(LeftValueExpression<?> target, Expression<?> value)
Expression
.target
- Expression that yields the target object whose value is to be setvalue
- Expression that yields the value to be set in the target (may be null)public AssignmentFilter addResponseBinding(Expression<Boolean> condition, LeftValueExpression<?> target, Expression<?> value)
Expression
.condition
- Condition to evaluate to determine if assignment should occur (may be null, aka
unconditional)target
- Expression that yields the target object whose value is to be setvalue
- Expression that yields the value to be set in the target (may be null)public Promise<Response,NeverThrowsException> filter(Context context, Request request, Handler next)
Filter
next.handle(context, request)
.
This method may elect not to pass the request to the next filter or
handler, and instead handle the request itself. It can achieve this by
merely avoiding a call to next.handle(context, request)
and creating its own response object. The filter is also at liberty to
replace a response with another of its own by intercepting the response
returned by the next handler.
Copyright 2011-2015 ForgeRock AS.