Class ElasticClient

java.lang.Object
org.webpieces.elasticsearch.ElasticClient

@Singleton public class ElasticClient extends Object
  • Constructor Details

    • ElasticClient

      public ElasticClient()
  • Method Details

    • connect

      public void connect(String ipAddress, int port)
      Always connect in a method NOT in construction so that people don't accidentally connect to servers in tests (ie. every line in guice Module.configure is hit for tests even if you swap it out in a test so to avoid that, we do not create this in guice)
    • close

      public void close()
    • loadDocument

      public org.webpieces.util.futures.XFuture<org.elasticsearch.client.Response> loadDocument(String index, long id, Object document)
    • createAlias

      public org.webpieces.util.futures.XFuture<org.elasticsearch.client.Response> createAlias(String alias, String indexName)
    • getAliases

      public org.webpieces.util.futures.XFuture<org.elasticsearch.client.Response> getAliases(String index)
    • renameAlias

      public org.webpieces.util.futures.XFuture<org.elasticsearch.client.Response> renameAlias(String previousIndex, String newIndex, String alias)
    • deleteIndex

      public org.webpieces.util.futures.XFuture<org.elasticsearch.client.Response> deleteIndex(String name)
    • createIndex

      public org.webpieces.util.futures.XFuture<org.elasticsearch.client.Response> createIndex(String name, ElasticIndex index)
    • performRequest

      public org.webpieces.util.futures.XFuture<org.elasticsearch.client.Response> performRequest(String method, String endpoint, Map<String,String> params, Object jsonObj, org.apache.http.Header... headers)