Package org.forgerock.openig.filter
Class SwitchFilter
java.lang.Object
org.forgerock.openig.filter.SwitchFilter
- All Implemented Interfaces:
Filter
Conditionally diverts the request to another handler. Before and after the request is
handled, associated conditions are evaluated. If a condition evaluates to
true, then
the processing flow is diverted to the associated handler. If no condition evaluates to
true, then the request flows normally through the filter.
Typical behaviours:
- If a request case yields, only that handler's case is invoked (no next nor response case)
- If no request case yields, then next handler will be invoked, and maybe a response case will handle it too
- If neither request nor response case yield, only the next handler is invoked
This filter preserves the filtered request for the response binding.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCreates and initializes a switch filter in a heap environment. -
Method Summary
-
Method Details
-
filter
public Promise<Response,NeverThrowsException> filter(Context context, Request request, Handler next) Description copied from interface:FilterFilters 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.
-