Example usage for com.amazonaws.services.s3.model SSEAlgorithm toString

List of usage examples for com.amazonaws.services.s3.model SSEAlgorithm toString

Introduction

In this page you can find the example usage for com.amazonaws.services.s3.model SSEAlgorithm toString.

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:io.confluent.connect.s3.S3SinkConnectorConfig.java

License:Open Source License

public static ConfigDef newConfigDef() {
    ConfigDef configDef = StorageSinkConnectorConfig.newConfigDef(FORMAT_CLASS_RECOMMENDER,
            AVRO_COMPRESSION_RECOMMENDER);
    {/*ww w  .  jav  a  2 s .  c  o  m*/
        final String group = "S3";
        int orderInGroup = 0;

        configDef.define(S3_BUCKET_CONFIG, Type.STRING, Importance.HIGH, "The S3 Bucket.", group,
                ++orderInGroup, Width.LONG, "S3 Bucket");

        configDef.define(REGION_CONFIG, Type.STRING, REGION_DEFAULT, new RegionValidator(), Importance.MEDIUM,
                "The AWS region to be used the connector.", group, ++orderInGroup, Width.LONG, "AWS region",
                new RegionRecommender());

        configDef.define(PART_SIZE_CONFIG, Type.INT, PART_SIZE_DEFAULT, new PartRange(), Importance.HIGH,
                "The Part Size in S3 Multi-part Uploads.", group, ++orderInGroup, Width.LONG, "S3 Part Size");

        configDef.define(CREDENTIALS_PROVIDER_CLASS_CONFIG, Type.CLASS, CREDENTIALS_PROVIDER_CLASS_DEFAULT,
                new CredentialsProviderValidator(), Importance.LOW,
                "Credentials provider or provider chain to use for authentication to AWS. By default "
                        + "the connector uses 'DefaultAWSCredentialsProviderChain'.",
                group, ++orderInGroup, Width.LONG, "AWS Credentials Provider Class");

        List<String> validSsea = new ArrayList<>(SSEAlgorithm.values().length + 1);
        validSsea.add("");
        for (SSEAlgorithm algo : SSEAlgorithm.values()) {
            validSsea.add(algo.toString());
        }
        configDef.define(SSEA_CONFIG, Type.STRING, SSEA_DEFAULT,
                ConfigDef.ValidString.in(validSsea.toArray(new String[validSsea.size()])), Importance.LOW,
                "The S3 Server Side Encryption Algorithm.", group, ++orderInGroup, Width.LONG,
                "S3 Server Side Encryption Algorithm", new SseAlgorithmRecommender());

        configDef.define(SSE_CUSTOMER_KEY, Type.PASSWORD, SSE_CUSTOMER_KEY_DEFAULT, Importance.LOW,
                "The S3 Server Side Encryption Customer-Provided Key (SSE-C).", group, ++orderInGroup,
                Width.LONG, "S3 Server Side Encryption Customer-Provided Key (SSE-C)");

        configDef.define(SSE_KMS_KEY_ID_CONFIG, Type.STRING, SSE_KMS_KEY_ID_DEFAULT, Importance.LOW,
                "The name of the AWS Key Management Service (AWS-KMS) key to be used for server side "
                        + "encryption of the S3 objects. No encryption is used when no key is provided, but"
                        + " it is enabled when '" + SSEAlgorithm.KMS + "' is specified as encryption "
                        + "algorithm with a valid key name.",
                group, ++orderInGroup, Width.LONG, "S3 Server Side Encryption Key",
                new SseKmsKeyIdRecommender());

        configDef.define(ACL_CANNED_CONFIG, Type.STRING, ACL_CANNED_DEFAULT, new CannedAclValidator(),
                Importance.LOW, "An S3 canned ACL header value to apply when writing objects.", group,
                ++orderInGroup, Width.LONG, "S3 Canned ACL");

        configDef.define(WAN_MODE_CONFIG, Type.BOOLEAN, WAN_MODE_DEFAULT, Importance.MEDIUM,
                "Use S3 accelerated endpoint.", group, ++orderInGroup, Width.LONG,
                "S3 accelerated endpoint enabled");

        configDef.define(COMPRESSION_TYPE_CONFIG, Type.STRING, COMPRESSION_TYPE_DEFAULT,
                new CompressionTypeValidator(), Importance.LOW,
                "Compression type for file written to S3. "
                        + "Applied when using JsonFormat or ByteArrayFormat. "
                        + "Available values: none, gzip.",
                group, ++orderInGroup, Width.LONG, "Compression type");

        configDef.define(S3_PART_RETRIES_CONFIG, Type.INT, S3_PART_RETRIES_DEFAULT, atLeast(0),
                Importance.MEDIUM,
                "Maximum number of retry attempts for failed requests. Zero means no retries. "
                        + "The actual number of attempts is determined by the S3 client based on multiple "
                        + "factors, including, but not limited to - "
                        + "the value of this parameter, type of exception occurred, "
                        + "throttling settings of the underlying S3 client, etc.",
                group, ++orderInGroup, Width.LONG, "S3 Part Upload Retries");

        configDef.define(S3_RETRY_BACKOFF_CONFIG, Type.LONG, S3_RETRY_BACKOFF_DEFAULT, atLeast(0L),
                Importance.LOW,
                "How long to wait in milliseconds before attempting the first retry "
                        + "of a failed S3 request. Upon a failure, this connector may wait up to twice as "
                        + "long as the previous wait, up to the maximum number of retries. "
                        + "This avoids retrying in a tight loop under failure scenarios.",
                group, ++orderInGroup, Width.SHORT, "Retry Backoff (ms)");

        configDef.define(FORMAT_BYTEARRAY_EXTENSION_CONFIG, Type.STRING, FORMAT_BYTEARRAY_EXTENSION_DEFAULT,
                Importance.LOW,
                String.format("Output file extension for ByteArrayFormat. Defaults to '%s'",
                        FORMAT_BYTEARRAY_EXTENSION_DEFAULT),
                group, ++orderInGroup, Width.LONG, "Output file extension for ByteArrayFormat");

        configDef.define(FORMAT_BYTEARRAY_LINE_SEPARATOR_CONFIG, Type.STRING,
                // Because ConfigKey automatically trims strings, we cannot set
                // the default here and instead inject null;
                // the default is applied in getFormatByteArrayLineSeparator().
                null, Importance.LOW,
                "String inserted between records for ByteArrayFormat. "
                        + "Defaults to 'System.lineSeparator()' "
                        + "and may contain escape sequences like '\\n'. "
                        + "An input record that contains the line separator will look like "
                        + "multiple records in the output S3 object.",
                group, ++orderInGroup, Width.LONG, "Line separator ByteArrayFormat");

        configDef.define(S3_PROXY_URL_CONFIG, Type.STRING, S3_PROXY_URL_DEFAULT, Importance.LOW,
                "S3 Proxy settings encoded in URL syntax. This property is meant to be used only if you"
                        + " need to access S3 through a proxy.",
                group, ++orderInGroup, Width.LONG, "S3 Proxy Settings");

        configDef.define(S3_PROXY_USER_CONFIG, Type.STRING, S3_PROXY_USER_DEFAULT, Importance.LOW,
                "S3 Proxy User. This property is meant to be used only if you"
                        + " need to access S3 through a proxy. Using ``" + S3_PROXY_USER_CONFIG
                        + "`` instead of embedding the username and password in ``" + S3_PROXY_URL_CONFIG
                        + "`` allows the password to be hidden in the logs.",
                group, ++orderInGroup, Width.LONG, "S3 Proxy User");

        configDef.define(S3_PROXY_PASS_CONFIG, Type.PASSWORD, S3_PROXY_PASS_DEFAULT, Importance.LOW,
                "S3 Proxy Password. This property is meant to be used only if you"
                        + " need to access S3 through a proxy. Using ``" + S3_PROXY_PASS_CONFIG
                        + "`` instead of embedding the username and password in ``" + S3_PROXY_URL_CONFIG
                        + "`` allows the password to be hidden in the logs.",
                group, ++orderInGroup, Width.LONG, "S3 Proxy Password");

        configDef.define(HEADERS_USE_EXPECT_CONTINUE_CONFIG, Type.BOOLEAN, HEADERS_USE_EXPECT_CONTINUE_DEFAULT,
                Importance.LOW,
                "Enable/disable use of the HTTP/1.1 handshake using EXPECT: 100-CONTINUE during "
                        + "multi-part upload. If true, the client will wait for a 100 (CONTINUE) response "
                        + "before sending the request body. Else, the client uploads the entire request "
                        + "body without checking if the server is willing to accept the request.",
                group, ++orderInGroup, Width.SHORT, "S3 HTTP Send Uses Expect Continue");

    }
    return configDef;
}