Package org.forgerock.openig.heap
Class GenericHeaplet
java.lang.Object
org.forgerock.openig.heap.GenericHeaplet
- All Implemented Interfaces:
Heaplet
- Direct Known Subclasses:
AbstractSamlFederationHeaplet,AbstractScriptableHeapObject.AbstractScriptableHeaplet,AllowOnlyFilter.Heaplet,AmServiceHeaplet,AmSessionIdleTimeoutFilter.Heaplet,AssignmentFilter.Heaplet,AuditServiceObjectHeaplet,Base64EncodedSecretStore.Heaplet,CaffeineCacheAccessTokenResolver.Heaplet,CapturedUserPasswordFilter.Heaplet,CertificateThumbprintFilter.Heaplet,ChainFilterHeaplet,ChainHandlerHeaplet,CircuitBreakerFilter.Heaplet,ClientCredentialsOAuth2ClientFilterHeaplet,ClientRegistration.Heaplet,ClientSecretBasicAuthenticationFilterHeaplet,ClientSecretPostAuthenticationFilterHeaplet,ClientTlsOptionsHeaplet,ConditionalFilterHeaplet,ConditionEnforcementFilter.Heaplet,ConfirmationKeyVerifierAccessTokenResolver.Heaplet,CookieFilter.Heaplet,CorsFilterHeaplet,CrossDomainSingleSignOnFilter.Heaplet,CsrfFilterHeaplet,CustomProxyOptions.Heaplet,DataPreservationFilter.Heaplet,DateHeaderFilter.Heaplet,DefaultRateThrottlingPolicyHeaplet,DelegateHeaplet,DispatchHandler.Heaplet,EntityExtractFilter.Heaplet,FapiInteractionIdFilter.Heaplet,FileAttributesFilter.Heaplet,FileSystemSecretStoreHeaplet,ForwardedRequestFilter.Heaplet,FragmentFilter.Heaplet,GrantSwapJwtAssertionOAuth2ClientFilter.Heaplet,HeaderFilter.Heaplet,HsmSecretStoreHeaplet,HttpBasicAuthenticationClientFilterHeaplet,HttpBasicAuthFilter.Heaplet,HttpClientHandlerHeaplet,IdentityAssertionHandler.Heaplet,IdentityAssertionHandlerTechPreview.Heaplet,InMemorySessionManagerHeaplet,IssuerHeaplet,IssuerRepository.Heaplet,JdbcDataSourceHeaplet,JwkPropertyFormatHeaplet,JwkSetHandler.Heaplet,JwkSetSecretStoreHeaplet,JwtBuilderFilter.Heaplet,JwtSessionManagerHeaplet,JwtValidationFilter.Heaplet,KerberosIdentityAssertionPlugin.Heaplet,KeyManagerHeaplet,KeyStoreHeaplet,KeyStoreSecretStoreHeaplet,KeytabServiceLogin.Heaplet,LocationHeaderFilter.Heaplet,MappedThrottlingPolicyHeaplet,NoOpAuditService.Heaplet,NoProxyOptions.Heaplet,OAuth2ClientFilter.Heaplet,OAuth2ResourceServerFilterHeaplet,OAuth2TokenExchangeFilter.Heaplet,PasswordReplayFilterHeaplet,PemPropertyFormatHeaplet,PingOneApiAccessManagementFilterHeaplet,PingOneProtectEvaluationFilter.Heaplet,PingOneProtectFeedbackFilter.FeedbackFailureHeaplet,PingOneProtectFeedbackFilter.FeedbackSuccessHeaplet,PingOneProtectThreatLevelRoutingHandler.Heaplet,PingOneService.Heaplet,PolicyEnforcementFilter.Heaplet,PrivateKeyJwtClientAuthenticationFilterHeaplet,RequestResourceUriProvider.Heaplet,ResourceHandler.Heaplet,ResourceOwnerOAuth2ClientFilterHeaplet,RouterHandler.Heaplet,ScheduledExecutorServiceHeaplet,SecretKeyPropertyFormatHeaplet,SecretsKeyManagerHeaplet,SecretsProviderHeaplet,SecretsTrustManagerHeaplet,SequenceHandler.Heaplet,ServerTlsOptionsHeaplet,SessionInfoFilter.Heaplet,SetCookieUpdateFilter.Heaplet,SingleSignOnFilter.Heaplet,SqlAttributesFilter.Heaplet,StatelessAccessTokenResolver.Heaplet,StaticRequestFilter.Heaplet,StaticResponseHandler.Heaplet,SwitchFilter.Heaplet,SystemAndEnvSecretStoreHeaplet,SystemProxyOptions.Heaplet,TemporaryStorageHeaplet,ThrottlingFilterHeaplet,TokenIntrospectionAccessTokenResolverHeaplet,TokenTransformationFilter.Heaplet,TrustAllManager.Heaplet,TrustManagerHeaplet,UmaResourceServerFilter.Heaplet,UmaSharingService.Heaplet,UriPathRewriteFilter.Heaplet,UsernamePasswordServiceLogin.Heaplet,UserProfileFilterHeaplet,UserProfileServiceHeaplet,WelcomeHandler.Heaplet
A generic base class for heaplets with automatically injected fields.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JsonValueThe heaplet's object configuration object.protected HeapWhere objects should be put and where object dependencies should be retrieved.protected StringThe name of the object to be created and stored in the heap by this heaplet.protected ObjectThe object created by the heaplet'screate()method.protected NameThe fully qualified name of the object to be created. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Objectcreate()Called to request the heaplet create an object.Called to request the heaplet to create an object.voiddestroy()Called to indicate that the object created by the heaplet is going to be dereferenced.protected EndpointRegistryReturns this object'sEndpointRegistry, creating it lazily when requested for the first time.Returns a function that will evaluate the expression hold by aJsonValueusing the properties defined in the heap of this Heaplet.protected <T> Function<JsonValue,Expression<T>, JsonValueException> expression(Class<T> type) Returns a function that will create anExpressionfrom the string by theJsonValueusing the bindings defined in the heap of this Heaplet as initial bindings.Returns the config associated to thatHeaplet.getHeap()Returns the heap associated to thatHeaplet.protected StringgetType()Returns the type of the IG object.protected BindingsReturn an initial set of bindings based on the heap properties, along with any utility items from the heap, such as the clock.protected org.forgerock.monitoring.api.instrument.MeterRegistryHolderReturns this object'sMeterRegistry, creating it lazily when requested for the first time.voidstart()Called to request the heaplet start an object.
-
Field Details
-
name
The name of the object to be created and stored in the heap by this heaplet. -
qualified
The fully qualified name of the object to be created. -
config
The heaplet's object configuration object. -
heap
Where objects should be put and where object dependencies should be retrieved. -
object
The object created by the heaplet'screate()method.
-
-
Constructor Details
-
GenericHeaplet
public GenericHeaplet()
-
-
Method Details
-
create
Description copied from interface:HeapletCalled to request the heaplet to create an object.- Specified by:
createin interfaceHeaplet- Parameters:
name- the name of the object to be created.config- the heaplet's configuration object.heap- the heap where object dependencies can be retrieved.- Returns:
- the object created by the heaplet.
- Throws:
HeapException- if an exception occurred during creation of the object or any of its dependencies.
-
endpointRegistry
Returns this object'sEndpointRegistry, creating it lazily when requested for the first time.- Returns:
- this object's
EndpointRegistry(/objects/[name]) - Throws:
HeapException- should never be thrown
-
meterRegistryHolder
protected org.forgerock.monitoring.api.instrument.MeterRegistryHolder meterRegistryHolder() throws HeapExceptionReturns this object'sMeterRegistry, creating it lazily when requested for the first time.- Returns:
- this object's
MeterRegistry - Throws:
HeapException- should never be thrown
-
getType
Returns the type of the IG object.- Returns:
- the type of the IG object
-
destroy
public void destroy()Description copied from interface:HeapletCalled to indicate that the object created by the heaplet is going to be dereferenced. This gives the heaplet an opportunity to free any resources that are being held prior to its dereference. -
create
Called to request the heaplet create an object. Called byHeaplet.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 thestart()method.- Returns:
- The created object.
- Throws:
HeapException- if an exception occurred during creation of the heap object or any of its dependencies.JsonValueException- if the heaplet (or one of its dependencies) has a malformed configuration.
-
start
Called to request the heaplet start an object. Called byHeaplet.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.- Throws:
HeapException- if an exception occurred while starting the heap object or any of its dependencies.
-
evaluatedWithHeapProperties
Returns a function that will evaluate the expression hold by aJsonValueusing the properties defined in the heap of this Heaplet.- Returns:
- a function that will evaluate the expression hold by a
JsonValueusing the properties defined in the heap of this Heaplet.
-
expression
Returns a function that will create anExpressionfrom the string by theJsonValueusing the bindings defined in the heap of this Heaplet as initial bindings.- Type Parameters:
T- The type of the expression's result.- Parameters:
type- The expected result type of theExpression- Returns:
- a function that will create an
Expressionfrom the string by theJsonValueusing the bindings defined in the heap of this Heaplet as initial bindings.
-
initialBindings
Return an initial set of bindings based on the heap properties, along with any utility items from the heap, such as the clock.- Returns:
- an initial set of bindings based on the heap properties, along with any utility items from the heap, such as the clock.
-
getHeap
Returns the heap associated to thatHeaplet.- Returns:
- the heap associated to that
Heaplet.
-
getConfig
Returns the config associated to thatHeaplet.- Returns:
- the config associated to that
Heaplet.
-