Package org.opends.server.api
Class TypedProtocolOpFilter
- java.lang.Object
-
- org.opends.server.api.TypedProtocolOpFilter
-
- All Implemented Interfaces:
RequestFilter
public class TypedProtocolOpFilter extends Object implements RequestFilter
Base class for implementingRequestFilter
s whose behavior depends on the type ofRequest
andResponse
.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)
andfilterAnyResponse(Context, Request, Response)
methods.- See Also:
TypedRequestFilter
,RequestFilter
-
-
Constructor Summary
Constructors Constructor Description TypedProtocolOpFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
filter
public final Flowable<Response> filter(org.forgerock.services.context.Context context, Request request, RequestHandler next) throws Exception
Description copied from interface:RequestFilter
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.- Specified by:
filter
in interfaceRequestFilter
- Parameters:
context
- The request context.request
- The request.next
- The next filter or handler in the chain to handle the request.- Returns:
- A
Flowable
representing the response to be returned to the client. - Throws:
Exception
- If an error occurred during the processing of the request.
-
filterAny
protected Flowable<Response> filterAny(org.forgerock.services.context.Context context, Request request, RequestHandler next) throws Exception
Forwards the request to the next handler in the chain. This method could be overridden to provides a common behavior for all the request types.
-
filterAnyResponse
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.- Parameters:
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.
-
filterAbandon
protected Flowable<Response> filterAbandon(org.forgerock.services.context.Context context, AbandonRequest request, RequestHandler next) throws Exception
Forwards the request to the next handler in the chain. This method could be overridden to provides a specific behavior for AbandonRequest.
-
filterAbandonResponse
protected void filterAbandonResponse(org.forgerock.services.context.Context context, AbandonRequest request, Response response) throws Exception
Implements the behavior for all the responses of an AbandonRequest.- Parameters:
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.- Throws:
Exception
- If an error occurred during the processing of the response.
-
filterAdd
protected Flowable<Response> filterAdd(org.forgerock.services.context.Context context, AddRequest request, RequestHandler next) throws Exception
Forwards the request to the next handler in the chain. This method could be overridden to provides a specific behavior for AddRequest.
-
filterAddResponse
protected void filterAddResponse(org.forgerock.services.context.Context context, AddRequest request, Response response) throws Exception
Implements the behavior for all the responses of an AddRequest.- Parameters:
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.- Throws:
Exception
- If an error occurred during the processing of the response.
-
filterBind
protected Flowable<Response> filterBind(org.forgerock.services.context.Context context, BindRequest request, RequestHandler next) throws Exception
Forwards the request to the next handler in the chain. This method could be overridden to provides a specific behavior for BindRequest.
-
filterBindResponse
protected void filterBindResponse(org.forgerock.services.context.Context context, BindRequest request, Response response) throws Exception
Implements the behavior for all the responses of a BindRequest.- Parameters:
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.- Throws:
Exception
- If an error occurred during the processing of the response.
-
filterCompare
protected Flowable<Response> filterCompare(org.forgerock.services.context.Context context, CompareRequest request, RequestHandler next) throws Exception
Forwards the request to the next handler in the chain. This method could be overridden to provides a specific behavior for CompareRequest.
-
filterCompareResponse
protected void filterCompareResponse(org.forgerock.services.context.Context context, CompareRequest request, Response response) throws Exception
Implements the behavior for all the responses of a CompareRequest.- Parameters:
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.- Throws:
Exception
- If an error occurred during the processing of the response.
-
filterDelete
protected Flowable<Response> filterDelete(org.forgerock.services.context.Context context, DeleteRequest request, RequestHandler next) throws Exception
Forwards the request to the next handler in the chain. This method could be overridden to provides a specific behavior for DeleteRequest.
-
filterDeleteResponse
protected void filterDeleteResponse(org.forgerock.services.context.Context context, DeleteRequest request, Response response) throws Exception
Implements the behavior for all the responses of a DeleteRequest.- Parameters:
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.- Throws:
Exception
- If an error occurred during the processing of the response.
-
filterExtended
protected Flowable<Response> filterExtended(org.forgerock.services.context.Context context, ExtendedRequest<?> request, RequestHandler next) throws Exception
Forwards the request to the next handler in the chain. This method could be overridden to provides a specific behavior for ExtendedRequest.
-
filterExtendedResponse
protected void filterExtendedResponse(org.forgerock.services.context.Context context, ExtendedRequest<?> request, Response response) throws Exception
Implements the behavior for all the responses of a ExtendedRequest.- Parameters:
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.- Throws:
Exception
- If an error occurred during the processing of the response.
-
filterInvalid
protected Flowable<Response> filterInvalid(org.forgerock.services.context.Context context, InvalidRequest request, RequestHandler next) throws Exception
Forwards the request to the next handler in the chain. This method could be overridden to provides a specific behavior for InvalidRequest.
-
filterInvalidResponse
protected void filterInvalidResponse(org.forgerock.services.context.Context context, InvalidRequest request, Response response) throws Exception
Implements the behavior for all the responses of an InvalidRequest.- Parameters:
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.- Throws:
Exception
- If an error occurred during the processing of the response.
-
filterSearch
protected Flowable<Response> filterSearch(org.forgerock.services.context.Context context, SearchRequest request, RequestHandler next) throws Exception
Forwards the request to the next handler in the chain. This method could be overridden to provides a specific behavior for SearchRequest.
-
filterSearchResponse
protected boolean filterSearchResponse(org.forgerock.services.context.Context context, SearchRequest request, Response response) throws Exception
Implements the behavior for all the responses of a SearchRequest.- Parameters:
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.- Returns:
true
to allow the message passes the filter,false
to drop it.- Throws:
Exception
- If an error occurred during the processing of the response.
-
filterModify
protected Flowable<Response> filterModify(org.forgerock.services.context.Context context, ModifyRequest request, RequestHandler next) throws Exception
Forwards the request to the next handler in the chain. This method could be overridden to provides a specific behavior for ModifyRequest.
-
filterModifyResponse
protected void filterModifyResponse(org.forgerock.services.context.Context context, ModifyRequest request, Response response) throws Exception
Implements the behavior for all the responses of a ModifyRequest.- Parameters:
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.- Throws:
Exception
- If an error occurred during the processing of the response.
-
filterModifyDn
protected Flowable<Response> filterModifyDn(org.forgerock.services.context.Context context, ModifyDnRequest request, RequestHandler next) throws Exception
Forwards the request to the next handler in the chain. This method could be overridden to provides a specific behavior for ModifyDnRequest.
-
filterModifyDnResponse
protected void filterModifyDnResponse(org.forgerock.services.context.Context context, ModifyDnRequest request, Response response) throws Exception
Implements the behavior for all the responses of a ModifyDnRequest.- Parameters:
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.- Throws:
Exception
- If an error occurred during the processing of the response.
-
filterUnbind
protected Flowable<Response> filterUnbind(org.forgerock.services.context.Context context, UnbindRequest request, RequestHandler next) throws Exception
Forwards the request to the next handler in the chain. This method could be overridden to provides a specific behavior for UnbindRequest.
-
filterUnknown
protected Flowable<Response> filterUnknown(org.forgerock.services.context.Context context, UnknownRequest request, RequestHandler next) throws Exception
Forwards the request to the next handler in the chain. This method could be overridden to provides a specific behavior for UnknownRequest.
-
filterUnknownResponse
protected void filterUnknownResponse(org.forgerock.services.context.Context context, UnknownRequest request, Response response) throws Exception
Implements the behavior for all the responses of an UnknownRequest.- Parameters:
context
- The request context.request
- The request associated to the response.response
- The response which has been created by the RequestHandler.- Throws:
Exception
- If an error occurred during the processing of the response.
-
-