com.baidubce.services.bos
Class BosClientConfiguration

java.lang.Object
  extended by com.baidubce.BceClientConfiguration
      extended by com.baidubce.services.bos.BosClientConfiguration

public class BosClientConfiguration
extends BceClientConfiguration


Field Summary
static int DEFAULT_STREAM_BUFFER_SIZE
           
 
Fields inherited from class com.baidubce.BceClientConfiguration
DEFAULT_CONNECTION_TIMEOUT_IN_MILLIS, DEFAULT_MAX_CONNECTIONS, DEFAULT_PROTOCOL, DEFAULT_REGION, DEFAULT_SOCKET_TIMEOUT_IN_MILLIS, DEFAULT_USER_AGENT
 
Constructor Summary
BosClientConfiguration()
           
BosClientConfiguration(BceClientConfiguration clientConfiguration)
           
BosClientConfiguration(BceClientConfiguration clientConfiguration, String bosEndpoint)
           
 
Method Summary
 int getStreamBufferSize()
           
 boolean isCnameEnabled()
          Returns whether to enable using cname to visit bos resource.
 void setCnameEnabled(boolean cnameEnabled)
          Sets whether to enable using cname to visit bos resource.
 void setStreamBufferSize(int streamBufferSize)
           
 BosClientConfiguration withCnameEnabled(boolean cnameEnabled)
           
 BosClientConfiguration withConnectionTimeoutInMillis(int connectionTimeoutInMillis)
          Sets the connection timeout in milliseconds, and returns the updated configuration instance.
 BosClientConfiguration withCredentials(BceCredentials credentials)
          Sets the BCE credentials used by the client to sign HTTP requests, and returns the updated configuration instance.
 BosClientConfiguration withEndpoint(String endpoint)
          Sets the service endpoint URL to which the client will connect, and returns the updated configuration instance.
 BosClientConfiguration withLocalAddress(InetAddress localAddress)
          Sets the optional local address to bind when connecting to BCE services, and returns the updated configuration instance.
 BosClientConfiguration withMaxConnections(int maxConnections)
          Sets the maximum number of open HTTP connections, and returns the updated configuration instance.
 BosClientConfiguration withProtocol(Protocol protocol)
          Sets the protocol (HTTP/HTTPS) to use when connecting to BCE services, and returns the updated configuration instance.
 BosClientConfiguration withProxyDomain(String proxyDomain)
          Sets the optional Windows domain to use when connecting through a Windows NTLM proxy, and returns the updated configuration instance.
 BosClientConfiguration withProxyHost(String proxyHost)
          Sets the optional proxy host the client will connect through, and returns the updated configuration instance.
 BosClientConfiguration withProxyPassword(String proxyPassword)
          Sets the optional password to use when connecting through a proxy, and returns the updated configuration instance.
 BosClientConfiguration withProxyPort(int proxyPort)
          Sets the optional proxy port the client will connect through, and returns the updated configuration instance.
 BceClientConfiguration withProxyPreemptiveAuthenticationEnabled(boolean proxyPreemptiveAuthenticationEnabled)
          Sets whether to enable proxy preemptive authentication, and returns the updated configuration instance.
 BosClientConfiguration withProxyUsername(String proxyUsername)
          Sets the optional user name to use when connecting through a proxy, and returns the updated configuration instance.
 BosClientConfiguration withProxyWorkstation(String proxyWorkstation)
          Sets the optional Windows workstation to use when connecting through a Windows NTLM proxy, and returns the updated configuration instance.
 BosClientConfiguration withRegion(Region region)
          Sets the region of service, and returns the updated configuration instance.
 BosClientConfiguration withRetryPolicy(RetryPolicy retryPolicy)
          Sets the retry policy for failed requests, and returns the updated configuration instance.
 BosClientConfiguration withSocketBufferSizeInBytes(int socketBufferSizeInBytes)
          Sets the optional size (in bytes) for the low level TCP socket buffer, and returns the updated configuration instance.
 BosClientConfiguration withSocketTimeoutInMillis(int socketTimeoutInMillis)
          Sets the socket timeout (SO_TIMEOUT) in milliseconds, which is a maximum period inactivity between two consecutive data packets, and returns the updated configuration instance.
 BosClientConfiguration withStreamBufferSize(int streamBufferSize)
           
 BosClientConfiguration withUserAgent(String userAgent)
          Sets the User-Agent header value to use when sending requests to BCE services, and returns the updated configuration instance.
 
Methods inherited from class com.baidubce.BceClientConfiguration
getConnectionTimeoutInMillis, getCredentials, getEndpoint, getLocalAddress, getMaxConnections, getProtocol, getProxyDomain, getProxyHost, getProxyPassword, getProxyPort, getProxyUsername, getProxyWorkstation, getRegion, getRetryPolicy, getSocketBufferSizeInBytes, getSocketTimeoutInMillis, getUserAgent, isProxyPreemptiveAuthenticationEnabled, setConnectionTimeoutInMillis, setCredentials, setEndpoint, setLocalAddress, setMaxConnections, setProtocol, setProxyDomain, setProxyHost, setProxyPassword, setProxyPort, setProxyPreemptiveAuthenticationEnabled, setProxyUsername, setProxyWorkstation, setRegion, setRetryPolicy, setSocketBufferSizeInBytes, setSocketTimeoutInMillis, setUserAgent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_STREAM_BUFFER_SIZE

