public class AmServiceHeaplet extends GenericHeaplet
AmService
that can shared amongst AM
related filters such as the SingleSignOnFilter
and the PolicyEnforcementFilter
.
{
"type": "AmService",
"config": {
"url" : expression [REQUIRED - configuration time expression that represents the URI
of the AM Server, for example:
{@literal https://am.example.com/sso}]
"amHandler" : expression [OPTIONAL - by default, uses the 'ForgeRockClientHandler'
provided in heap.]
"realm" : expression [OPTIONAL - configuration time expression, default is
{@link Realm#ROOT_REALM}]
"ssoTokenHeader" : expression [OPTIONAL - configuration time expression, default is
{@link AmService#DEFAULT_COOKIE_NAME}]
"version" : expression [OPTIONAL - configuration time expression, defaults to
{@link AmService#DEFAULT_AM_VERSION}]
"agent" : object [OPTIONAL - Define agent credentials for notifications]
{
"username" : expression [REQUIRED - Name of the java Agent to secure communications
with AM.]
"password" : expression [REQUIRED - password of the agent.]
}
"sessionCache" : object [OPTIONAL - By default the session cache is disabled.]
{
"enabled" : expression(boolean) [OPTIONAL - Allow to disable the cache while still keeping
the configuration for later use. Default is
false.]
"maximumSize" : expression(long) [OPTIONAL - Sets the maximum size of the session cache.]
"maximumTimeToCache" : expression(long) [OPTIONAL - Sets the maximum time to cache a session.]
"executor" : executor [OPTIONAL - By default, {@link ForkJoinPool#commonPool()}
is used.]
}
}
}
The sessionCache's entry default expiry policy is based on the "maxSessionExpirationTime" field located in
the SessionInfo
object stored.Constructor and Description |
---|
AmServiceHeaplet() |
Modifier and Type | Method and Description |
---|---|
static AmService |
buildAmService(GenericHeaplet heaplet,
String amUrlAttribute,
org.slf4j.Logger logger)
Create an
AmService from a "deprecated" configuration. |
Object |
create()
Called to request the heaplet create an object.
|
void |
destroy()
Called to indicate that the object created by the heaplet is going to be dereferenced.
|
void |
start()
Called to request the heaplet start an object.
|
create, endpointRegistry, evaluatedWithHeapProperties, expression, getConfig, getHeap, getType, meterRegistryHolder
public Object create() throws HeapException
GenericHeaplet
Heaplet.create(Name, JsonValue, Heap)
after initializing
the protected field members. Implementations should parse configuration
but not acquire resources, start threads, or log any initialization
messages. These tasks should be performed by the GenericHeaplet.start()
method.create
in class GenericHeaplet
HeapException
- if an exception occurred during creation of the heap object
or any of its dependencies.public void start() throws HeapException
GenericHeaplet
Heaplet.create(Name, JsonValue, Heap)
after creating and
configuring the object and once the object's logger and storage have been
configured. Implementations should override this method if they need to
acquire resources, start threads, or log any initialization messages.start
in class GenericHeaplet
HeapException
- if an exception occurred while starting the heap object or
any of its dependencies.public void destroy()
Heaplet
destroy
in interface Heaplet
destroy
in class GenericHeaplet
public static AmService buildAmService(GenericHeaplet heaplet, String amUrlAttribute, org.slf4j.Logger logger) throws HeapException
AmService
from a "deprecated" configuration.heaplet
- The component's Heaplet
that needs an AmService
.amUrlAttribute
- The value of the setting to get the URL to AM.logger
- The logger to use to outputm essages.AmService
built from settings provided by the config.HeapException
- in case of error or incompatible configuration.Copyright 2011-2017 ForgeRock AS.