Class 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.
    • Constructor Detail

      • AssignmentFilter

        public AssignmentFilter()
    • 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 value Expression.
        Parameters:
        target - Expression that yields the target object whose value is to be set
        value - 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 value Expression.
        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 set
        value - 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 value Expression.
        Parameters:
        target - Expression that yields the target object whose value is to be set
        value - 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 value Expression.
        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 set
        value - 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:
        filter in interface org.forgerock.http.Filter