Package com.amazonaws.services.dynamodb.model

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


                    .withReadCapacityUnits(v2ThruPut.getReadCapacityUnits())
                    .withWriteCapacityUnits(v2ThruPut.getWriteCapacityUnits())
                    ;
        }

        CreateTableRequest request =
            new CreateTableRequest()
                .withTableName(v2Request.getTableName())
                .withKeySchema(keySchema)
                .withProvisionedThroughput(v1ThruPut)
                ;
View Full Code Here


  public Boolean supports(Class clazz) {
    return CreateTableRequest.class.isAssignableFrom(clazz);
  }

  public List<Error> validate(Object target) {
    CreateTableRequest instance = (CreateTableRequest) target;
    List<Error> errors = ValidatorUtils.invokeValidator(new TableNameValidator(), instance.getTableName());
    errors.addAll(ValidatorUtils.invokeValidator(new KeySchemaValidator(), instance.getKeySchema()));
    errors.addAll(ValidatorUtils.invokeValidator(new ProvisionedThroughputValidator(), instance.getProvisionedThroughput()));
    return removeNulls(errors);
  }
View Full Code Here

import com.fasterxml.jackson.core.JsonToken;

public class CreateTableRequestJsonUnmarshaller implements Unmarshaller<CreateTableRequest, JsonUnmarshallerContext> {

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

    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 == FIELD_NAME /*|| token == START_OBJECT*/) {
        if (context.testExpression("TableName", targetDepth)) {
          context.nextToken();
          request.setTableName(SimpleTypeJsonUnmarshallers.StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("KeySchema", targetDepth)) {
          request.setKeySchema(KeySchemaJsonUnmarshaller.getInstance().unmarshall(context));
        }
                if (context.testExpression("ProvisionedThroughput", targetDepth)) {
                  request.setProvisionedThroughput(ProvisionedThroughputJsonUnmarshaller.getInstance().unmarshall(context));
                }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getCurrentDepth() <= originalDepth) break;
      }
      token = context.nextToken();
View Full Code Here

    return new CreateTableResult().withTableDescription(table.getTableDescription());
  }

  public com.amazonaws.services.dynamodbv2.model.CreateTableResult createTableV2(com.amazonaws.services.dynamodbv2.model.CreateTableRequest v2Request) throws LimitExceededException, InternalServerErrorException, ResourceInUseException {
        CreateTableRequest request = AlternatorDBApiVersion2Mapper.MapV2CreateTableRequestToV1(v2Request);
        try {
            CreateTableResult result = createTable(request);
            return AlternatorDBApiVersion2Mapper.MapV1CreateTableResultToV2(result);
        } catch (ResourceInUseException ex) {
            throw new com.amazonaws.services.dynamodbv2.model.ResourceInUseException(ex.getMessage());
View Full Code Here

  protected TableDescription createTable(String name, KeySchema schema) {
    return createTable(name, schema, provisionedThroughput);
  }

  protected TableDescription createTable(String name, KeySchema schema, ProvisionedThroughput throughput) {
    return getClient().createTable(new CreateTableRequest(name, schema).withProvisionedThroughput(throughput)).getTableDescription();
  }
View Full Code Here

TOP

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

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.