@Component(value="elasticsearch-client") public class ElasticSearchClient extends Object
Constructor and Description |
---|
ElasticSearchClient() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
org.elasticsearch.client.Client |
getClient()
Get the elastic search client.
|
String |
getServerHost() |
String |
getServerPort() |
void |
initialize() |
boolean |
isTransportClient() |
void |
setClusterName(String clusterName) |
void |
setLocal(String strIsLocal) |
void |
setTransportClient(String strIsTransportclient) |
org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse |
waitForGreenStatus(String... indices)
Wait for green status for the given indices.
|
@PostConstruct public void initialize() throws URISyntaxException
URISyntaxException
@PreDestroy public void close()
public org.elasticsearch.client.Client getClient()
public String getServerHost()
public String getServerPort()
public org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse waitForGreenStatus(String... indices)
indices
- The indices to wait for.ClusterHealthResponse
that contains the cluster health
after waiting maximum 5 minutes for green status.@Value(value="#{elasticsearchConfig[\'cluster.name\']}") public void setClusterName(String clusterName)
@Value(value="#{elasticsearchConfig[\'elasticSearch.local\']}") public void setLocal(String strIsLocal)
public boolean isTransportClient()
@Value(value="#{elasticsearchConfig[\'elasticSearch.transportclient\']}") public void setTransportClient(String strIsTransportclient)
Copyright © 2017. All rights reserved.