• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ListDomainsRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.amazonaws.services.simpledb.model.ListDomainsRequest的典型用法代码示例。如果您正苦于以下问题:Java ListDomainsRequest类的具体用法?Java ListDomainsRequest怎么用?Java ListDomainsRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ListDomainsRequest类属于com.amazonaws.services.simpledb.model包,在下文中一共展示了ListDomainsRequest类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getTables

import com.amazonaws.services.simpledb.model.ListDomainsRequest; //导入依赖的package包/类
/**
 * @{inheritDoc
 */
public Set<String> getTables(String regex) {
    Set<String> result = new HashSet<String>();
    ListDomainsResult listDomains = null;
    String nextToken = null;
    do {
        listDomains = db.listDomains(new ListDomainsRequest().withNextToken(nextToken));
        for (String s : listDomains.getDomainNames()) {
            if (s.matches(regex)) {
                result.add(s);
            }
        }
        nextToken = listDomains.getNextToken();
    } while (nextToken != null);
    return result;
}
 
开发者ID:intuit,项目名称:Tank,代码行数:19,代码来源:AmazonSimpleDatabase.java


示例2: hasTable

import com.amazonaws.services.simpledb.model.ListDomainsRequest; //导入依赖的package包/类
/**
 * 
 * @{inheritDoc
 */
public boolean hasTable(@Nonnull String tableName) {
    boolean hasMore = true;
    String nextToken = null;
    while (hasMore) {
        ListDomainsResult listDomains = db.listDomains(new ListDomainsRequest().withNextToken(nextToken));
        for (String name : listDomains.getDomainNames()) {
            if (tableName.equalsIgnoreCase(name)) {
                return true;
            }
        }
        nextToken = listDomains.getNextToken();
        hasMore = !StringUtils.isEmpty(nextToken);
    }
    return false;
}
 
开发者ID:intuit,项目名称:Tank,代码行数:20,代码来源:AmazonSimpleDatabase.java


示例3: filterExisting

import com.amazonaws.services.simpledb.model.ListDomainsRequest; //导入依赖的package包/类
/**
 * 
 * @param tableName
 * @return
 */
public List<String> filterExisting(List<String> tableName) {
    boolean hasMore = true;
    String nextToken = null;

    List<String> ret = new ArrayList<String>(tableName.size());
    Set<String> tables = new HashSet<String>();
    while (hasMore) {
        ListDomainsResult listDomains = db.listDomains(new ListDomainsRequest().withNextToken(nextToken));
        tables.addAll(listDomains.getDomainNames());
        nextToken = listDomains.getNextToken();
        hasMore = !StringUtils.isEmpty(nextToken);
    }
    for (String name : tableName) {
        if (tables.contains(name)) {
            ret.add(name);
        }
    }
    return ret;
}
 
开发者ID:intuit,项目名称:Tank,代码行数:25,代码来源:AmazonSimpleDatabase.java


示例4: provideRings

import com.amazonaws.services.simpledb.model.ListDomainsRequest; //导入依赖的package包/类
@Provides @Named(RINGS_PROPERTY)
Set<String> provideRings(AmazonSimpleDBClient client, CassandraDomainFactory domainFactory) {
  List<String> rings = Lists.newArrayList();
  String nextToken = null;

  do {
    ListDomainsRequest request = new ListDomainsRequest().withNextToken(nextToken);
    ListDomainsResult result = client.listDomains(request);
    for (String domain : result.getDomainNames()) {
      CassandraDomain cassandraDomain = domainFactory.createFromDomain(domain);
      if (cassandraDomain != null) {
        rings.add(cassandraDomain.getRing());
      }
    }
    nextToken = result.getNextToken();
  } while (nextToken != null);
  return ImmutableSet.copyOf(rings);
}
 
开发者ID:signal,项目名称:agathon,代码行数:19,代码来源:SdbDaoModule.java


示例5: manageDomains_should_create_domains_referred_by_repository

