Class S3Config
- java.lang.Object
-
- com.emc.object.ObjectConfig<S3Config>
-
- com.emc.object.s3.S3Config
-
public class S3Config extends ObjectConfig<S3Config>
To enable the smart-client with a single VDC, use theS3Config(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 theS3Config(URI)
constructor andsetUseVHost(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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.emc.object.ObjectConfig
ObjectConfig.ProtocolConverter, ObjectConfig.VdcConverter
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
checksumEnabled
static int
DEFAULT_HTTP_PORT
static int
DEFAULT_HTTPS_PORT
static int
DEFAULT_INITIAL_RETRY_DELAY
static int
DEFAULT_RETRY_BUFFER_SIZE
static int
DEFAULT_RETRY_LIMIT
protected float
faultInjectionRate
protected int
initialRetryDelay
protected int
retryBufferSize
protected boolean
retryEnabled
protected int
retryLimit
protected boolean
signMetadataSearch
protected boolean
signNamespace
protected boolean
useV2Signer
protected boolean
useVHost
-
Fields inherited from class com.emc.object.ObjectConfig
DEFAULT_CHUNKED_ENCODING_SIZE, DEFAULT_CONNECT_TIMEOUT, DEFAULT_READ_TIMEOUT, DEFAULT_USER_AGENT, PACKAGE_VERSION, PROPERTY_DISABLE_HEALTH_CHECK, PROPERTY_DISABLE_HOST_UPDATE, PROPERTY_POLL_INTERVAL, PROPERTY_POLL_PORT, PROPERTY_POLL_PROTOCOL, PROPERTY_PROXY_PASS, PROPERTY_PROXY_URI, PROPERTY_PROXY_USER
-
-
Constructor Summary
Constructors Constructor Description S3Config()
Empty constructor for internal use only!S3Config(Protocol protocol, com.emc.rest.smart.ecs.Vdc... vdcs)
Multiple VDC smart-client constructor.S3Config(Protocol protocol, java.lang.String... hostList)
Single VDC smart-client constructor.S3Config(S3Config other)
Cloning constructor.S3Config(java.net.URI endpoint)
External load balancer constructor (no smart-client).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static int
defaultPort(Protocol protocol)
float
getFaultInjectionRate()
int
getInitialRetryDelay()
int
getRetryBufferSize()
int
getRetryLimit()
boolean
isChecksumEnabled()
boolean
isRetryEnabled()
boolean
isSignMetadataSearch()
boolean
isSignNamespace()
boolean
isUseV2Signer()
boolean
isUseVHost()
com.emc.rest.smart.Host
resolveHost()
void
setChecksumEnabled(boolean checksumEnabled)
By default, MD5 sums are verified on whole-object reads and writes whenever possible.void
setFaultInjectionRate(float faultInjectionRate)
Sets the fault injection rate.void
setInitialRetryDelay(int initialRetryDelay)
number of milliseconds to delay before the first retry attempt after a failed request.void
setRetryBufferSize(int retryBufferSize)
Allocates a stream buffer to use for retries.void
setRetryEnabled(boolean retryEnabled)
Set to false to disable automatic retry of (retriable) requests (default is true)void
setRetryLimit(int retryLimit)
Sets the maximum number of automatic retries of failed (retriable) requests.void
setSignMetadataSearch(boolean signMetadataSearch)
Instructs the client whether to sign the metadata search parameters.void
setSignNamespace(boolean signNamespace)
Standard ECS configurations require signing the namespace to support cross-namespace requests.void
setUseV2Signer(boolean useV2Signer)
Sets the AWS signature version for authentication requests, default is v2, set this to false to use v4.void
setUseVHost(boolean useVHost)
Set to true to enable virtual-host-style requests.com.emc.rest.smart.SmartConfig
toSmartConfig()
java.lang.String
toString()
S3Config
withChecksumEnabled(boolean checksumEnabled)
S3Config
withFaultInjectionRate(float faultInjectionRate)
S3Config
withInitialRetryDelay(int initialRetryDelay)
S3Config
withRetryBufferSize(int retryBufferSize)
S3Config
withRetryEnabled(boolean retryEnabled)
S3Config
withRetryLimit(int retryLimit)
S3Config
withSignMetadataSearch(boolean signMetadataSearch)
S3Config
withSignNamespace(boolean signNamespace)
S3Config
withUseV2Signer(boolean useV2Signer)
S3Config
withUseVHost(boolean useVHost)
-
Methods inherited from class com.emc.object.ObjectConfig
getChunkedEncodingSize, getConnectTimeout, getEncryptionConfig, getHost, getIdentity, getNamespace, getPort, getPropAsString, getProperties, getProperty, getProtocol, getReadTimeout, getRootContext, getSecretKey, getServerClockSkew, getSessionToken, getUserAgent, getVdcs, isGeoPinningEnabled, isGeoReadRetryFailover, isSmartClient, propAsString, resolvePath, setChunkedEncodingSize, setConnectTimeout, setEncryptionConfig, setGeoPinningEnabled, setGeoReadRetryFailover, setHost, setIdentity, setNamespace, setPort, setProperty, setProtocol, setReadTimeout, setRootContext, setSecretKey, setServerClockSkew, setSessionToken, setSmartClient, setUserAgent, setVdcs, withChunkedEncodingSize, withConnectTimeout, withEncryptionConfig, withGeoPinningEnabled, withIdentity, withNamespace, withPort, withProperty, withReadTimeout, withRootContext, withSecretKey, withSessionToken, withSmartClient, withUserAgent
-
-
-
-
Field Detail
-
DEFAULT_HTTP_PORT
public static final int DEFAULT_HTTP_PORT
- See Also:
- Constant Field Values
-
DEFAULT_HTTPS_PORT
public static final int DEFAULT_HTTPS_PORT
- See Also:
- Constant Field Values
-
DEFAULT_INITIAL_RETRY_DELAY
public static final int DEFAULT_INITIAL_RETRY_DELAY
- See Also:
- Constant Field Values
-
DEFAULT_RETRY_LIMIT
public static final int DEFAULT_RETRY_LIMIT
- 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 mustsetUseVHost(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)
-
resolveHost
public com.emc.rest.smart.Host resolveHost()
- Specified by:
resolveHost
in classObjectConfig<S3Config>
-
toSmartConfig
public com.emc.rest.smart.SmartConfig toSmartConfig()
- Overrides:
toSmartConfig
in classObjectConfig<S3Config>
-
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)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classObjectConfig<S3Config>
-
-