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 compression.
    • Constructor Detail

      • AwsSdk2Transport

        public AwsSdk2Transport​(@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 an asynchronous AWS HTTP client.

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

        Parameters:
        asyncHttpClient - Asynchronous 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​(@CheckForNull
                                software.amazon.awssdk.http.SdkHttpClient syncHttpClient,
                                @Nonnull
                                java.lang.String host,
                                @Nonnull
                                software.amazon.awssdk.regions.Region signingRegion,
                                @CheckForNull
                                AwsSdk2TransportOptions options)
        Create an OpenSearchTransport with a synchronous AWS HTTP client.
        Parameters:
        syncHttpClient - Synchronous 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​(@CheckForNull
                                software.amazon.awssdk.http.async.SdkAsyncHttpClient asyncHttpClient,
                                @Nonnull
                                java.lang.String host,
                                @Nonnull
                                java.lang.String signingServiceName,
                                @Nonnull
                                software.amazon.awssdk.regions.Region signingRegion,
                                @CheckForNull
                                AwsSdk2TransportOptions options)
        Create an OpenSearchTransport with an asynchronous AWS HTTP client.

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

        Parameters:
        asyncHttpClient - Asynchronous 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`.
        signingServiceName - The AWS signing service name, one of `es` (Amazon OpenSearch) or `aoss` (Amazon OpenSearch Serverless).
        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 syncHttpClient,
                                @Nonnull
                                java.lang.String host,
                                @Nonnull
                                java.lang.String signingServiceName,
                                @Nonnull
                                software.amazon.awssdk.regions.Region signingRegion,
                                @CheckForNull
                                AwsSdk2TransportOptions options)
        Create an OpenSearchTransport with a synchronous AWS HTTP client.
        Parameters:
        syncHttpClient - Synchronous 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`.
        signingServiceName - The AWS signing service name, one of `es` (Amazon OpenSearch) or `aoss` (Amazon OpenSearch Serverless).
        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.