Package com.amazonaws.services.dynamodb.model

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


   * @throws IOException
   */
  @Override
  public boolean schemaExists() {
    LOG.info("Verifying schemas.");
  TableDescription success = null;
  if (mapping.getTables().isEmpty())  throw new IllegalStateException("There are not tables defined.");
  if (preferredSchema == null){
    LOG.debug("Verifying schemas");
    if (mapping.getTables().isEmpty())  throw new IllegalStateException("There are not tables defined.");
    // read the mapping object
View Full Code Here


   * Retrieves the table description for the specific resource name
   * @param tableName
   * @return
   */
  private TableDescription getTableSchema(String tableName){
    TableDescription tableDescription = null;
    try{
      DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(tableName);
      tableDescription = dynamoDBClient.describeTable(describeTableRequest).getTable();
    }
    catch(ResourceNotFoundException e){
View Full Code Here

    }

    public static com.amazonaws.services.dynamodbv2.model.CreateTableResult MapV1CreateTableResultToV2(
            CreateTableResult result) {

        TableDescription table = result.getTableDescription();
        com.amazonaws.services.dynamodbv2.model.TableDescription v2Table = MapV2TableDescriptionToV1(table);
        com.amazonaws.services.dynamodbv2.model.CreateTableResult v2result =
            new com.amazonaws.services.dynamodbv2.model.CreateTableResult()
                .withTableDescription(v2Table)
                ;
View Full Code Here

    }

    public static com.amazonaws.services.dynamodbv2.model.DescribeTableResult MapV1DescribeTableResultToV2(
            DescribeTableResult result) {

        TableDescription table = result.getTable();
        com.amazonaws.services.dynamodbv2.model.TableDescription v2Table = MapV2TableDescriptionToV1(table);
        com.amazonaws.services.dynamodbv2.model.DescribeTableResult v2result =
            new com.amazonaws.services.dynamodbv2.model.DescribeTableResult()
                .withTable(v2Table)
                ;
View Full Code Here

    }

    public static com.amazonaws.services.dynamodbv2.model.DeleteTableResult MapV1DeleteTableResultToV2(
            DeleteTableResult result) {

        TableDescription table = result.getTableDescription();
        com.amazonaws.services.dynamodbv2.model.TableDescription v2Table = MapV2TableDescriptionToV1(table);
        com.amazonaws.services.dynamodbv2.model.DeleteTableResult v2result =
            new com.amazonaws.services.dynamodbv2.model.DeleteTableResult()
                .withTableDescription(v2Table)
                ;
View Full Code Here

    }

    public static com.amazonaws.services.dynamodbv2.model.UpdateTableResult MapV1UpdateTableResultToV2(
            UpdateTableResult result) {

        TableDescription table = result.getTableDescription();
        com.amazonaws.services.dynamodbv2.model.TableDescription v2Table = MapV2TableDescriptionToV1(table);
        com.amazonaws.services.dynamodbv2.model.UpdateTableResult v2result =
            new com.amazonaws.services.dynamodbv2.model.UpdateTableResult()
                .withTableDescription(v2Table)
                ;
View Full Code Here

  public Date getLastIncreaseDateTime() {
    return lastIncreaseDateTime;
  }

  public TableDescription getTableDescription() {
    TableDescription desc = new TableDescription();
    desc.setTableName(getName());
    desc.setTableStatus(getStatus());
    desc.setItemCount(getItemCount());
    desc.setTableSizeBytes(getSizeBytes());
    desc.setCreationDateTime(getCreationDate());
    desc.setKeySchema(getKeySchema());
    desc.setProvisionedThroughput(getProvisionedThroughputDescription());
    return desc;
  }
View Full Code Here

    try {
      StringWriter stringWriter = new StringWriter();
      JSONWriter jsonWriter = new JSONWriter(stringWriter);
      jsonWriter.object();

      TableDescription table = describeTableResult.getTable();
      if (table != null) {
        jsonWriter.key("Table").object();
        jsonWriter.key("ItemCount").value(table.getItemCount());
        jsonWriter.key("TableName").value(table.getTableName());
        jsonWriter.key("TableSizeBytes").value(table.getTableSizeBytes());
        jsonWriter.key("TableStatus").value(table.getTableStatus());
        jsonWriter.key("CreationDateTime").value(table.getCreationDateTime());

        KeySchema keySchema = table.getKeySchema();
        if (keySchema != null) {
          jsonWriter.key("KeySchema").object();
          KeySchemaElement hashKeyElement = keySchema.getHashKeyElement();
          if (hashKeyElement != null) {
            jsonWriter.key("HashKeyElement").object();
            if (hashKeyElement.getAttributeName() != null) {
              jsonWriter.key("AttributeName").value(hashKeyElement.getAttributeName());
            }
            if (hashKeyElement.getAttributeType() != null) {
              jsonWriter.key("AttributeType").value(hashKeyElement.getAttributeType());
            }
            jsonWriter.endObject();
          }

          KeySchemaElement rangeKeyElement = keySchema.getRangeKeyElement();
          if (rangeKeyElement != null) {
            jsonWriter.key("RangeKeyElement").object();
            if (rangeKeyElement.getAttributeName() != null) {
              jsonWriter.key("AttributeName").value(rangeKeyElement.getAttributeName());
            }
            if (rangeKeyElement.getAttributeType() != null) {
              jsonWriter.key("AttributeType").value(rangeKeyElement.getAttributeType());
            }
            jsonWriter.endObject();
          }
          jsonWriter.endObject();
        }

        ProvisionedThroughputDescription provisionedThroughput = table.getProvisionedThroughput();
        if (provisionedThroughput != null) {
          jsonWriter.key("ProvisionedThroughput").object();
          if (provisionedThroughput.getReadCapacityUnits() != null) {
            jsonWriter.key("ReadCapacityUnits").value(provisionedThroughput.getReadCapacityUnits());
          }
View Full Code Here

    try {
      StringWriter stringWriter = new StringWriter();
      JSONWriter jsonWriter = new JSONWriter(stringWriter);
      jsonWriter.object();

      TableDescription table = describeTableResult.getTableDescription();
      if (table != null) {
        jsonWriter.key("TableDescription").object();
        jsonWriter.key("TableName").value(table.getTableName());
        jsonWriter.key("TableStatus").value(table.getTableStatus());
        jsonWriter.key("CreationDateTime").value(table.getCreationDateTime());

        KeySchema keySchema = table.getKeySchema();
        if (keySchema != null) {
          jsonWriter.key("KeySchema").object();
          KeySchemaElement hashKeyElement = keySchema.getHashKeyElement();
          if (hashKeyElement != null) {
            jsonWriter.key("HashKeyElement").object();
            if (hashKeyElement.getAttributeName() != null) {
              jsonWriter.key("AttributeName").value(hashKeyElement.getAttributeName());
            }
            if (hashKeyElement.getAttributeType() != null) {
              jsonWriter.key("AttributeType").value(hashKeyElement.getAttributeType());
            }
            jsonWriter.endObject();
          }

          KeySchemaElement rangeKeyElement = keySchema.getRangeKeyElement();
          if (rangeKeyElement != null) {
            jsonWriter.key("RangeKeyElement").object();
            if (rangeKeyElement.getAttributeName() != null) {
              jsonWriter.key("AttributeName").value(rangeKeyElement.getAttributeName());
            }
            if (rangeKeyElement.getAttributeType() != null) {
              jsonWriter.key("AttributeType").value(rangeKeyElement.getAttributeType());
            }
            jsonWriter.endObject();
          }
          jsonWriter.endObject();
        }

        ProvisionedThroughputDescription provisionedThroughput = table.getProvisionedThroughput();
        if (provisionedThroughput != null) {
          jsonWriter.key("ProvisionedThroughput").object();
          if (provisionedThroughput.getReadCapacityUnits() != null) {
            jsonWriter.key("ReadCapacityUnits").value(provisionedThroughput.getReadCapacityUnits());
          }
View Full Code Here

    try {
      StringWriter stringWriter = new StringWriter();
      JSONWriter jsonWriter = new JSONWriter(stringWriter);
      jsonWriter.object();

      TableDescription table = deleteTableResult.getTableDescription();
      if (table != null) {
        jsonWriter.key("TableDescription").object();
        jsonWriter.key("TableName").value(table.getTableName());
        jsonWriter.key("TableStatus").value(table.getTableStatus());
        jsonWriter.key("CreationDateTime").value(table.getCreationDateTime());

        KeySchema keySchema = table.getKeySchema();
        if (keySchema != null) {
          jsonWriter.key("KeySchema").object();
          KeySchemaElement hashKeyElement = keySchema.getHashKeyElement();
          if (hashKeyElement != null) {
            jsonWriter.key("HashKeyElement").object();
            if (hashKeyElement.getAttributeName() != null) {
              jsonWriter.key("AttributeName").value(hashKeyElement.getAttributeName());
            }
            if (hashKeyElement.getAttributeType() != null) {
              jsonWriter.key("AttributeType").value(hashKeyElement.getAttributeType());
            }
            jsonWriter.endObject();
          }

          KeySchemaElement rangeKeyElement = keySchema.getRangeKeyElement();
          if (rangeKeyElement != null) {
            jsonWriter.key("RangeKeyElement").object();
            if (rangeKeyElement.getAttributeName() != null) {
              jsonWriter.key("AttributeName").value(rangeKeyElement.getAttributeName());
            }
            if (rangeKeyElement.getAttributeType() != null) {
              jsonWriter.key("AttributeType").value(rangeKeyElement.getAttributeType());
            }
            jsonWriter.endObject();
          }
          jsonWriter.endObject();
        }

        ProvisionedThroughputDescription provisionedThroughput = table.getProvisionedThroughput();
        if (provisionedThroughput != null) {
          jsonWriter.key("ProvisionedThroughput").object();
          if (provisionedThroughput.getReadCapacityUnits() != null) {
            jsonWriter.key("ReadCapacityUnits").value(provisionedThroughput.getReadCapacityUnits());
          }
View Full Code Here

TOP

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

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.