Package org.forgerock.openig.filter
Class AssignmentFilter
- java.lang.Object
-
- org.forgerock.openig.filter.AssignmentFilter
-
- All Implemented Interfaces:
org.forgerock.http.Filter
public class AssignmentFilter extends Object implements org.forgerock.http.Filter
Conditionally assigns values to expressions before and after the request is handled.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAssignmentFilter.HeapletCreates 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 AssignmentFilteraddRequestBinding(Expression<Boolean> condition, LeftValueExpression<?> target, Expression<?> value)Registers a conditional binding on the request flow.AssignmentFilteraddRequestBinding(LeftValueExpression<?> target)Registers an unconditional (always executed) binding on the request flow.AssignmentFilteraddRequestBinding(LeftValueExpression<?> target, Expression<?> value)Registers an unconditional (always executed) binding on the request flow.AssignmentFilteraddResponseBinding(Expression<Boolean> condition, LeftValueExpression<?> target, Expression<?> value)Registers a conditional binding on the response flow.AssignmentFilteraddResponseBinding(LeftValueExpression<?> target)Registers an unconditional (always executed) binding on the response flow.AssignmentFilteraddResponseBinding(LeftValueExpression<?> target, Expression<?> value)Registers an unconditional (always executed) binding on the response flow.org.forgerock.util.promise.Promise<org.forgerock.http.protocol.Response,org.forgerock.util.promise.NeverThrowsException>filter(org.forgerock.services.context.Context context, org.forgerock.http.protocol.Request request, org.forgerock.http.Handler next)
-
-
-
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 org.forgerock.util.promise.Promise<org.forgerock.http.protocol.Response,org.forgerock.util.promise.NeverThrowsException> filter(org.forgerock.services.context.Context context, org.forgerock.http.protocol.Request request, org.forgerock.http.Handler next)- Specified by:
filterin interfaceorg.forgerock.http.Filter
-
-