public class CachePolicyDecisionFilter extends NotSupportedFilter implements Closeable
Constructor and Description |
---|
CachePolicyDecisionFilter(com.github.benmanes.caffeine.cache.Caffeine<Object,Object> caffeine,
Clock clock,
Duration defaultTimeout,
Duration maximumTimeout,
NotificationService notificationService)
Builds a
CachePolicyDecisionFilter . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Promise<ActionResponse,ResourceException> |
filterAction(Context context,
ActionRequest request,
RequestHandler next)
Filters an action request.
|
filterCreate, filterDelete, filterPatch, filterQuery, filterRead, filterUpdate
public CachePolicyDecisionFilter(com.github.benmanes.caffeine.cache.Caffeine<Object,Object> caffeine, Clock clock, Duration defaultTimeout, Duration maximumTimeout, NotificationService notificationService)
CachePolicyDecisionFilter
.caffeine
- The caffeine cache to use. Not null
.clock
- A clock providing access to the current instant, date and time using a time-zone, not null
.defaultTimeout
- The default duration for which to cache AM policy decisions.
If an AM policy decision provides a valid ttl value to specify the time until which the policy decision
remains valid, IG uses that value or the maxTimeout.maximumTimeout
- The maximum duration for which to cache AM policy decisions. If the ttl value provided by the AM
policy decision is after the current time plus the maxTimeout, IG uses the maxTimeout.
Can be null
.notificationService
- The notification service used to connect on AM websocket notifications.NullPointerException
- If caffeine or clock are null
.public Promise<ActionResponse,ResourceException> filterAction(Context context, ActionRequest request, RequestHandler next)
Filter
filterAction
in interface Filter
filterAction
in class NotSupportedFilter
context
- The filter chain context.request
- The action request.next
- A request handler representing the remainder of the filter
chain.Promise
containing the result of the operation.public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright 2011-2017 ForgeRock AS.