当前位置: 首页>>代码示例>>Java>>正文


Java ListDomainsResult.getNextToken方法代码示例

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


在下文中一共展示了ListDomainsResult.getNextToken方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTables

import com.amazonaws.services.simpledb.model.ListDomainsResult; //导入方法依赖的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.ListDomainsResult; //导入方法依赖的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.ListDomainsResult; //导入方法依赖的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.ListDomainsResult; //导入方法依赖的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.ListDomainsResult; //导入方法依赖的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: getDomainNames

import com.amazonaws.services.simpledb.model.ListDomainsResult; //导入方法依赖的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

示例7: exists

import com.amazonaws.services.simpledb.model.ListDomainsResult; //导入方法依赖的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


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