Class S3Config


  • public class S3Config
    extends ObjectConfig<S3Config>
    To enable the smart-client with a single VDC, use the S3Config(Protocol, String...) constructor:
         S3Config s3Config = new S3Config(Protocol.HTTP, "10.10.10.11", "10.10.10.12");
     

    To enable the smart-client with multiple VDCs, use the S3Config(Protocol, Vdc...) constructor:

         S3Config s3Config = new S3Config(Protocol.HTTP, new Vdc("10.10.10.11", "10.10.10.12"), new Vdc("10.20.10.11", "10.20.10.12"));
     

    To use an external load balancer without virtual-host-style requests use the S3Config(URI) constructor:

         S3Config s3Config = new S3Config("https://10.10.10.10:8443");
     

    To use an external load balancer with virtual-host-style requests (where bucket.namespace. is prepended to the hostname), use the S3Config(URI) constructor and setUseVHost(boolean) to true:

         S3Config s3Config = new S3Config("https://s3.company.com").withUseVHost(true);
     

    NOTE: If you enable virtual-host-style requests, you must specify your namespace or set it to null and include it in the hostname of the endpoint.

    • Field Detail

      • DEFAULT_INITIAL_RETRY_DELAY

        public static final int DEFAULT_INITIAL_RETRY_DELAY
        See Also:
        Constant Field Values
      • DEFAULT_RETRY_BUFFER_SIZE

        public static final int DEFAULT_RETRY_BUFFER_SIZE
        See Also:
        Constant Field Values
      • useVHost

        protected boolean useVHost
      • signNamespace

        protected boolean signNamespace
      • checksumEnabled

        protected boolean checksumEnabled
      • retryEnabled

        protected boolean retryEnabled
      • initialRetryDelay

        protected int initialRetryDelay
      • retryLimit

        protected int retryLimit
      • retryBufferSize

        protected int retryBufferSize
      • faultInjectionRate

        protected float faultInjectionRate
      • signMetadataSearch

        protected boolean signMetadataSearch
      • useV2Signer

        protected boolean useV2Signer
    • Constructor Detail

      • S3Config

        public S3Config()
        Empty constructor for internal use only!
      • S3Config

        public S3Config​(java.net.URI endpoint)
        External load balancer constructor (no smart-client).

        NOTE: To use virtual-host-style requests where bucket.namespace. is prepended to the host, you must setUseVHost(boolean) to true.

      • S3Config

        public S3Config​(Protocol protocol,
                        java.lang.String... hostList)
        Single VDC smart-client constructor.
      • S3Config

        public S3Config​(Protocol protocol,
                        com.emc.rest.smart.ecs.Vdc... vdcs)
        Multiple VDC smart-client constructor.
      • S3Config

        public S3Config​(S3Config other)
        Cloning constructor.
    • Method Detail

      • defaultPort

        protected static int defaultPort​(Protocol protocol)
      • isUseVHost

        public boolean isUseVHost()
      • setUseVHost

        public void setUseVHost​(boolean useVHost)
        Set to true to enable virtual-host-style requests. This prepends namespaces and buckets as appropriate for each request.

        NOTE: To use virtual host configuration, you must disable the smart client by using the S3Config(URI) constructor. You must also specify your namespace or set it to null and include it in the hostname of the endpoint.

      • isSignNamespace

        public boolean isSignNamespace()
      • setSignNamespace

        public void setSignNamespace​(boolean signNamespace)
        Standard ECS configurations require signing the namespace to support cross-namespace requests. To change this behavior to a legacy type virtual host, which is isolated to the default namespace of the user, set this to false.
      • isChecksumEnabled

        public boolean isChecksumEnabled()
      • setChecksumEnabled

        public void setChecksumEnabled​(boolean checksumEnabled)
        By default, MD5 sums are verified on whole-object reads and writes whenever possible. You can disable that by setting this to false.
      • isRetryEnabled

        public boolean isRetryEnabled()
      • setRetryEnabled

        public void setRetryEnabled​(boolean retryEnabled)
        Set to false to disable automatic retry of (retriable) requests (default is true)
      • getInitialRetryDelay

        public int getInitialRetryDelay()
      • setInitialRetryDelay

        public void setInitialRetryDelay​(int initialRetryDelay)
        number of milliseconds to delay before the first retry attempt after a failed request. The delay time increases by a factor of 2 after each failed request
      • getRetryLimit

        public int getRetryLimit()
      • setRetryLimit

        public void setRetryLimit​(int retryLimit)
        Sets the maximum number of automatic retries of failed (retriable) requests. Default is 3 retries (maximum 4 total requests)
      • getRetryBufferSize

        public int getRetryBufferSize()
      • setRetryBufferSize

        public void setRetryBufferSize​(int retryBufferSize)
        Allocates a stream buffer to use for retries. Requests that fail before sending this much data will be retried using data from the buffer. Default buffer is 2MB
      • getFaultInjectionRate

        public float getFaultInjectionRate()
      • setFaultInjectionRate

        public void setFaultInjectionRate​(float faultInjectionRate)
        Sets the fault injection rate. Enables fault injection when this number is > 0. The rate is a ratio expressed as a decimal between 0 and 1. This is the rate at which faults (HTTP 500 errors) should randomly be injected into the response. When faults are injected, the real request is never sent over the wire. Fault injection is disabled by default.
      • isSignMetadataSearch

        public boolean isSignMetadataSearch()
      • setSignMetadataSearch

        public void setSignMetadataSearch​(boolean signMetadataSearch)
        Instructs the client whether to sign the metadata search parameters. Prior to ECS 3.0, these were not signed, but as of 3.0 they are now signed. Be sure to set this appropriately based on your ECS software version.

        Note: as of object-client 3.0, this defaults to true (MD search params will be signed)

      • isUseV2Signer

        public boolean isUseV2Signer()
      • setUseV2Signer

        public void setUseV2Signer​(boolean useV2Signer)
        Sets the AWS signature version for authentication requests, default is v2, set this to false to use v4.
      • withUseVHost

        public S3Config withUseVHost​(boolean useVHost)
      • withSignNamespace

        public S3Config withSignNamespace​(boolean signNamespace)
      • withChecksumEnabled

        public S3Config withChecksumEnabled​(boolean checksumEnabled)
      • withRetryEnabled

        public S3Config withRetryEnabled​(boolean retryEnabled)
      • withInitialRetryDelay

        public S3Config withInitialRetryDelay​(int initialRetryDelay)
      • withRetryLimit

        public S3Config withRetryLimit​(int retryLimit)
      • withRetryBufferSize

        public S3Config withRetryBufferSize​(int retryBufferSize)
      • withFaultInjectionRate

        public S3Config withFaultInjectionRate​(float faultInjectionRate)
      • withSignMetadataSearch

        public S3Config withSignMetadataSearch​(boolean signMetadataSearch)
      • withUseV2Signer

        public S3Config withUseV2Signer​(boolean useV2Signer)