Example usage for com.amazonaws.services.simpledb.model DomainMetadataResult getAttributeNameCount

List of usage examples for com.amazonaws.services.simpledb.model DomainMetadataResult getAttributeNameCount

Introduction

In this page you can find the example usage for com.amazonaws.services.simpledb.model DomainMetadataResult getAttributeNameCount.

Prototype


public Integer getAttributeNameCount() 

Source Link

Document

The number of unique attribute names in the domain.

Usage

From source file:com.zotoh.cloudapi.aws.SDB.java

License:Open Source License

private KeyValueDatabase toKVD(String domain, DomainMetadataResult res) {
    KeyValueDatabase db = null;/*from  ww  w .  j av  a 2  s  .  c  o  m*/
    if (res != null) {
        db = new KeyValueDatabase();
        db.setDescription(domain);
        db.setItemCount(res.getItemCount());
        db.setItemSize(new Long(res.getItemNamesSizeBytes()).intValue());
        db.setKeyCount(res.getAttributeNameCount());
        db.setKeySize(new Long(res.getAttributeNamesSizeBytes()).intValue());
        db.setKeyValueCount(res.getAttributeValueCount());
        db.setKeyValueSize(new Long(res.getAttributeValuesSizeBytes()).intValue());
        db.setName(domain);
        db.setProviderDatabaseId(db.getName());
        db.setProviderOwnerId(_svc.getCloud().getContext().getAccountNumber());
        db.setProviderRegionId(_svc.getCloud().getContext().getRegionId());
    }
    return db;
}

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

License:Apache License

public void execute() {
    DomainMetadataRequest request = new DomainMetadataRequest().withDomainName(determineDomainName());
    log.trace("Sending request [{}] for exchange [{}]...", request, exchange);

    DomainMetadataResult result = this.sdbClient.domainMetadata(request);

    log.trace("Received result [{}]", result);

    Message msg = getMessageForResponse(exchange);
    msg.setHeader(SdbConstants.TIMESTAMP, result.getTimestamp());
    msg.setHeader(SdbConstants.ITEM_COUNT, result.getItemCount());
    msg.setHeader(SdbConstants.ATTRIBUTE_NAME_COUNT, result.getAttributeNameCount());
    msg.setHeader(SdbConstants.ATTRIBUTE_VALUE_COUNT, result.getAttributeValueCount());
    msg.setHeader(SdbConstants.ATTRIBUTE_NAME_SIZE, result.getAttributeNamesSizeBytes());
    msg.setHeader(SdbConstants.ATTRIBUTE_VALUE_SIZE, result.getAttributeValuesSizeBytes());
    msg.setHeader(SdbConstants.ITEM_NAME_SIZE, result.getItemNamesSizeBytes());
}

From source file:org.teiid.resource.adapter.simpledb.SimpleDBConnectionImpl.java

License:Open Source License

@Override
public Set<SimpleDBAttribute> getAttributeNames(String domainName) throws TranslatorException {
    DomainMetadataRequest domainMetadataRequest = new DomainMetadataRequest(domainName);
    DomainMetadataResult metadataResult = client.domainMetadata(domainMetadataRequest);
    int attributesCount = metadataResult.getAttributeNameCount();
    SelectResult selectResult = client.select(new SelectRequest("SELECT * FROM " + domainName)); //$NON-NLS-1$
    return getAttributeNamesFromSelectResult(selectResult, attributesCount);
}

From source file:org.teiid.resource.adpter.simpledb.SimpleDbAPIClass.java

License:Open Source License

/**
 * //ww w  . j ava2 s  .c  o m
 * @param domainName 
 * @return Set of attribute names for given domain
 */

public Set<String> getAttributeNames(String domainName) {
    DomainMetadataRequest domainMetadataRequest = new DomainMetadataRequest(domainName);
    DomainMetadataResult metadataResult = client.domainMetadata(domainMetadataRequest);
    int attributesCount = metadataResult.getAttributeNameCount();
    SelectResult selectResult = client.select(new SelectRequest("SELECT * FROM " + domainName)); //$NON-NLS-1$
    return getAttributeNamesFromSelectResult(selectResult, attributesCount);

}