public class TypedProtocolOpFilter extends Object implements RequestFilter
RequestFilter
s whose behavior depends on the type of Request
and
Response
.
It is possible to provides specific behavior for different request types by selectively overriding the filter*()
methods. Common behaviour can be added for the remaining request types by overriding the
filterAny(Context, Request, RequestHandler)
and filterAnyResponse(Context, Request, Response)
methods.
TypedRequestFilter
,
RequestFilter
Constructor and Description |
---|
TypedProtocolOpFilter() |
Modifier and Type | Method and Description |
---|---|
Flowable<Response> |
filter(org.forgerock.services.context.Context context,
Request request,
RequestHandler next)
Filters the request and/or response of an exchange.
|
protected Flowable<Response> |
filterAbandon(org.forgerock.services.context.Context context,
AbandonRequest request,
RequestHandler next)
Forwards the request to the next handler in the chain.
|
protected void |
filterAbandonResponse(org.forgerock.services.context.Context context,
AbandonRequest request,
Response response)
Implements the behavior for all the responses of an AbandonRequest.
|
protected Flowable<Response> |
filterAdd(org.forgerock.services.context.Context context,
AddRequest request,
RequestHandler next)
Forwards the request to the next handler in the chain.
|
protected void |
filterAddResponse(org.forgerock.services.context.Context context,
AddRequest request,
Response response)
Implements the behavior for all the responses of an AddRequest.
|
protected Flowable<Response> |
filterAny(org.forgerock.services.context.Context context,
Request request,
RequestHandler next)
Forwards the request to the next handler in the chain.
|
protected void |
filterAnyResponse(org.forgerock.services.context.Context context,
Request request,
Response response)
Implements the common behavior for all the responses for which no specific behavior has been specified by an
overridden observe*Response() like method.
|
protected Flowable<Response> |
filterBind(org.forgerock.services.context.Context context,
BindRequest request,
RequestHandler next)
Forwards the request to the next handler in the chain.
|
protected void |
filterBindResponse(org.forgerock.services.context.Context context,
BindRequest request,
Response response)
Implements the behavior for all the responses of a BindRequest.
|
protected Flowable<Response> |
filterCompare(org.forgerock.services.context.Context context,
CompareRequest request,
RequestHandler next)
Forwards the request to the next handler in the chain.
|
protected void |
filterCompareResponse(org.forgerock.services.context.Context context,
CompareRequest request,
Response response)
Implements the behavior for all the responses of a CompareRequest.
|
protected Flowable<Response> |
filterDelete(org.forgerock.services.context.Context context,
DeleteRequest request,
RequestHandler next)
Forwards the request to the next handler in the chain.
|
protected void |
filterDeleteResponse(org.forgerock.services.context.Context context,
DeleteRequest request,
Response response)
Implements the behavior for all the responses of a DeleteRequest.
|
protected Flowable<Response> |
filterExtended(org.forgerock.services.context.Context context,
ExtendedRequest<?> request,
RequestHandler next)
Forwards the request to the next handler in the chain.
|
protected void |
filterExtendedResponse(org.forgerock.services.context.Context context,
ExtendedRequest<?> request,
Response response)
Implements the behavior for all the responses of a ExtendedRequest.
|
protected Flowable<Response> |
filterInvalid(org.forgerock.services.context.Context context,
InvalidRequest request,
RequestHandler next)
Forwards the request to the next handler in the chain.
|
protected void |
filterInvalidResponse(org.forgerock.services.context.Context context,
InvalidRequest request,
Response response)
Implements the behavior for all the responses of an InvalidRequest.
|
protected Flowable<Response> |
filterModify(org.forgerock.services.context.Context context,
ModifyRequest request,
RequestHandler next)
Forwards the request to the next handler in the chain.
|
protected Flowable<Response> |
filterModifyDn(org.forgerock.services.context.Context context,
ModifyDnRequest request,
RequestHandler next)
Forwards the request to the next handler in the chain.
|
protected void |
filterModifyDnResponse(org.forgerock.services.context.Context context,
ModifyDnRequest request,
Response response)
Implements the behavior for all the responses of a ModifyDnRequest.
|
protected void |
filterModifyResponse(org.forgerock.services.context.Context context,
ModifyRequest request,
Response response)
Implements the behavior for all the responses of a ModifyRequest.
|
protected Flowable<Response> |
filterSearch(org.forgerock.services.context.Context context,
SearchRequest request,
RequestHandler next)
Forwards the request to the next handler in the chain.
|
protected boolean |
filterSearchResponse(org.forgerock.services.context.Context context,
SearchRequest request,
Response response)
Implements the behavior for all the responses of a SearchRequest.
|
protected Flowable<Response> |
filterUnbind(org.forgerock.services.context.Context context,
UnbindRequest request,
RequestHandler next)
Forwards the request to the next handler in the chain.
|
protected Flowable<Response> |
filterUnknown(org.forgerock.services.context.Context context,
UnknownRequest request,
RequestHandler next)
Forwards the request to the next handler in the chain.
|
protected void |
filterUnknownResponse(org.forgerock.services.context.Context context,
UnknownRequest request,
Response response)
Implements the behavior for all the responses of an UnknownRequest.
|
public final Flowable<Response> filter(org.forgerock.services.context.Context context, Request request, RequestHandler next) throws Exception
RequestFilter
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.
filter
in interface RequestFilter
context
- The request context.request
- The request.next
- The next filter or handler in the chain to handle the request.Flowable
representing the response to be returned to the client.Exception
- If an error occurred during the processing of the request.protected Flowable<Response> filterAny(org.forgerock.services.context.Context context, Request request, RequestHandler next) throws Exception
protected void filterAnyResponse(org.forgerock.services.context.Context context, Request request, Response response) throws Exception
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.Exception
- If an error occurred during the processing of the response.protected Flowable<Response> filterAbandon(org.forgerock.services.context.Context context, AbandonRequest request, RequestHandler next) throws Exception
protected void filterAbandonResponse(org.forgerock.services.context.Context context, AbandonRequest request, Response response) throws Exception
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.Exception
- If an error occurred during the processing of the response.protected Flowable<Response> filterAdd(org.forgerock.services.context.Context context, AddRequest request, RequestHandler next) throws Exception
protected void filterAddResponse(org.forgerock.services.context.Context context, AddRequest request, Response response) throws Exception
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.Exception
- If an error occurred during the processing of the response.protected Flowable<Response> filterBind(org.forgerock.services.context.Context context, BindRequest request, RequestHandler next) throws Exception
protected void filterBindResponse(org.forgerock.services.context.Context context, BindRequest request, Response response) throws Exception
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.Exception
- If an error occurred during the processing of the response.protected Flowable<Response> filterCompare(org.forgerock.services.context.Context context, CompareRequest request, RequestHandler next) throws Exception
protected void filterCompareResponse(org.forgerock.services.context.Context context, CompareRequest request, Response response) throws Exception
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.Exception
- If an error occurred during the processing of the response.protected Flowable<Response> filterDelete(org.forgerock.services.context.Context context, DeleteRequest request, RequestHandler next) throws Exception
protected void filterDeleteResponse(org.forgerock.services.context.Context context, DeleteRequest request, Response response) throws Exception
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.Exception
- If an error occurred during the processing of the response.protected Flowable<Response> filterExtended(org.forgerock.services.context.Context context, ExtendedRequest<?> request, RequestHandler next) throws Exception
protected void filterExtendedResponse(org.forgerock.services.context.Context context, ExtendedRequest<?> request, Response response) throws Exception
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.Exception
- If an error occurred during the processing of the response.protected Flowable<Response> filterInvalid(org.forgerock.services.context.Context context, InvalidRequest request, RequestHandler next) throws Exception
protected void filterInvalidResponse(org.forgerock.services.context.Context context, InvalidRequest request, Response response) throws Exception
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.Exception
- If an error occurred during the processing of the response.protected Flowable<Response> filterSearch(org.forgerock.services.context.Context context, SearchRequest request, RequestHandler next) throws Exception
protected boolean filterSearchResponse(org.forgerock.services.context.Context context, SearchRequest request, Response response) throws Exception
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.true
to allow the message passes the filter, false
to drop it.Exception
- If an error occurred during the processing of the response.protected Flowable<Response> filterModify(org.forgerock.services.context.Context context, ModifyRequest request, RequestHandler next) throws Exception
protected void filterModifyResponse(org.forgerock.services.context.Context context, ModifyRequest request, Response response) throws Exception
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.Exception
- If an error occurred during the processing of the response.protected Flowable<Response> filterModifyDn(org.forgerock.services.context.Context context, ModifyDnRequest request, RequestHandler next) throws Exception
protected void filterModifyDnResponse(org.forgerock.services.context.Context context, ModifyDnRequest request, Response response) throws Exception
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.Exception
- If an error occurred during the processing of the response.protected Flowable<Response> filterUnbind(org.forgerock.services.context.Context context, UnbindRequest request, RequestHandler next) throws Exception
protected Flowable<Response> filterUnknown(org.forgerock.services.context.Context context, UnknownRequest request, RequestHandler next) throws Exception
protected void filterUnknownResponse(org.forgerock.services.context.Context context, UnknownRequest request, Response response) throws Exception
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.Exception
- If an error occurred during the processing of the response.Copyright 2010-2018 ForgeRock AS.