Class BaseUriDecorator
- java.lang.Object
-
- org.forgerock.openig.decoration.helper.AbstractDecorator
-
- org.forgerock.openig.decoration.baseuri.BaseUriDecorator
-
- All Implemented Interfaces:
Decorator
public class BaseUriDecorator extends AbstractDecorator
The baseURI decorator can decorate bothFilter
andHandler
instances.It has to be declared inside of the heap objects section:
{ "name": "myBaseUri", "type": "BaseUriDecorator" }
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BaseUriDecorator.Heaplet
Creates and initializes a baseUri in a heap environment.
-
Constructor Summary
Constructors Constructor Description BaseUriDecorator(String name)
Builds a newBaseUriDecorator
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(Class<?> type)
Returnstrue
if this decorator is compatible with the provided component type.DecorationHandle
decorate(Object delegate, JsonValue decoratorConfig, Context context)
Decorates the provideddelegate
instance with the provideddecoratorConfig
configuration.-
Methods inherited from class org.forgerock.openig.decoration.helper.AbstractDecorator
getLogger
-
-
-
-
Constructor Detail
-
BaseUriDecorator
public BaseUriDecorator(String name)
Builds a newBaseUriDecorator
.- Parameters:
name
- The name of this decorator.
-
-
Method Detail
-
accepts
public boolean accepts(Class<?> type)
Description copied from interface:Decorator
Returnstrue
if this decorator is compatible with the provided component type. Note that a return value oftrue
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 DecorationHandle decorate(Object delegate, JsonValue decoratorConfig, Context context) throws HeapException
Description copied from interface:Decorator
Decorates the provideddelegate
instance with the provideddecoratorConfig
configuration. The implementation should take care of not changing the base type of the delegate.- Parameters:
delegate
- instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instance- Returns:
- a handle of the decoration that was setup, never
null
. - Throws:
HeapException
- when decoration fails
-
-