public class Ds3ClientBuilder extends java.lang.Object implements Builder<Ds3Client>
Ds3Client
.
For instance, the number of times that the Ds3Client instance will perform a 307 redirect before throwing an error
can be customized with the withRedirectRetries(int)
as well as
setting a proxy with withProxy(String)
.Modifier and Type | Method and Description |
---|---|
Ds3Client |
build()
Returns a new Ds3Client instance.
|
static Ds3ClientBuilder |
create(java.lang.String endpoint,
Credentials creds)
Returns a Builder which is used to customize the behavior of the Ds3Client library.
|
static Ds3ClientBuilder |
fromEnv()
Returns a Build which already has the endpoint and credentials populated from environment variables.
|
Ds3ClientBuilder |
withBufferSize(int bufferSizeInBytes) |
Ds3ClientBuilder |
withCertificateVerification(boolean certificateVerification)
Specifies if the library should perform SSL certificate validation.
|
Ds3ClientBuilder |
withConnectionTimeout(int timeoutInMillis)
Sets the number of milliseconds to wait for a connection to be established before timing out.
|
Ds3ClientBuilder |
withHttps(boolean secure)
Specifies if the library should use HTTP or HTTPS.
|
Ds3ClientBuilder |
withProxy(java.lang.String proxy)
Sets a HTTP proxy.
|
Ds3ClientBuilder |
withRedirectRetries(int retries)
Sets the number of retries the library will attempt to perform when it receives 307 redirects from a
DS3 appliance.
|
Ds3ClientBuilder |
withSocketTimeout(int timeoutInMillis)
Sets the number of milliseconds to wait between data packets before timing out a request.
|
public static Ds3ClientBuilder create(java.lang.String endpoint, Credentials creds)
endpoint
- The DS3 endpoint the library should connect to.creds
- The Credentials
used for connecting to a DS3 endpoint.Ds3ClientImpl
object.public static Ds3ClientBuilder fromEnv() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public Ds3ClientBuilder withHttps(boolean secure)
secure
- True will use HTTPS, false will use HTTP.public Ds3ClientBuilder withBufferSize(int bufferSizeInBytes)
bufferSizeInBytes
- The size of the buffer to be used when writing content out to DS3.public Ds3ClientBuilder withCertificateVerification(boolean certificateVerification)
public Ds3ClientBuilder withProxy(java.lang.String proxy) throws java.lang.IllegalArgumentException
proxy
- The endpoint of the HTTP proxy.java.lang.IllegalArgumentException
- This will be thrown if the proxy endpoint is not a valid URI.public Ds3ClientBuilder withRedirectRetries(int retries)
retries
- The number of times the library should perform retries on 307.public Ds3ClientBuilder withConnectionTimeout(int timeoutInMillis)
public Ds3ClientBuilder withSocketTimeout(int timeoutInMillis)