import com.amazonaws.services.simpledb.model.ListDomainsRequest; //导入依赖的package包/类
@Test
public void manageDomains_should_create_domains_referred_by_repository() {
	AmazonSimpleDB sdb = operations.getDB();

	final String domainPrefix = operations.getSimpleDb().getDomainPrefix();

	ListDomainsResult listDomainsResult = sdb.listDomains(new ListDomainsRequest());
	List<String> domainNames = listDomainsResult.getDomainNames();
	String nextToken = listDomainsResult.getNextToken(); 
	while (nextToken != null && !nextToken.isEmpty()) {
		listDomainsResult = sdb.listDomains(new ListDomainsRequest().withNextToken(nextToken));
		domainNames.addAll(listDomainsResult.getDomainNames());
		nextToken = listDomainsResult.getNextToken();
	}

	assertThat(domainNames.contains(domainPrefix + ".simpleDbReferences"), is(true));
	assertThat(domainNames.contains(domainPrefix + ".firstNestedEntity"), is(true));
	assertThat(domainNames.contains(domainPrefix + ".secondNestedEntity"), is(true));

	Assert.assertNotNull(operations);
}
 
开发者ID:3pillarlabs,项目名称:spring-data-simpledb,代码行数:22,代码来源:SimpleDbReferencesRepositoryTest.java


示例6: execute

