public abstract class AmazonWebServiceClient extends Object
Responsible for basic client capabilities that are the same across all AWS SDK Java clients (ex: setting the client endpoint).
Modifier and Type | Field | Description |
---|---|---|
static boolean |
LOGGING_AWS_REQUEST_METRIC |
Deprecated.
No longer used.
|
Constructor | Description |
---|---|
AmazonWebServiceClient(LegacyClientConfiguration clientConfiguration) |
Constructs a new AmazonWebServiceClient object using the specified
configuration.
|
AmazonWebServiceClient(LegacyClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector) |
Constructs a new AmazonWebServiceClient object using the specified
configuration and request metric collector.
|
Modifier and Type | Method | Description |
---|---|---|
String |
getEndpointPrefix() |
Returns the service name that should be used when computing the region
endpoints.
|
RequestMetricCollector |
getRequestMetricsCollector() |
Returns the client specific
RequestMetricCollector ; or null if
there is none. |
String |
getServiceName() |
Returns the service abbreviation for this service, used for identifying
service endpoints by region, identifying the necessary signer, etc.
|
Signer |
getSignerByUri(URI uri) |
Returns the signer based on the given URI and the current AWS client
configuration.
|
String |
getSignerRegionOverride() |
Returns the signer region override.
|
int |
getTimeOffset() |
Returns the optional value for time offset for this client.
|
void |
makeImmutable() |
Deprecated.
|
void |
setEndpoint(String endpoint) |
Deprecated.
use
AwsClientBuilder.setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration) for example:
builder.setEndpointConfiguration(new EndpointConfiguration(endpoint, signingRegion)); |
void |
setRegion(Region region) |
Deprecated.
use
AwsClientBuilder#setRegion(Region) |
void |
setServiceNameIntern(String serviceName) |
An internal method used to explicitly override the service name
computed by the default implementation.
|
void |
setSignerRegionOverride(String signerRegionOverride) |
An internal method used to explicitly override the internal signer region
computed by the default implementation.
|
void |
setTimeOffset(int timeOffset) |
Sets the optional value for time offset for this client.
|
void |
shutdown() |
Shuts down this client object, releasing any resources that might be held
open.
|
<T extends AmazonWebServiceClient> |
withEndpoint(String endpoint) |
Deprecated.
use
AwsClientBuilder.withEndpointConfiguration(AwsClientBuilder.EndpointConfiguration) for example:
AmazonSNSClient.builder()
.withEndpointConfiguration(new EndpointConfiguration(endpoint, signingRegion)).build(); |
<T extends AmazonWebServiceClient> |
withRegion(Region region) |
Deprecated.
use
AwsClientBuilder.withRegion(Region) for example:
AmazonSNSClient.builder().withRegion(region).build(); |
AmazonWebServiceClient |
withTimeOffset(int timeOffset) |
Sets the optional value for time offset for this client.
|
@Deprecated public static final boolean LOGGING_AWS_REQUEST_METRIC
public AmazonWebServiceClient(LegacyClientConfiguration clientConfiguration)
clientConfiguration
- The client configuration for this client.public AmazonWebServiceClient(LegacyClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
clientConfiguration
- The client configuration for this client.requestMetricCollector
- optional request metric collector to be used at the http
client level; can be null.@Deprecated public void setEndpoint(String endpoint) throws IllegalArgumentException
AwsClientBuilder.setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration)
for example:
builder.setEndpointConfiguration(new EndpointConfiguration(endpoint, signingRegion));
This method is not threadsafe. Endpoints should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit.
Callers can pass in just the endpoint (ex: "ec2.amazonaws.com") or a full
URL, including the protocol (ex: "https://ec2.amazonaws.com"). If the
protocol is not specified here, the default protocol from this client's
LegacyClientConfiguration
will be used, which by default is HTTPS.
For more information on using AWS regions with the AWS SDK for Java, and a complete list of all available endpoints for all AWS services, see: http://developer.amazonwebservices.com/connect/entry.jspa?externalID=3912
endpoint
- The endpoint (ex: "ec2.amazonaws.com") or a full URL,
including the protocol (ex: "https://ec2.amazonaws.com") of
the region specific AWS endpoint this client will communicate
with.IllegalArgumentException
- If any problems are detected with the specified endpoint.public Signer getSignerByUri(URI uri)
Note, however, the signer returned for S3 is incomplete at this stage as the information on the S3 bucket and key is not yet known.
@Deprecated public void setRegion(Region region) throws IllegalArgumentException
AwsClientBuilder#setRegion(Region)
setEndpoint(String)
, sets the regional
endpoint for this client's service calls. Callers can use this method to control which AWS
region they want to work with.
This method is not threadsafe. A region should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit or retrying.
By default, all service endpoints in all regions use the https protocol. To use http instead,
specify it in the LegacyClientConfiguration
supplied at construction.
region
- The of this client will communicate with. See
Region.of(String)
for accessing a given
of.IllegalArgumentException
- If the given of is null, or if this service isn't available in the given
of. See Region#getRegionMetadata()
isServiceSupported(String)}LegacyClientConfiguration)
public void shutdown()
public AmazonWebServiceClient withTimeOffset(int timeOffset)
timeOffset
- The optional value for time offset (in seconds) for this client.public int getTimeOffset()
public void setTimeOffset(int timeOffset)
timeOffset
- The optional value for time offset (in seconds) for this client.public RequestMetricCollector getRequestMetricsCollector()
RequestMetricCollector
; or null if
there is none.public String getServiceName()
public String getEndpointPrefix()
public final void setServiceNameIntern(String serviceName)
public final String getSignerRegionOverride()
public final void setSignerRegionOverride(String signerRegionOverride)
@Deprecated public <T extends AmazonWebServiceClient> T withRegion(Region region)
AwsClientBuilder.withRegion(Region)
for example:
AmazonSNSClient.builder().withRegion(region).build();
setRegion(Region)
.
Example: AmazonDynamoDBClient client = new AmazonDynamoDBClient(...).<AmazonDynamoDBClient>withRegion(...);
setRegion(Region)
@Deprecated public <T extends AmazonWebServiceClient> T withEndpoint(String endpoint)
AwsClientBuilder.withEndpointConfiguration(AwsClientBuilder.EndpointConfiguration)
for example:
AmazonSNSClient.builder()
.withEndpointConfiguration(new EndpointConfiguration(endpoint, signingRegion)).build();
setEndpoint(String)
.
Example: AmazonDynamoDBClient client = new AmazonDynamoDBClient(...).<AmazonDynamoDBClient>withEndPoint(...);
setEndpoint(String)
@Deprecated public final void makeImmutable()
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.