Package com.adaptris.core.elastic.rest
Class ElasticRestConnection
- java.lang.Object
-
- com.adaptris.core.AdaptrisConnectionImp
-
- com.adaptris.core.NoOpConnection
-
- com.adaptris.core.elastic.rest.ElasticRestConnection
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisConnection
,ComponentLifecycle
,ComponentLifecycleExtension
,TransportClientProvider
,StateManagedComponent
@ComponentProfile(summary="Connect to elasticsearch via their high level REST client", since="3.9.1") public class ElasticRestConnection extends NoOpConnection implements TransportClientProvider
Connect to elasticsearch via their high level REST clientIn the adapter configuration file this class is aliased as elastic-rest-connection which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.AdaptrisConnectionImp
log
-
-
Constructor Summary
Constructors Constructor Description ElasticRestConnection()
ElasticRestConnection(java.lang.String... urls)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeConnection()
@NotNull @NonNull ElasticClientCreator
getElasticClientCreator()
Controls how the underlyingRestClient
is configured.TransportClient
getTransport()
@NotNull @NonNull java.util.List<java.lang.String>
getTransportUrls()
The list of URLs that we try to connect to.void
setElasticClientCreator(@NotNull @NonNull ElasticClientCreator elasticClientCreator)
Controls how the underlyingRestClient
is configured.void
setTransportUrls(@NotNull @NonNull java.util.List<java.lang.String> transportUrls)
The list of URLs that we try to connect to.ElasticRestConnection
withElasticClientCreator(ElasticClientCreator creator)
-
Methods inherited from class com.adaptris.core.NoOpConnection
initConnection, prepareConnection, startConnection, stopConnection
-
Methods inherited from class com.adaptris.core.AdaptrisConnectionImp
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, getConnectionErrorHandler, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
-
-
-
-
Method Detail
-
closeConnection
protected void closeConnection()
- Overrides:
closeConnection
in classNoOpConnection
-
getTransport
public TransportClient getTransport() throws java.lang.Exception
- Specified by:
getTransport
in interfaceTransportClientProvider
- Throws:
java.lang.Exception
-
withElasticClientCreator
public ElasticRestConnection withElasticClientCreator(ElasticClientCreator creator)
-
getTransportUrls
@NotNull @NonNull public @NotNull @NonNull java.util.List<java.lang.String> getTransportUrls()
The list of URLs that we try to connect to.
-
setTransportUrls
public void setTransportUrls(@NotNull @NonNull @NotNull @NonNull java.util.List<java.lang.String> transportUrls)
The list of URLs that we try to connect to.
-
getElasticClientCreator
@NotNull @NonNull public @NotNull @NonNull ElasticClientCreator getElasticClientCreator()
Controls how the underlyingRestClient
is configured.By default defaults to
ElasticRestClientCreator
if not explicitly confgured. You may need to useAdvancedElasticRestClientCreator
if you are connecting to an instance that has specific requirements (e.g. AWS Managed Elastic).
-
setElasticClientCreator
public void setElasticClientCreator(@NotNull @NonNull @NotNull @NonNull ElasticClientCreator elasticClientCreator)
Controls how the underlyingRestClient
is configured.By default defaults to
ElasticRestClientCreator
if not explicitly confgured. You may need to useAdvancedElasticRestClientCreator
if you are connecting to an instance that has specific requirements (e.g. AWS Managed Elastic).
-
-