Package org.forgerock.openig.filter
Class AssignmentFilter
- java.lang.Object
-
- org.forgerock.openig.filter.AssignmentFilter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AssignmentFilter.Heaplet
Creates and initializes an assignment filter in a heap environment.
-
Constructor Summary
Constructors Constructor Description AssignmentFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
addRequestBinding
public AssignmentFilter addRequestBinding(LeftValueExpression<?> target)
Registers an unconditional (always executed) binding on the request flow. The value stored in the target will be null.- Parameters:
target
- Expression that yields the target object whose value is to be set- Returns:
- this object for fluent usage
-
addRequestBinding
public AssignmentFilter addRequestBinding(LeftValueExpression<?> target, Expression<?> value)
Registers an unconditional (always executed) binding on the request flow. The value stored in the target will be the result of the valueExpression
.- Parameters:
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)- Returns:
- this object for fluent usage
-
addRequestBinding
public AssignmentFilter addRequestBinding(Expression<Boolean> condition, LeftValueExpression<?> target, Expression<?> value)
Registers a conditional binding on the request flow. If the condition is fulfilled, the value stored in the target will be the result of the valueExpression
.- Parameters:
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)- Returns:
- this object for fluent usage
-
addResponseBinding
public AssignmentFilter addResponseBinding(LeftValueExpression<?> target)
Registers an unconditional (always executed) binding on the response flow. The value stored in the target will be null.- Parameters:
target
- Expression that yields the target object whose value is to be set- Returns:
- this object for fluent usage
-
addResponseBinding
public AssignmentFilter addResponseBinding(LeftValueExpression<?> target, Expression<?> value)
Registers an unconditional (always executed) binding on the response flow. The value stored in the target will be the result of the valueExpression
.- Parameters:
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)- Returns:
- this object for fluent usage
-
addResponseBinding
public AssignmentFilter addResponseBinding(Expression<Boolean> condition, LeftValueExpression<?> target, Expression<?> value)
Registers a conditional binding on the response flow. If the condition is fulfilled, the value stored in the target will be the result of the valueExpression
.- Parameters:
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)- Returns:
- this object for fluent usage
-
filter
public Promise<Response,NeverThrowsException> filter(Context context, Request request, Handler next)
Description copied from interface:Filter
Filters the request and/or response of an exchange. To pass the request to the next filter or handler in the chain, the filter callsnext.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.
-
-