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 TransportClientProviderConnect 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 voidcloseConnection()@NotNull @NonNull ElasticClientCreatorgetElasticClientCreator()Controls how the underlyingRestClientis configured.TransportClientgetTransport()@NotNull @NonNull java.util.List<java.lang.String>getTransportUrls()The list of URLs that we try to connect to.voidsetElasticClientCreator(@NotNull @NonNull ElasticClientCreator elasticClientCreator)Controls how the underlyingRestClientis configured.voidsetTransportUrls(@NotNull @NonNull java.util.List<java.lang.String> transportUrls)The list of URLs that we try to connect to.ElasticRestConnectionwithElasticClientCreator(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:
closeConnectionin classNoOpConnection
-
getTransport
public TransportClient getTransport() throws java.lang.Exception
- Specified by:
getTransportin 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 underlyingRestClientis configured.By default defaults to
ElasticRestClientCreatorif not explicitly confgured. You may need to useAdvancedElasticRestClientCreatorif 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 underlyingRestClientis configured.By default defaults to
ElasticRestClientCreatorif not explicitly confgured. You may need to useAdvancedElasticRestClientCreatorif you are connecting to an instance that has specific requirements (e.g. AWS Managed Elastic).
-
-