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 OpenSearchClientFactoryprotected final Map<String, OpenSearchClient> protected static final Stringprotected static final Durationprotected static final Stringprotected static final StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateIndex(String indexName, OpenSearchIndexConfig config, boolean dropIfExists) voiddropAndInitIndex(String indexName) intThe component notification order forComponent.start(ComponentContext).Gets the OpenSearch client for the given id.protected voidinitIndex(OpenSearchIndexConfig config, boolean dropIfExists) instantiateClient(OpenSearchClientConfig descriptor) voidstart(ComponentContext context) Start the component.voidstop(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:ComponentThe 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:
getApplicationStartedOrderin interfaceComponent- Returns:
- the order, 1000 by default
-
start
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
instantiateClient
protected OpenSearchComponent.OpenSearchClientWithId instantiateClient(OpenSearchClientConfig descriptor) -
initIndex
-
createIndex
-
stop
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- Overrides:
stopin classDefaultComponent
-
getClient
Description copied from interface:OpenSearchClientServiceGets the OpenSearch client for the given id.- Specified by:
getClientin interfaceOpenSearchClientService- Parameters:
id- the client id- Returns:
- the client configured by
OpenSearchClientConfigfor the input id, or the default one if it doesn't exist
-
dropAndInitIndex
-