Example usage for com.amazonaws.services.simpledb AmazonSimpleDB domainMetadata

List of usage examples for com.amazonaws.services.simpledb AmazonSimpleDB domainMetadata

Introduction

In this page you can find the example usage for com.amazonaws.services.simpledb AmazonSimpleDB domainMetadata.

Prototype

DomainMetadataResult domainMetadata(DomainMetadataRequest domainMetadataRequest);

Source Link

Document

Returns information about the domain, including when the domain was created, the number of items and attributes in the domain, and the size of the attribute names and values.

Usage

From source file:org.apache.camel.component.aws.sdb.SdbEndpoint.java

License:Apache License

@Override
public void doStart() throws Exception {
    super.doStart();

    AmazonSimpleDB sdbClient = getSdbClient();
    String domainName = getConfiguration().getDomainName();
    LOG.trace("Querying whether domain [{}] already exists...", domainName);

    try {//from w  ww . j a  v a 2 s . c om
        sdbClient.domainMetadata(new DomainMetadataRequest(domainName));
        LOG.trace("Domain [{}] already exists", domainName);
        return;
    } catch (NoSuchDomainException ase) {
        LOG.trace("Domain [{}] doesn't exist yet", domainName);
        LOG.trace("Creating domain [{}]...", domainName);
        sdbClient.createDomain(new CreateDomainRequest(domainName));
        LOG.trace("Domain [{}] created", domainName);
    }
}