Class AbstractHandlerAndFilterDecorator

    • Constructor Detail

      • AbstractHandlerAndFilterDecorator

        protected AbstractHandlerAndFilterDecorator​(String name)
        Forces to give the name of the decorator.
        Parameters:
        name - The name of the decorator.
    • Method Detail

      • accepts

        public boolean accepts​(Class<?> type)
        Description copied from interface: Decorator
        Returns true if this decorator is compatible with the provided component type. Note that a return value of true does not necessarily indicate that decoration will be performed since it may also depend on other factors
        Parameters:
        type - type under test
        Returns:
        true if the decorator can decorate instance of the given type, false otherwise.
      • decorate

        public Object decorate​(Object delegate,
                               org.forgerock.json.JsonValue decoratorConfig,
                               Context context)
                        throws HeapException
        Description copied from interface: Decorator
        Decorates the provided delegate instance with the provided decoratorConfig configuration. The implementation should take care of not changing the base type of the delegate.
        Parameters:
        delegate - instance to be decorated
        decoratorConfig - the decorator configuration to apply
        context - contextual information of the decorated instance
        Returns:
        a decorated instance (or original delegate)
        Throws:
        HeapException - when decoration fails
      • decorateFilter

        protected abstract org.forgerock.http.Filter decorateFilter​(org.forgerock.http.Filter delegate,
                                                                    org.forgerock.json.JsonValue decoratorConfig,
                                                                    Context context)
                                                             throws HeapException
        Decorates the provided delegate Filter instance with the provided decoratorConfig configuration.
        Parameters:
        delegate - Filter instance to be decorated
        decoratorConfig - the decorator configuration to apply
        context - contextual information of the decorated instance
        Returns:
        a decorated filter instance (or original filter delegate)
        Throws:
        HeapException - when decoration fails
      • decorateHandler

        protected abstract org.forgerock.http.Handler decorateHandler​(org.forgerock.http.Handler delegate,
                                                                      org.forgerock.json.JsonValue decoratorConfig,
                                                                      Context context)
                                                               throws HeapException
        Decorates the provided delegate Handler instance with the provided decoratorConfig configuration.
        Parameters:
        delegate - Handler instance to be decorated
        decoratorConfig - the decorator configuration to apply
        context - contextual information of the decorated instance
        Returns:
        a decorated handler instance (or original handler delegate)
        Throws:
        HeapException - when decoration fails