import com.amazonaws.services.simpledb.model.ListDomainsRequest; //导入依赖的package包/类
public void execute() {
    ListDomainsRequest request = new ListDomainsRequest()
        .withMaxNumberOfDomains(determineMaxNumberOfDomains())
        .withNextToken(determineNextToken());
    log.trace("Sending request [{}] for exchange [{}]...", request, exchange);
    
    ListDomainsResult result = this.sdbClient.listDomains(request);
    
    log.trace("Received result [{}]", result);
    
    Message msg = getMessageForResponse(exchange);
    msg.setHeader(SdbConstants.NEXT_TOKEN, result.getNextToken());
    msg.setHeader(SdbConstants.DOMAIN_NAMES, result.getDomainNames());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:15,代码来源:ListDomainsCommand.java


示例7: listDomains

import com.amazonaws.services.simpledb.model.ListDomainsRequest; //导入依赖的package包/类
@Override
public ListDomainsResult listDomains(ListDomainsRequest listDomainsRequest) throws AmazonServiceException, AmazonClientException {
    this.listDomainsRequest = listDomainsRequest;
    
    ListDomainsResult result = new ListDomainsResult();
    result.getDomainNames().add("DOMAIN1");
    result.getDomainNames().add("DOMAIN2");
    result.setNextToken("TOKEN2");
    return result;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:11,代码来源:AmazonSDBClientMock.java


示例8: simpleDB_demo

import com.amazonaws.services.simpledb.model.ListDomainsRequest; //导入依赖的package包/类
public static void simpleDB_demo(){


        System.out.println("- - - - - - - - - - - - - - - - - - - - - -");
        System.out.println("SimpleDB DEMO");

        /*
         * Amazon SimpleDB
         *
         * The AWS SimpleDB client allows you to query and manage your data
         * stored in SimpleDB domains (similar to tables in a relational DB).
         *
         * In this sample, we use a SimpleDB client to iterate over all the
         * 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("Response Status Code: " + ase.getStatusCode());
                System.out.println("Error Code: " + ase.getErrorCode());
                System.out.println("Request ID: " + ase.getRequestId());
        }

    }
 
开发者ID:OPENDAP,项目名称:olfs,代码行数:38,代码来源:demo.java


示例9: getDomainNames

import com.amazonaws.services.simpledb.model.ListDomainsRequest; //导入依赖的package包/类
/**
 * @param numDomains
 * @param nextToken
 * @return list of domain names
 */
private static List<String> getDomainNames(int numDomains, String nextToken) {
    ListDomainsRequest req = new ListDomainsRequest();
    req.setMaxNumberOfDomains(numDomains);
    if (nextToken != null)
        req.setNextToken(nextToken);
    ListDomainsResult result = getInstance().listDomains(req);
    List<String> domains = result.getDomainNames();
    SimpleDB.nextToken = result.getNextToken();
    return domains;
}
 
开发者ID:pgodzin,项目名称:QuotesSocial,代码行数:16,代码来源:SimpleDB.java


示例10: exists

import com.amazonaws.services.simpledb.model.ListDomainsRequest; //导入依赖的package包/类
protected boolean exists(final String domainName, final AmazonSimpleDB sdb) {
	try {
		ListDomainsResult listDomainsResult = sdb.listDomains(new ListDomainsRequest());
		List<String> domainNames = listDomainsResult.getDomainNames();
		String nextToken = listDomainsResult.getNextToken(); 
		while (nextToken != null && !nextToken.isEmpty()) {
			listDomainsResult = sdb.listDomains(new ListDomainsRequest().withNextToken(nextToken));
			domainNames.addAll(listDomainsResult.getDomainNames());
			nextToken = listDomainsResult.getNextToken();
		}
		return domainNames.contains(domainName);
	} catch(AmazonClientException amazonException) {
		throw SimpleDbExceptionTranslator.getTranslatorInstance().translateAmazonClientException(amazonException);
	}
}
 
开发者ID:3pillarlabs,项目名称:spring-data-simpledb,代码行数:16,代码来源:DomainManager.java


示例11: scanSimpleDB

import com.amazonaws.services.simpledb.model.ListDomainsRequest; //导入依赖的package包/类
/**
 * Collect data for SimpleDB.
 *
 * @param stats
 *            current statistics object.
 * @param account
 *            currently used credentials object.
 * @param region
 *            currently used aws region.
 */
public static void scanSimpleDB(AwsStats stats, AwsAccount account, Regions region) {
	if (region == Regions.EU_CENTRAL_1)
		return;

	LOG.debug("Scan for SimpleDB in region " + region.getName() + " in account " + account.getAccountId());

	/*
	 * Amazon SimpleDB
	 * 
	 * The AWS SimpleDB client allows you to query and manage your data
	 * stored in SimpleDB domains (similar to tables in a relational DB).
	 * 
	 * In this sample, we use a SimpleDB client to iterate over all the
	 * 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 {
		AmazonSimpleDB simpleDB = new AmazonSimpleDBClient(account.getCredentials());
		simpleDB.setRegion(Region.getRegion(region));

		ListDomainsRequest sdbRequest = new ListDomainsRequest().withMaxNumberOfDomains(100);
		ListDomainsResult sdbResult = simpleDB.listDomains(sdbRequest);

		int totalItems = 0;
		for (String domainName : sdbResult.getDomainNames()) {
			DomainMetadataRequest metadataRequest = new DomainMetadataRequest().withDomainName(domainName);
			DomainMetadataResult domainMetadata = simpleDB.domainMetadata(metadataRequest);
			int items = domainMetadata.getItemCount();
			totalItems += items;
			AwsResource res = new AwsResource(domainName, account.getAccountId(), AwsResourceType.SimpleDB, region);
			res.addInfo(AwsTag.Items, items);
			stats.add(res);
		}

		LOG.info(sdbResult.getDomainNames().size() + " SimpleDB domains containing a total of " + totalItems + " items in region " + region.getName()
				+ " in account " + account.getAccountId());
	} catch (AmazonServiceException ase) {
		LOG.error("Exception of SimpleDB: " + ase.getMessage());
	} catch (Exception ex) {
		LOG.error("Exception of SimpleDB: " + ex.getMessage());
	}
}
 
开发者ID:janloeffler,项目名称:aws-utilization-monitor,代码行数:53,代码来源:AwsScan.java



注:本文中的com.amazonaws.services.simpledb.model.ListDomainsRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JobManager类代码示例发布时间:2022-05-23
下一篇:
Java Table类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap