Class BaseUriDecorator

  • All Implemented Interfaces:
    Decorator

    public class BaseUriDecorator
    extends AbstractHandlerAndFilterDecorator
    The baseURI decorator can decorate both Filter and Handler instances.

    It has to be declared inside of the heap objects section:

         
         {
           "name": "myBaseUri",
           "type": "BaseUriDecorator"
         }
         
     
    To decorate a component, just add the decorator declaration next to the config element:
         
         {
           "type": "...",
           "myBaseUri": "http://www.example.com",
           "config": { ... }
         }
         
     

    The baseURI has to be a string otherwise, the decoration will be ignored.

    N.B: The Gateway Servlet creates a default BaseUriDecorator named "baseURI" at startup time.

    • Constructor Detail

      • BaseUriDecorator

        public BaseUriDecorator​(String name)
        Builds a new BaseUriDecorator.
        Parameters:
        name - The name of this decorator.
    • Method Detail

      • decorateFilter

        protected org.forgerock.http.Filter decorateFilter​(org.forgerock.http.Filter delegate,
                                                           org.forgerock.json.JsonValue decoratorConfig,
                                                           Context context)
                                                    throws HeapException
        Description copied from class: AbstractHandlerAndFilterDecorator
        Decorates the provided delegate Filter instance with the provided decoratorConfig configuration.
        Specified by:
        decorateFilter in class AbstractHandlerAndFilterDecorator
        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 org.forgerock.http.Handler decorateHandler​(org.forgerock.http.Handler delegate,
                                                             org.forgerock.json.JsonValue decoratorConfig,
                                                             Context context)
        Description copied from class: AbstractHandlerAndFilterDecorator
        Decorates the provided delegate Handler instance with the provided decoratorConfig configuration.
        Specified by:
        decorateHandler in class AbstractHandlerAndFilterDecorator
        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)