Class TypedProtocolOpFilter

    • Constructor Detail

      • TypedProtocolOpFilter

        public TypedProtocolOpFilter()
    • 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 calls 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.

        Specified by:
        filter in interface RequestFilter
        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.
        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.
      • 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.
        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.
      • 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.
        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.
      • 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.
        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.
      • 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.
        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.
      • 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.
        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.
      • 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.
        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.
      • 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.
        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.
      • 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.
        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.
      • 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.
        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.
      • 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.
        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.
      • 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.
        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.
      • 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.
        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.
      • 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.