Example usage for com.amazonaws.services.elasticsearch AWSElasticsearch shutdown

List of usage examples for com.amazonaws.services.elasticsearch AWSElasticsearch shutdown

Introduction

In this page you can find the example usage for com.amazonaws.services.elasticsearch AWSElasticsearch shutdown.

Prototype

void shutdown();

Source Link

Document

Shuts down this client object, releasing any resources that might be held open.

Usage

From source file:zipkin.autoconfigure.storage.elasticsearch.aws.ElasticsearchDomainEndpoint.java

License:Apache License

@Override
protected List<String> compute() {
    log.debug("looking up endpoint for region {} and domain {}", region, domain);
    AWSElasticsearch es = AWSElasticsearchClientBuilder.standard().withRegion(region).build();
    DescribeElasticsearchDomainResult result = es
            .describeElasticsearchDomain(new DescribeElasticsearchDomainRequest().withDomainName(domain));
    es.shutdown();

    String endpoint = result.getDomainStatus().getEndpoint();
    if (!endpoint.startsWith("https://")) {
        endpoint = "https://" + endpoint;
    }//from www . j  a  v a2 s  .c o  m
    log.debug("using endpoint {}", endpoint);
    return ImmutableList.of(endpoint);
}