public static final int DEFAULT_STREAM_BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

BosClientConfiguration

public BosClientConfiguration()

BosClientConfiguration

public BosClientConfiguration(BceClientConfiguration clientConfiguration)

BosClientConfiguration

public BosClientConfiguration(BceClientConfiguration clientConfiguration,
                              String bosEndpoint)
Method Detail

getStreamBufferSize

public int getStreamBufferSize()

setStreamBufferSize

public void setStreamBufferSize(int streamBufferSize)

withStreamBufferSize

public BosClientConfiguration withStreamBufferSize(int streamBufferSize)

isCnameEnabled

public boolean isCnameEnabled()
Returns whether to enable using cname to visit bos resource.

Returns:
whether to enable using cname to visit bos resource.

setCnameEnabled

public void setCnameEnabled(boolean cnameEnabled)
Sets whether to enable using cname to visit bos resource.

Parameters:
cnameEnabled - whether to enable using cname to visit bos resource.

withCnameEnabled

public BosClientConfiguration withCnameEnabled(boolean cnameEnabled)

withProtocol

public BosClientConfiguration withProtocol(Protocol protocol)
Description copied from class: BceClientConfiguration
Sets the protocol (HTTP/HTTPS) to use when connecting to BCE services, and returns the updated configuration instance.

Overrides:
withProtocol in class BceClientConfiguration
Parameters:
protocol - the protocol (HTTP/HTTPS) to use when connecting to BCE services.
Returns:
the updated configuration instance.

withMaxConnections

public BosClientConfiguration withMaxConnections(int maxConnections)
Description copied from class: BceClientConfiguration
Sets the maximum number of open HTTP connections, and returns the updated configuration instance.

Overrides:
withMaxConnections in class BceClientConfiguration
Parameters:
maxConnections - the maximum number of open HTTP connections.
Returns:
the updated configuration instance.

withUserAgent

public BosClientConfiguration withUserAgent(String userAgent)
Description copied from class: BceClientConfiguration
Sets the User-Agent header value to use when sending requests to BCE services, and returns the updated configuration instance.

If the specified value is null, DEFAULT_USER_AGENT is used. If the specified value does not end with DEFAULT_USER_AGENT, DEFAULT_USER_AGENT is appended.

Overrides:
withUserAgent in class BceClientConfiguration
Parameters:
userAgent - the User-Agent header value to use when sending requests to BCE services.
Returns:
the updated configuration instance.

withLocalAddress

public BosClientConfiguration withLocalAddress(InetAddress localAddress)
Description copied from class: BceClientConfiguration
Sets the optional local address to bind when connecting to BCE services, and returns the updated configuration instance.

Overrides:
withLocalAddress in class BceClientConfiguration
Parameters:
localAddress - the optional local address to bind when connecting to BCE services.
Returns:
the updated configuration instance.

withProxyHost

public BosClientConfiguration withProxyHost(String proxyHost)
Description copied from class: BceClientConfiguration
Sets the optional proxy host the client will connect through, and returns the updated configuration instance.

The client will connect through the proxy only if the host is not null and the port is positive.

Overrides:
withProxyHost in class BceClientConfiguration
Parameters:
proxyHost - the optional proxy host the client will connect through.
Returns:
the updated configuration instance.

withProxyPort

public BosClientConfiguration withProxyPort(int proxyPort)
Description copied from class: BceClientConfiguration
Sets the optional proxy port the client will connect through, and returns the updated configuration instance.

The client will connect through the proxy only if the host is not null and the port is positive.

Overrides:
withProxyPort in class BceClientConfiguration
Parameters:
proxyPort - the optional proxy port the client will connect through.
Returns:
the updated configuration instance.

withProxyUsername

public BosClientConfiguration withProxyUsername(String proxyUsername)
Description copied from class: BceClientConfiguration
Sets the optional user name to use when connecting through a proxy, and returns the updated configuration instance.

Overrides:
withProxyUsername in class BceClientConfiguration
Parameters:
proxyUsername - the optional user name to use when connecting through a proxy.
Returns:
the updated configuration instance.

withProxyPassword

public BosClientConfiguration withProxyPassword(String proxyPassword)
Description copied from class: BceClientConfiguration
Sets the optional password to use when connecting through a proxy, and returns the updated configuration instance.

Overrides:
withProxyPassword in class BceClientConfiguration
Parameters:
proxyPassword - the optional password to use when connecting through a proxy.
Returns:
the updated configuration instance.

withProxyDomain

