@ThreadSafe public class AWSMarketplaceMeteringClient extends AmazonWebServiceClient implements AWSMarketplaceMetering
This reference provides descriptions of the low-level AWS Marketplace Metering Service API.
AWS Marketplace sellers can use this API to submit usage data for custom usage dimensions.
Submitting Metering Records
MeterUsage- Submits the metering record for a Marketplace product.
Modifier and Type | Field and Description |
---|---|
private AWSCredentialsProvider |
awsCredentialsProvider
Provider for AWS credentials.
|
protected static ClientConfigurationFactory |
configFactory
Client configuration factory providing ClientConfigurations tailored to
this client
|
private static java.lang.String |
DEFAULT_ENDPOINT_PREFIX
The region metadata service name for computing region endpoints.
|
private static java.lang.String |
DEFAULT_SIGNING_NAME
Default signing name for the service.
|
private static org.apache.commons.logging.Log |
log |
private SdkJsonProtocolFactory |
protocolFactory |
client, clientConfiguration, endpoint, LOGGING_AWS_REQUEST_METRIC, requestHandler2s, timeOffset
Constructor and Description |
---|
AWSMarketplaceMeteringClient()
Constructs a new client to invoke service methods on AWSMarketplace
Metering.
|
AWSMarketplaceMeteringClient(AWSCredentials awsCredentials)
Constructs a new client to invoke service methods on AWSMarketplace
Metering using the specified AWS account credentials.
|
AWSMarketplaceMeteringClient(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AWSMarketplace
Metering using the specified AWS account credentials and client
configuration options.
|
AWSMarketplaceMeteringClient(AWSCredentialsProvider awsCredentialsProvider)
Constructs a new client to invoke service methods on AWSMarketplace
Metering using the specified AWS account credentials provider.
|
AWSMarketplaceMeteringClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AWSMarketplace
Metering using the specified AWS account credentials provider and client
configuration options.
|
AWSMarketplaceMeteringClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector)
Constructs a new client to invoke service methods on AWSMarketplace
Metering using the specified AWS account credentials provider, client
configuration options, and request metric collector.
|
AWSMarketplaceMeteringClient(ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AWSMarketplace
Metering.
|
Modifier and Type | Method and Description |
---|---|
private <X,Y extends AmazonWebServiceRequest> |
anonymousInvoke(Request<Y> request,
HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
ExecutionContext executionContext)
Invoke with no authentication.
|
private <X,Y extends AmazonWebServiceRequest> |
doInvoke(Request<Y> request,
HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
ExecutionContext executionContext)
Invoke the request using the http client.
|
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Returns additional metadata for a previously executed successful,
request, typically used for debugging issues where a service isn't acting
as expected.
|
private void |
init() |
private <X,Y extends AmazonWebServiceRequest> |
invoke(Request<Y> request,
HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
ExecutionContext executionContext)
Normal invoke with authentication.
|
MeterUsageResult |
meterUsage(MeterUsageRequest meterUsageRequest)
API to emit metering records.
|
addRequestHandler, addRequestHandler, beforeMarshalling, configureRegion, createExecutionContext, createExecutionContext, createExecutionContext, endClientExecution, endClientExecution, findRequestMetricCollector, getEndpointPrefix, getRequestMetricsCollector, getServiceAbbreviation, getServiceName, getServiceNameIntern, getSigner, getSignerByURI, getSignerRegionOverride, getTimeOffset, isProfilingEnabled, isRequestMetricsEnabled, removeRequestHandler, removeRequestHandler, requestMetricCollector, setEndpoint, setEndpointPrefix, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, shutdown, withEndpoint, withRegion, withRegion, withTimeOffset
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setEndpoint, setRegion, shutdown
private AWSCredentialsProvider awsCredentialsProvider
private static final org.apache.commons.logging.Log log
private static final java.lang.String DEFAULT_SIGNING_NAME
private static final java.lang.String DEFAULT_ENDPOINT_PREFIX
protected static final ClientConfigurationFactory configFactory
private final SdkJsonProtocolFactory protocolFactory
public AWSMarketplaceMeteringClient()
All service calls made using this new client object are blocking, and will not return until the service call completes.
DefaultAWSCredentialsProviderChain
public AWSMarketplaceMeteringClient(ClientConfiguration clientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
clientConfiguration
- The client configuration options controlling how this client
connects to AWSMarketplace Metering (ex: proxy settings, retry
counts, etc.).DefaultAWSCredentialsProviderChain
public AWSMarketplaceMeteringClient(AWSCredentials awsCredentials)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key) to use when
authenticating with AWS services.public AWSMarketplaceMeteringClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key) to use when
authenticating with AWS services.clientConfiguration
- The client configuration options controlling how this client
connects to AWSMarketplace Metering (ex: proxy settings, retry
counts, etc.).public AWSMarketplaceMeteringClient(AWSCredentialsProvider awsCredentialsProvider)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to
authenticate requests with AWS services.public AWSMarketplaceMeteringClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to
authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this client
connects to AWSMarketplace Metering (ex: proxy settings, retry
counts, etc.).public AWSMarketplaceMeteringClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to
authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this client
connects to AWSMarketplace Metering (ex: proxy settings, retry
counts, etc.).requestMetricCollector
- optional request metric collectorprivate void init()
public MeterUsageResult meterUsage(MeterUsageRequest meterUsageRequest)
API to emit metering records. For identical requests, the API is idempotent. It simply returns the metering record ID.
meterUsage
in interface AWSMarketplaceMetering
meterUsageRequest
- InternalServiceErrorException
- An internal error has occurred. Retry your request. If the
problem persists, post a message with details on the AWS forums.InvalidProductCodeException
- The product code passed does not match the product code used for
publishing the product.InvalidUsageDimensionException
- The usage dimension does not match one of the UsageDimensions
associated with products.InvalidEndpointRegionException
- The endpoint being called is in a region different from your EC2
instance. The region of the Metering service endpoint and the
region of the EC2 instance must match.TimestampOutOfBoundsException
- The timestamp value passed in the meterUsage() is out of allowed
range.DuplicateRequestException
- A metering record has already been emitted by the same EC2
instance for the given {usageDimension, timestamp} with a
different usageQuantity.ThrottlingException
- The calls to the MeterUsage API are throttled.public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.
getCachedResponseMetadata
in interface AWSMarketplaceMetering
request
- The originally executed requestprivate <X,Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext)
private <X,Y extends AmazonWebServiceRequest> Response<X> anonymousInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext)
private <X,Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext)