Package com.amazonaws.services.dynamodb.model

Examples of com.amazonaws.services.dynamodb.model.ListTablesRequest


import com.fasterxml.jackson.core.JsonToken;

public class ListTablesRequestJsonUnmarshaller implements Unmarshaller<ListTablesRequest, JsonUnmarshallerContext> {

    public ListTablesRequest unmarshall(JsonUnmarshallerContext context) throws Exception {
        ListTablesRequest request = new ListTablesRequest();

        int originalDepth = context.getCurrentDepth();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.currentToken;
        if (token == null) token = context.nextToken();

        while (true) {
            if (token == null) break;

            if (token == JsonToken.FIELD_NAME || token == JsonToken.START_OBJECT) {
                if (context.testExpression("ExclusiveStartTableName", targetDepth)) {
                    context.nextToken();
                    request.setExclusiveStartTableName(SimpleTypeJsonUnmarshallers.StringJsonUnmarshaller.getInstance().unmarshall(context));
                }
                if (context.testExpression("Limit", targetDepth)) {
                    context.nextToken();
                    request.setLimit(SimpleTypeJsonUnmarshallers.IntegerJsonUnmarshaller.getInstance().unmarshall(context));
                }
            } else if (token == JsonToken.END_ARRAY || token == JsonToken.END_OBJECT) {
                if (context.getCurrentDepth() <= originalDepth) break;
            }
            token = context.nextToken();
View Full Code Here


    return invoke(request, responseHandler);
  }

  public ListTablesResult listTables() throws AmazonServiceException, AmazonClientException {
    return listTables(new ListTablesRequest());
  }
View Full Code Here

  @Test
  public void listTablesWithLimitOverTableCount() {
    String name = createTableName();
    createTable(name);
    ListTablesResult res = getClient().listTables(new ListTablesRequest().withLimit(5));
    Assert.assertTrue(res.getTableNames().contains(name));
    Assert.assertTrue(res.getTableNames().size() == 1);
  }
View Full Code Here

  public void listTablesWithLimitUnderTableCount() {
    String name = createTableName();
    createTable();
    createTable(name);
    createTable();
    ListTablesResult res = getClient().listTables(new ListTablesRequest().withLimit(2));
    Assert.assertTrue(res.getTableNames().contains(name));
    Assert.assertTrue(res.getTableNames().size() == 2);
  }
View Full Code Here

  public void listTablesWithExclusiveTableName() {
    String name = createTableName();
    createTable();
    createTable();
    createTable(name);
    ListTablesResult res = getClient().listTables(new ListTablesRequest().withExclusiveStartTableName(name));
    Assert.assertTrue(res.getTableNames().contains(name));
    Assert.assertTrue(res.getTableNames().size() == 1);
  }
View Full Code Here

    createTable();
    createTable();
    createTable(name);
    createTable();
    createTable();
    ListTablesResult res = getClient().listTables(new ListTablesRequest().withLimit(1).withExclusiveStartTableName(name));
    Assert.assertTrue(res.getTableNames().contains(name));
    Assert.assertTrue(res.getTableNames().size() == 1);
  }
View Full Code Here

    createTable();
    createTable(name);
    createTable();
    createTable();
    createTable();
    ListTablesResult res = getClient().listTables(new ListTablesRequest().withLimit(10).withExclusiveStartTableName(name));
    Assert.assertTrue(res.getTableNames().contains(name));
    Assert.assertTrue(res.getTableNames().size() == 4);
  }
View Full Code Here

  }

  protected void deleteAllTables() {
    String lastTableName = null;
    while (true) {
      ListTablesResult res = getClient().listTables(new ListTablesRequest().withExclusiveStartTableName(lastTableName));
      for (String tableName : res.getTableNames()) {
        getClient().deleteTable(new DeleteTableRequest(tableName));
      }
      lastTableName = res.getLastEvaluatedTableName();
      if (lastTableName == null) {
View Full Code Here

     * @throws AmazonServiceException
     *             If an error response is returned by AmazonDynamoDB indicating
     *             either a problem with the data in the request, or a server side issue.
     */
    public ListTablesResult listTables() throws AmazonServiceException, AmazonClientException {
        return listTables(new ListTablesRequest());
    }
View Full Code Here

     * @throws AmazonServiceException
     *             If an error response is returned by AmazonDynamoDB indicating
     *             either a problem with the data in the request, or a server side issue.
     */
    public ListTablesResult listTables() throws AmazonServiceException, AmazonClientException {
        return listTables(new ListTablesRequest());
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodb.model.ListTablesRequest

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.