public class ElasticsearchClientFactory
extends org.springframework.beans.factory.config.AbstractFactoryBean<org.elasticsearch.client.RestHighLevelClient>
| Modifier and Type | Field and Description |
|---|---|
protected int |
connectTimeout
The connection timeout in milliseconds
|
protected String |
password
The password for Elasticsearch
|
protected String[] |
serverUrls
List of Elasticsearch urls
|
protected boolean |
socketKeepAlive
Indicates if socket keep alive should be enabled
|
protected int |
socketTimeout
The socket timeout in milliseconds
|
protected int |
threadCount
The number of threads to use
|
protected String |
username
The username for Elasticsearch
|
| Constructor and Description |
|---|
ElasticsearchClientFactory(String[] serverUrls) |
| Modifier and Type | Method and Description |
|---|---|
static org.elasticsearch.client.RestHighLevelClient |
createClient(String[] serverUrls,
String username,
String password,
int connectTimeout,
int socketTimeout,
int threadCount,
boolean socketKeepAlive) |
static org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager |
createConnectionManager(int connectionTimeout,
int socketTimeout,
int threadCount,
boolean socketKeepAlive) |
protected org.elasticsearch.client.RestHighLevelClient |
createInstance() |
protected void |
destroyInstance(org.elasticsearch.client.RestHighLevelClient instance) |
Class<?> |
getObjectType() |
void |
setConnectTimeout(int connectTimeout) |
void |
setPassword(String password) |
void |
setSocketKeepAlive(boolean socketKeepAlive) |
void |
setSocketTimeout(int socketTimeout) |
void |
setThreadCount(int threadCount) |
void |
setUsername(String username) |
protected String[] serverUrls
protected String username
protected String password
protected int connectTimeout
protected int socketTimeout
protected int threadCount
protected boolean socketKeepAlive
public ElasticsearchClientFactory(String[] serverUrls)
public void setUsername(String username)
public void setPassword(String password)
public void setConnectTimeout(int connectTimeout)
public void setSocketTimeout(int socketTimeout)
public void setThreadCount(int threadCount)
public void setSocketKeepAlive(boolean socketKeepAlive)
public static org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager createConnectionManager(int connectionTimeout,
int socketTimeout,
int threadCount,
boolean socketKeepAlive)
throws org.apache.http.nio.reactor.IOReactorException
org.apache.http.nio.reactor.IOReactorExceptionpublic static org.elasticsearch.client.RestHighLevelClient createClient(String[] serverUrls, String username, String password, int connectTimeout, int socketTimeout, int threadCount, boolean socketKeepAlive)
protected org.elasticsearch.client.RestHighLevelClient createInstance()
createInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<org.elasticsearch.client.RestHighLevelClient>protected void destroyInstance(org.elasticsearch.client.RestHighLevelClient instance)
throws Exception
destroyInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<org.elasticsearch.client.RestHighLevelClient>Exceptionpublic Class<?> getObjectType()
getObjectType in interface org.springframework.beans.factory.FactoryBean<org.elasticsearch.client.RestHighLevelClient>getObjectType in class org.springframework.beans.factory.config.AbstractFactoryBean<org.elasticsearch.client.RestHighLevelClient>Copyright © 2021 CrafterCMS. All rights reserved.