public BosClientConfiguration withProxyDomain(String proxyDomain)
Description copied from class: BceClientConfiguration
Sets the optional Windows domain to use when connecting through a Windows NTLM proxy, and returns the updated configuration instance.

Overrides:
withProxyDomain in class BceClientConfiguration
Parameters:
proxyDomain - the optional Windows domain to use when connecting through a Windows NTLM proxy.
Returns:
the updated configuration instance.

withProxyWorkstation

public BosClientConfiguration withProxyWorkstation(String proxyWorkstation)
Description copied from class: BceClientConfiguration
Sets the optional Windows workstation to use when connecting through a Windows NTLM proxy, and returns the updated configuration instance.

Overrides:
withProxyWorkstation in class BceClientConfiguration
Parameters:
proxyWorkstation - the optional Windows workstation to use when connecting through a Windows NTLM proxy.
Returns:
the updated configuration instance.

withRetryPolicy

public BosClientConfiguration withRetryPolicy(RetryPolicy retryPolicy)
Description copied from class: BceClientConfiguration
Sets the retry policy for failed requests, and returns the updated configuration instance.

Overrides:
withRetryPolicy in class BceClientConfiguration
Parameters:
retryPolicy - the retry policy for failed requests.
Returns:
the updated configuration instance.

withSocketTimeoutInMillis

public BosClientConfiguration withSocketTimeoutInMillis(int socketTimeoutInMillis)
Description copied from class: BceClientConfiguration
Sets the socket timeout (SO_TIMEOUT) in milliseconds, which is a maximum period inactivity between two consecutive data packets, and returns the updated configuration instance. A value of 0 means infinity, and is not recommended.

Overrides:
withSocketTimeoutInMillis in class BceClientConfiguration
Parameters:
socketTimeoutInMillis - the socket timeout (SO_TIMEOUT) in milliseconds.
Returns:
the updated configuration instance.

withConnectionTimeoutInMillis

public BosClientConfiguration withConnectionTimeoutInMillis(int connectionTimeoutInMillis)
Description copied from class: BceClientConfiguration
Sets the connection timeout in milliseconds, and returns the updated configuration instance. A value of 0 means infinity, and is not recommended.

Overrides:
withConnectionTimeoutInMillis in class BceClientConfiguration
Parameters:
connectionTimeoutInMillis - the connection timeout in milliseconds.
Returns:
the updated configuration instance.

withSocketBufferSizeInBytes

public BosClientConfiguration withSocketBufferSizeInBytes(int socketBufferSizeInBytes)
Description copied from class: BceClientConfiguration
Sets the optional size (in bytes) for the low level TCP socket buffer, and returns the updated configuration instance. This is an advanced option for advanced users who want to tune low level TCP parameters to try and squeeze out more performance. Ignored if not positive.

Overrides:
withSocketBufferSizeInBytes in class BceClientConfiguration
Parameters:
socketBufferSizeInBytes - the optional size (in bytes) for the low level TCP socket buffer.
Returns:
the updated configuration instance.

withProxyPreemptiveAuthenticationEnabled

public BceClientConfiguration withProxyPreemptiveAuthenticationEnabled(boolean proxyPreemptiveAuthenticationEnabled)
Description copied from class: BceClientConfiguration
Sets whether to enable proxy preemptive authentication, and returns the updated configuration instance. If it is true, the client will send the basic authentication response even before the proxy server gives an unauthorized response in certain situations, thus reducing the overhead of making the connection.

Overrides:
withProxyPreemptiveAuthenticationEnabled in class BceClientConfiguration
Parameters:
proxyPreemptiveAuthenticationEnabled - whether to enable proxy preemptive authentication.
Returns:
the updated configuration instance.

withEndpoint

public BosClientConfiguration withEndpoint(String endpoint)
Description copied from class: BceClientConfiguration
Sets the service endpoint URL to which the client will connect, and returns the updated configuration instance.

Overrides:
withEndpoint in class BceClientConfiguration
Parameters:
endpoint - the service endpoint URL to which the client will connect.
Returns:
the updated configuration instance.

withRegion

public BosClientConfiguration withRegion(Region region)
Description copied from class: BceClientConfiguration
Sets the region of service, and returns the updated configuration instance. This value is used by the client to construct the endpoint URL automatically, and is ignored if endpoint is not null.

If the specified region is null, sets to DEFAULT_REGION.

Overrides:
withRegion in class BceClientConfiguration
Parameters:
region - the region of service.
Returns:
the updated configuration instance.

withCredentials

public BosClientConfiguration withCredentials(BceCredentials credentials)
Description copied from class: BceClientConfiguration
Sets the BCE credentials used by the client to sign HTTP requests, and returns the updated configuration instance.

Overrides:
withCredentials in class BceClientConfiguration
Parameters:
credentials - the BCE credentials used by the client to sign HTTP requests.
Returns:
the updated configuration instance.


Copyright © 2018. All rights reserved.