Class AWSMarketplaceMeteringClient

java.lang.Object
com.amazonaws.AmazonWebServiceClient
com.amazonaws.services.marketplacemetering.AWSMarketplaceMeteringClient
All Implemented Interfaces:
AWSMarketplaceMetering
Direct Known Subclasses:
AWSMarketplaceMeteringAsyncClient

@ThreadSafe public class AWSMarketplaceMeteringClient extends AmazonWebServiceClient implements AWSMarketplaceMetering
Client for accessing AWSMarketplace Metering. All service calls made using this client are blocking, and will not return until the service call completes.

AWS Marketplace Metering Service

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.

  • Field Details

    • configFactory

      protected static final ClientConfigurationFactory configFactory
      Client configuration factory providing ClientConfigurations tailored to this client
  • Constructor Details

    • AWSMarketplaceMeteringClient

      public AWSMarketplaceMeteringClient()
      Constructs a new client to invoke service methods on AWSMarketplace Metering. A credentials provider chain will be used that searches for credentials in this order:
      • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
      • Java System Properties - aws.accessKeyId and aws.secretKey
      • Instance profile credentials delivered through the Amazon EC2 metadata service

      All service calls made using this new client object are blocking, and will not return until the service call completes.

      See Also:
    • AWSMarketplaceMeteringClient

      public AWSMarketplaceMeteringClient(ClientConfiguration clientConfiguration)
      Constructs a new client to invoke service methods on AWSMarketplace Metering. A credentials provider chain will be used that searches for credentials in this order:
      • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
      • Java System Properties - aws.accessKeyId and aws.secretKey
      • Instance profile credentials delivered through the Amazon EC2 metadata service

      All service calls made using this new client object are blocking, and will not return until the service call completes.

      Parameters:
      clientConfiguration - The client configuration options controlling how this client connects to AWSMarketplace Metering (ex: proxy settings, retry counts, etc.).
      See Also:
    • AWSMarketplaceMeteringClient

      public AWSMarketplaceMeteringClient(AWSCredentials awsCredentials)
      Constructs a new client to invoke service methods on AWSMarketplace Metering using the specified AWS account credentials.

      All service calls made using this new client object are blocking, and will not return until the service call completes.

      Parameters:
      awsCredentials - The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
    • AWSMarketplaceMeteringClient

      public 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.

      All service calls made using this new client object are blocking, and will not return until the service call completes.

      Parameters:
      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.).
    • AWSMarketplaceMeteringClient

      public AWSMarketplaceMeteringClient(AWSCredentialsProvider awsCredentialsProvider)
      Constructs a new client to invoke service methods on AWSMarketplace Metering using the specified AWS account credentials provider.

      All service calls made using this new client object are blocking, and will not return until the service call completes.

      Parameters:
      awsCredentialsProvider - The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
    • AWSMarketplaceMeteringClient

      public 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.

      All service calls made using this new client object are blocking, and will not return until the service call completes.

      Parameters:
      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.).
    • AWSMarketplaceMeteringClient

      public 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.

      All service calls made using this new client object are blocking, and will not return until the service call completes.

      Parameters:
      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 collector
  • Method Details

    • meterUsage

      public MeterUsageResult meterUsage(MeterUsageRequest meterUsageRequest)

      API to emit metering records. For identical requests, the API is idempotent. It simply returns the metering record ID.

      Specified by:
      meterUsage in interface AWSMarketplaceMetering
      Parameters:
      meterUsageRequest -
      Returns:
      Result of the MeterUsage operation returned by the service.
      Throws:
      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.
    • getCachedResponseMetadata

      public 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. This data isn't considered part of the result data returned by an operation, so it's available through this separate, diagnostic interface.

      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.

      Specified by:
      getCachedResponseMetadata in interface AWSMarketplaceMetering
      Parameters:
      request - The originally executed request
      Returns:
      The response metadata for the specified request, or null if none is available.