Package com.amazonaws.services.dynamodb.model

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


        // marshaller understands.
        String errorCode = parseErrorCode(json);
        if (errorCode == null || !errorCode.equals("ConditionalCheckFailedException"))
            return null;

        ConditionalCheckFailedException e = (ConditionalCheckFailedException)super.unmarshall(json);
       
       
        return e;
    }
View Full Code Here


        // marshaller understands.
        String errorCode = parseErrorCode(json);
        if (errorCode == null || !errorCode.equals("ConditionalCheckFailedException"))
            return null;

        ConditionalCheckFailedException e = (ConditionalCheckFailedException)super.unmarshall(json);
       
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(json);
        if (errorCode == null || !errorCode.equals("ConditionalCheckFailedException"))
            return null;

        ConditionalCheckFailedException e = (ConditionalCheckFailedException)super.unmarshall(json);
       
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(json);
        if (errorCode == null || !errorCode.equals("ConditionalCheckFailedException"))
            return null;

        ConditionalCheckFailedException e = (ConditionalCheckFailedException)super.unmarshall(json);
       
       
       
        return e;
    }
View Full Code Here

        }
    }

    @Override
    public AmazonServiceException unmarshall(JSONObject json) throws Exception {
        ConditionalCheckFailedException e = (ConditionalCheckFailedException)super.unmarshall(json);
        e.setErrorCode("ConditionalCheckFailedException");
       
        return e;
    }
View Full Code Here

      value = valueUpdate.getValue();
      item.put(attributename, value);
    }else{
      if (value.getSS() != null) {
        if (valueUpdate.getValue().getSS() == null) {
          throw new ConditionalCheckFailedException("It's not possible to ADD something else than a List<String> for the attribute (" + attributename + ")");
        } else {
          for (String toUp : valueUpdate.getValue().getSS()) {
            value.getSS().add(toUp);
          }
        }
      } else if (value.getNS() != null) {
        if (valueUpdate.getValue().getNS() == null) {
          throw new ConditionalCheckFailedException("It's not possible to ADD something else than a List<Number> for the attribute (" + attributename + ")");
        } else {
          for (String toUp : valueUpdate.getValue().getNS()) {
            value.getNS().add(toUp);
          }
        }
      } else if (value.getS() != null) {
        throw new ConditionalCheckFailedException("It's not possible to ADD on an attribute with a String type for the attribute (" + attributename + ")");
      } else if (value.getN() != null) {
                try {
                    Long l = Long.valueOf(value.getN());
                    l = l + Long.valueOf(valueUpdate.getValue().getN());
                    value.setN(l + "");
View Full Code Here

    if (existingValue == null){
      return; //do nothing. need to confirm with live dynamodb behaviour.
    }
    if (existingValue.getSS() != null) {
      if (valueToDelete.getValue().getSS() == null) {
        throw new ConditionalCheckFailedException("It's not possible to delete something else than a List<String> for the attribute (" + attributename + ") of the item with hash key (" + existingValue + ")");
      } else {
        for (String toDel : valueToDelete.getValue().getSS()) {
          if (existingValue.getSS().contains(toDel)) {
            existingValue.getSS().remove(toDel);
          }
        }
      }
    } else if (existingValue.getNS() != null) {
      if (valueToDelete.getValue().getNS() == null) {
        throw new ConditionalCheckFailedException("It's not possible to delete something else than a List<Number> for the attribute (" + attributename + ") of the item with hash key (" + existingValue + ")");
      } else {
        for (String toDel : valueToDelete.getValue().getNS()) {
          if (existingValue.getNS().contains(toDel)) {
            existingValue.getNS().remove(toDel);
          }
View Full Code Here

      for (Map.Entry<String, ExpectedAttributeValue> entry : expected.entrySet()) {
        String key = entry.getKey();
        ExpectedAttributeValue value = entry.getValue();
        value.setExists(value.getValue() != null);
        if ((value.getExists() && item == null) || (!value.getExists() && item != null)) {
          throw new ConditionalCheckFailedException("The exist conditional could not be met.");
        }
        if (value.getValue() != null) {
          // check to see if value conditional is equal
          if (!compareAttributeValues(value.getValue(), item.get(key))) {
            throw new ConditionalCheckFailedException("The value conditional could is not equal");
          }
        }
      }
    }
  }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(json);
        if (errorCode == null || !errorCode.equals("ConditionalCheckFailedException"))
            return null;

        ConditionalCheckFailedException e = (ConditionalCheckFailedException)super.unmarshall(json);
       
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(json);
        if (errorCode == null || !errorCode.equals("ConditionalCheckFailedException"))
            return null;

        ConditionalCheckFailedException e = (ConditionalCheckFailedException)super.unmarshall(json);
       
       
        return e;
    }
View Full Code Here

TOP

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

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.