Package com.amazonaws.services.simpledb.model

Examples of com.amazonaws.services.simpledb.model.ListDomainsResult


        // get the existing domains for this region
        do {
            if (nextToken != null) request = request.withNextToken(nextToken);
           
            ListDomainsResult result = sdbService.listDomains(request);
            nextToken = result.getNextToken();
            domains.addAll(result.getDomainNames());
            System.out.println("The existing domains are: " + domains);
           
        } while (nextToken != null);

        return domains;
View Full Code Here


        try {
            domainSet = new HashSet<String>();
            logger.info("getting all domains");
            AmazonSimpleDB db = getSimpleDb();
            ListDomainsResult listDomainsResult = db.listDomains();
            domainSet.addAll(listDomainsResult.getDomainNames());
            while (listDomainsResult.getNextToken() != null) {
                ListDomainsRequest request = new ListDomainsRequest().withNextToken(listDomainsResult.getNextToken());
                listDomainsResult = db.listDomains(request);
                domainSet.addAll(listDomainsResult.getDomainNames());
            }
        } catch (AmazonClientException e) {
            throw new PersistenceException(e);
        }
    }
View Full Code Here

         * domains owned by the current user, and add up the number of items
         * (similar to rows of data in a relational DB) in each domain.
         */
        try {
            ListDomainsRequest sdbRequest = new ListDomainsRequest().withMaxNumberOfDomains(100);
            ListDomainsResult sdbResult = sdb.listDomains(sdbRequest);

            int totalItems = 0;
            for (String domainName : sdbResult.getDomainNames()) {
                DomainMetadataRequest metadataRequest = new DomainMetadataRequest().withDomainName(domainName);
                DomainMetadataResult domainMetadata = sdb.domainMetadata(metadataRequest);
                totalItems += domainMetadata.getItemCount();
            }

            System.out.println("You have " + sdbResult.getDomainNames().size() + " Amazon SimpleDB domain(s)" +
                    "containing a total of " + totalItems + " items.");
        } catch (AmazonServiceException ase) {
                System.out.println("Caught Exception: " + ase.getMessage());
                System.out.println("Reponse Status Code: " + ase.getStatusCode());
                System.out.println("Error Code: " + ase.getErrorCode());
View Full Code Here

TOP

Related Classes of com.amazonaws.services.simpledb.model.ListDomainsResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.