Class AwsSdk2Transport

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, OpenSearchTransport, Transport

    public class AwsSdk2Transport
    extends java.lang.Object
    implements OpenSearchTransport
    Implementation of the OpenSearchTransport interface that sends signed requests using the AWS v2 SDK HTTP clients, to connect to an AWS OpenSearch service using IAM authentication
    • Field Detail

      • DEFAULT_REQUEST_COMPRESSION_SIZE

        public static final java.lang.Integer DEFAULT_REQUEST_COMPRESSION_SIZE
        By default, requests that exceed this size will be automatically compressed. AwsSdk2TransportOptions can be used to override this setting or disable compresson.
    • Constructor Detail

      • AwsSdk2Transport

        public AwsSdk2Transport​(@Nonnull
                                software.amazon.awssdk.http.SdkHttpClient httpClient,
                                @Nonnull
                                java.lang.String host,
                                @Nonnull
                                software.amazon.awssdk.regions.Region signingRegion,
                                @CheckForNull
                                AwsSdk2TransportOptions options)
        Create an OpenSearchTransport with a SYNCHRONOUS AWS Http client

        Note that asynchronous OpenSearch requests sent through this transport will be dispatched *synchronously* on the calling thread.

        Parameters:
        httpClient - HTTP client to use for OpenSearch requests
        host - The fully qualified domain name to connect to
        signingRegion - The AWS region for which requests will be signed. This should typically match the region in `host`.
        options - Options that apply to all requests. Can be null. Create with AwsSdk2TransportOptions.builder() and use these to specify non-default credentials, compression options, etc.
      • AwsSdk2Transport

        public AwsSdk2Transport​(@Nonnull
                                software.amazon.awssdk.http.async.SdkAsyncHttpClient asyncHttpClient,
                                @Nonnull
                                java.lang.String host,
                                @Nonnull
                                software.amazon.awssdk.regions.Region signingRegion,
                                @CheckForNull
                                AwsSdk2TransportOptions options)
        Create an OpenSearchTransport with an ASYNCHRONOUS AWS Http client

        Note that synchronous OpenSearch requests sent through this transport will be dispatched using the asynchronous client, but the calling thread will block until they are complete.

        Parameters:
        asyncHttpClient - HTTP client to use for OpenSearch requests
        host - The target host
        signingRegion - The AWS region for which requests will be signed. This should typically match the region in `host`.
        options - Options that apply to all requests. Can be null. Create with AwsSdk2TransportOptions.builder() and use these to specify non-default credentials, compression options, etc.
      • AwsSdk2Transport

        public AwsSdk2Transport​(@CheckForNull
                                software.amazon.awssdk.http.SdkHttpClient httpClient,
                                @CheckForNull
                                software.amazon.awssdk.http.async.SdkAsyncHttpClient asyncHttpClient,
                                @Nonnull
                                java.lang.String host,
                                @Nonnull
                                software.amazon.awssdk.regions.Region signingRegion,
                                @CheckForNull
                                AwsSdk2TransportOptions options)
        Create an OpenSearchTransport with both synchronous and asynchronous AWS HTTP clients.

        The synchronous client will be used for synchronous OpenSearch requests, and the asynchronous client will be used for asynchronous HTTP requests.

        Parameters:
        httpClient - HTTP client to use for OpenSearch requests
        asyncHttpClient - HTTP client to use for synchronous OpenSearch requests
        host - The fully qualified domain name to connect to
        signingRegion - The AWS region for which requests will be signed. This should typically match the region in `host`.
        options - Options that apply to all requests. Can be null. Create with AwsSdk2TransportOptions.builder() and use these to specify non-default credentials, compression options, etc.