Class AbstractOpenSearchFactory<T>
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.craftercms.deployer.utils.opensearch.AbstractOpenSearchFactory<T>
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean<T>,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
OpenSearchServiceFactory
public abstract class AbstractOpenSearchFactory<T>
extends org.springframework.beans.factory.config.AbstractFactoryBean<T>
implements org.springframework.beans.factory.BeanNameAware
Base implementation for factories capable of build single or multi-cluster OpenSearch services
- Since:
- 3.1.5
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OpenSearchConfigThe OpenSearch configurationprotected StringThe name of the beanFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Tprotected abstract TdoCreateMultiInstance(org.opensearch.client.opensearch.OpenSearchClient readClient, org.opensearch.client.opensearch.OpenSearchClient[] writeClients) Creates a service instance for a multiple clusterprotected abstract TdoCreateSingleInstance(org.opensearch.client.opensearch.OpenSearchClient client) Creates a service instance for a single clustervoidsetBeanName(String name) Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, getObjectType, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Field Details
-
name
The name of the bean -
config
The OpenSearch configuration
-
-
Constructor Details
-
AbstractOpenSearchFactory
-
-
Method Details
-
setBeanName
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
createInstance
- Specified by:
createInstancein classorg.springframework.beans.factory.config.AbstractFactoryBean<T>
-
doCreateSingleInstance
protected abstract T doCreateSingleInstance(org.opensearch.client.opensearch.OpenSearchClient client) Creates a service instance for a single cluster- Parameters:
client- the OpenSearch client- Returns:
- the service instance
-
doCreateMultiInstance
protected abstract T doCreateMultiInstance(org.opensearch.client.opensearch.OpenSearchClient readClient, org.opensearch.client.opensearch.OpenSearchClient[] writeClients) Creates a service instance for a multiple cluster- Parameters:
readClient- the OpenSearch client for read-related operationswriteClients- the OpenSearch clients for write-related operations- Returns:
- the service instance
-