public class S3Config extends ObjectConfig<S3Config>
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.
ObjectConfig.ProtocolConverter, ObjectConfig.VdcConverter
Modifier and Type | Field and 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 |
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 and Description |
---|
S3Config()
Empty constructor for internal use only!
|
S3Config(Protocol protocol,
java.lang.String... hostList)
Single VDC smart-client constructor.
|
S3Config(Protocol protocol,
com.emc.rest.smart.ecs.Vdc... vdcs)
Multiple VDC smart-client constructor.
|
S3Config(S3Config other)
Cloning constructor.
|
S3Config(java.net.URI endpoint)
External load balancer constructor (no smart-client).
|
Modifier and Type | Method and 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) |
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
public static final int DEFAULT_HTTP_PORT
public static final int DEFAULT_HTTPS_PORT
public static final int DEFAULT_INITIAL_RETRY_DELAY
public static final int DEFAULT_RETRY_LIMIT
public static final int DEFAULT_RETRY_BUFFER_SIZE
protected boolean useVHost
protected boolean signNamespace
protected boolean checksumEnabled
protected boolean retryEnabled
protected int initialRetryDelay
protected int retryLimit
protected int retryBufferSize
protected float faultInjectionRate
protected boolean signMetadataSearch
protected boolean useV2Signer
public S3Config()
public S3Config(java.net.URI endpoint)
NOTE: To use virtual-host-style requests where
bucket.namespace.
is prepended to the host, you must setUseVHost(boolean)
to true.
public S3Config(Protocol protocol, java.lang.String... hostList)
public S3Config(Protocol protocol, com.emc.rest.smart.ecs.Vdc... vdcs)
public S3Config(S3Config other)
protected static int defaultPort(Protocol protocol)
public com.emc.rest.smart.Host resolveHost()
resolveHost
in class ObjectConfig<S3Config>
public com.emc.rest.smart.SmartConfig toSmartConfig()
toSmartConfig
in class ObjectConfig<S3Config>
public boolean isUseVHost()
public void setUseVHost(boolean useVHost)
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.
public boolean isSignNamespace()
public void setSignNamespace(boolean signNamespace)
public boolean isChecksumEnabled()
public void setChecksumEnabled(boolean checksumEnabled)
public boolean isRetryEnabled()
public void setRetryEnabled(boolean retryEnabled)
public int getInitialRetryDelay()
public void setInitialRetryDelay(int initialRetryDelay)
public int getRetryLimit()
public void setRetryLimit(int retryLimit)
public int getRetryBufferSize()
public void setRetryBufferSize(int retryBufferSize)
public float getFaultInjectionRate()
public void setFaultInjectionRate(float faultInjectionRate)
public boolean isSignMetadataSearch()
public void setSignMetadataSearch(boolean signMetadataSearch)
Note: as of object-client 3.0, this defaults to true (MD search params will be signed)
public boolean isUseV2Signer()
public void setUseV2Signer(boolean useV2Signer)
public S3Config withUseVHost(boolean useVHost)
public S3Config withSignNamespace(boolean signNamespace)
public S3Config withChecksumEnabled(boolean checksumEnabled)
public S3Config withRetryEnabled(boolean retryEnabled)
public S3Config withInitialRetryDelay(int initialRetryDelay)
public S3Config withRetryLimit(int retryLimit)
public S3Config withRetryBufferSize(int retryBufferSize)
public S3Config withFaultInjectionRate(float faultInjectionRate)
public S3Config withSignMetadataSearch(boolean signMetadataSearch)
public S3Config withUseV2Signer(boolean useV2Signer)
public java.lang.String toString()
toString
in class ObjectConfig<S3Config>