Class ApiClient<T extends Transport,Self extends ApiClient<T,Self>>

java.lang.Object
co.elastic.clients.ApiClient<T,Self>
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
ElasticsearchAsyncClient, ElasticsearchAsyncSearchAsyncClient, ElasticsearchAsyncSearchClient, ElasticsearchAutoscalingAsyncClient, ElasticsearchAutoscalingClient, ElasticsearchCatAsyncClient, ElasticsearchCatClient, ElasticsearchCcrAsyncClient, ElasticsearchCcrClient, ElasticsearchClient, ElasticsearchClusterAsyncClient, ElasticsearchClusterClient, ElasticsearchConnectorAsyncClient, ElasticsearchConnectorClient, ElasticsearchDanglingIndicesAsyncClient, ElasticsearchDanglingIndicesClient, ElasticsearchEnrichAsyncClient, ElasticsearchEnrichClient, ElasticsearchEqlAsyncClient, ElasticsearchEqlClient, ElasticsearchEsqlAsyncClient, ElasticsearchEsqlClient, ElasticsearchFeaturesAsyncClient, ElasticsearchFeaturesClient, ElasticsearchFleetAsyncClient, ElasticsearchFleetClient, ElasticsearchGraphAsyncClient, ElasticsearchGraphClient, ElasticsearchIlmAsyncClient, ElasticsearchIlmClient, ElasticsearchIndicesAsyncClient, ElasticsearchIndicesClient, ElasticsearchInferenceAsyncClient, ElasticsearchInferenceClient, ElasticsearchIngestAsyncClient, ElasticsearchIngestClient, ElasticsearchLicenseAsyncClient, ElasticsearchLicenseClient, ElasticsearchLogstashAsyncClient, ElasticsearchLogstashClient, ElasticsearchMigrationAsyncClient, ElasticsearchMigrationClient, ElasticsearchMlAsyncClient, ElasticsearchMlClient, ElasticsearchMonitoringAsyncClient, ElasticsearchMonitoringClient, ElasticsearchNodesAsyncClient, ElasticsearchNodesClient, ElasticsearchQueryRulesAsyncClient, ElasticsearchQueryRulesClient, ElasticsearchRollupAsyncClient, ElasticsearchRollupClient, ElasticsearchSearchableSnapshotsAsyncClient, ElasticsearchSearchableSnapshotsClient, ElasticsearchSearchApplicationAsyncClient, ElasticsearchSearchApplicationClient, ElasticsearchSecurityAsyncClient, ElasticsearchSecurityClient, ElasticsearchShutdownAsyncClient, ElasticsearchShutdownClient, ElasticsearchSimulateAsyncClient, ElasticsearchSimulateClient, ElasticsearchSlmAsyncClient, ElasticsearchSlmClient, ElasticsearchSnapshotAsyncClient, ElasticsearchSnapshotClient, ElasticsearchSqlAsyncClient, ElasticsearchSqlClient, ElasticsearchSslAsyncClient, ElasticsearchSslClient, ElasticsearchSynonymsAsyncClient, ElasticsearchSynonymsClient, ElasticsearchTasksAsyncClient, ElasticsearchTasksClient, ElasticsearchTextStructureAsyncClient, ElasticsearchTextStructureClient, ElasticsearchTransformAsyncClient, ElasticsearchTransformClient, ElasticsearchWatcherAsyncClient, ElasticsearchWatcherClient, ElasticsearchXpackAsyncClient, ElasticsearchXpackClient

public abstract class ApiClient<T extends Transport,Self extends ApiClient<T,Self>> extends Object implements Closeable
  • Field Details

  • Constructor Details

  • Method Details

    • getDeserializer

      protected <V> JsonpDeserializer<V> getDeserializer(Type type)
    • withTransportOptions

      public abstract Self withTransportOptions(@Nullable TransportOptions transportOptions)
      Creates a new client with some request options
    • withTransportOptions

      Creates a new client with additional request options
      Parameters:
      fn - a lambda expression that takes the current options as input
    • _transport

      public T _transport()
      Get the transport used by this client to handle communication with the server.
    • _transportOptions

      public TransportOptions _transportOptions()
      Get the transport options used for this client. If the client has no custom options, falls back to the transport's options.
    • _jsonpMapper

      public JsonpMapper _jsonpMapper()
      Get the JSON mapper used to map API objects to/from JSON.

      Shortcut for _transport().jsonpMapper()

    • close

      public void close() throws IOException
      Close this client and associated resources, including the underlying Transport object.

      If the underlying Transport object is shared with other API client objects, these objects will also become unavailable.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException