Package org.nuxeo.runtime.opensearch1
Class OpenSearchComponent
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.runtime.opensearch1.OpenSearchComponent
- All Implemented Interfaces:
Adaptable
,Component
,Extensible
,OpenSearchClientService
,TimestampedService
Component used to get a client configured to hit an OpenSearch instance.
- Since:
- 2025.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final OpenSearchClientFactory
protected final Map
<String, OpenSearchClient> protected static final String
protected static final Duration
protected static final String
protected static final String
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
createIndex
(String indexName, OpenSearchIndexConfig config, boolean dropIfExists) void
dropAndInitIndex
(String indexName) int
The component notification order forComponent.start(ComponentContext)
.Gets the OpenSearch client for the given id.protected void
initIndex
(OpenSearchIndexConfig config, boolean dropIfExists) instantiateClient
(OpenSearchClientConfig descriptor) void
start
(ComponentContext context) Start the component.void
stop
(ComponentContext context) Stop the component.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtension
-
Field Details
-
XP_CLIENT
- See Also:
-
XP_INDEX
- See Also:
-
DEFAULT_CLIENT_ID
- See Also:
-
TIMEOUT_WAIT_FOR_CLUSTER
-
CLIENT_FACTORY
-
clients
-
-
Constructor Details
-
OpenSearchComponent
public OpenSearchComponent()
-
-
Method Details
-
getApplicationStartedOrder
public int getApplicationStartedOrder()Description copied from interface:Component
The component notification order forComponent.start(ComponentContext)
.Components are notified in increasing order. Order 1000 is the default order for components that don't care. Order 100 is the repository initialization.
- Specified by:
getApplicationStartedOrder
in interfaceComponent
- Returns:
- the order, 1000 by default
-
start
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in classDefaultComponent
-
instantiateClient
protected OpenSearchComponent.OpenSearchClientWithId instantiateClient(OpenSearchClientConfig descriptor) -
initIndex
-
createIndex
-
stop
Description copied from interface:Component
Stop the component.- Specified by:
stop
in interfaceComponent
- Overrides:
stop
in classDefaultComponent
-
getClient
Description copied from interface:OpenSearchClientService
Gets the OpenSearch client for the given id.- Specified by:
getClient
in interfaceOpenSearchClientService
- Parameters:
id
- the client id- Returns:
- the client configured by
OpenSearchClientConfig
for the input id, or the default one if it doesn't exist
-
dropAndInitIndex
-