private Index doCreateGSI( CreateGlobalSecondaryIndexAction create, AttributeDefinition ... keyDefinitions) { UpdateTableSpec spec = new UpdateTableSpec() .withAttributeDefinitions(keyDefinitions) .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withCreate(create)) ; updateTable(spec); return this.getIndex(create.getIndexName()); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUpdate() == null) ? 0 : getUpdate().hashCode()); hashCode = prime * hashCode + ((getCreate() == null) ? 0 : getCreate().hashCode()); hashCode = prime * hashCode + ((getDelete() == null) ? 0 : getDelete().hashCode()); return hashCode; }
setCreate(create); return this;
/** * Deletes this global secondary index (GSI) from the DynamoDB table. * Involves network calls. * <p> * This index must be a global secondary index and in the * <code>ACTIVE</code> state for this operation to succeed. Deleting a GSI * is an asynchronous operation; while executing the operation, the index is * in the <code>DELETING</code> state. * * @return the updated table description returned from DynamoDB. */ public TableDescription deleteGSI() { return table.updateTable(new UpdateTableSpec() .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withDelete( new DeleteGlobalSecondaryIndexAction() .withIndexName(indexName)))); }
public GlobalSecondaryIndexUpdate unmarshall(JsonUnmarshallerContext context) throws Exception { GlobalSecondaryIndexUpdate globalSecondaryIndexUpdate = new GlobalSecondaryIndexUpdate(); if (context.testExpression("Update", targetDepth)) { context.nextToken(); globalSecondaryIndexUpdate.setUpdate(UpdateGlobalSecondaryIndexActionJsonUnmarshaller.getInstance().unmarshall(context)); globalSecondaryIndexUpdate.setCreate(CreateGlobalSecondaryIndexActionJsonUnmarshaller.getInstance().unmarshall(context)); globalSecondaryIndexUpdate.setDelete(DeleteGlobalSecondaryIndexActionJsonUnmarshaller.getInstance().unmarshall(context));
return table.updateTable(new UpdateTableSpec() .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withUpdate( new UpdateGlobalSecondaryIndexAction() .withIndexName(indexName)
/** * <p> * The name of an existing global secondary index to be removed. * </p> * * @param delete * The name of an existing global secondary index to be removed. * @return Returns a reference to this object so that method calls can be chained together. */ public GlobalSecondaryIndexUpdate withDelete(DeleteGlobalSecondaryIndexAction delete) { setDelete(delete); return this; }
/** * <p> * The name of an existing global secondary index, along with new provisioned throughput settings to be applied to * that index. * </p> * * @param update * The name of an existing global secondary index, along with new provisioned throughput settings to be * applied to that index. * @return Returns a reference to this object so that method calls can be chained together. */ public GlobalSecondaryIndexUpdate withUpdate(UpdateGlobalSecondaryIndexAction update) { setUpdate(update); return this; }
public GlobalSecondaryIndexUpdate unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } GlobalSecondaryIndexUpdate globalSecondaryIndexUpdate = new GlobalSecondaryIndexUpdate(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Update")) { globalSecondaryIndexUpdate .setUpdate(UpdateGlobalSecondaryIndexActionJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Create")) { globalSecondaryIndexUpdate .setCreate(CreateGlobalSecondaryIndexActionJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Delete")) { globalSecondaryIndexUpdate .setDelete(DeleteGlobalSecondaryIndexActionJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return globalSecondaryIndexUpdate; }
/** * Deletes this global secondary index (GSI) from the DynamoDB table. * Involves network calls. * <p> * This index must be a global secondary index and in the * <code>ACTIVE</code> state for this operation to succeed. Deleting a GSI * is an asynchronous operation; while executing the operation, the index is * in the <code>DELETING</code> state. * * @return the updated table description returned from DynamoDB. */ public TableDescription deleteGSI() { return table.updateTable(new UpdateTableSpec() .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withDelete( new DeleteGlobalSecondaryIndexAction() .withIndexName(indexName)))); }
return table.updateTable(new UpdateTableSpec() .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withUpdate( new UpdateGlobalSecondaryIndexAction() .withIndexName(indexName)
/** * <p> * The name of an existing global secondary index to be removed. * </p> * * @param delete * The name of an existing global secondary index to be removed. * @return Returns a reference to this object so that method calls can be chained together. */ public GlobalSecondaryIndexUpdate withDelete(DeleteGlobalSecondaryIndexAction delete) { setDelete(delete); return this; }
/** * <p> * The name of an existing global secondary index, along with new provisioned throughput settings to be applied to * that index. * </p> * * @param update * The name of an existing global secondary index, along with new provisioned throughput settings to be * applied to that index. * @return Returns a reference to this object so that method calls can be chained together. */ public GlobalSecondaryIndexUpdate withUpdate(UpdateGlobalSecondaryIndexAction update) { setUpdate(update); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GlobalSecondaryIndexUpdate == false) return false; GlobalSecondaryIndexUpdate other = (GlobalSecondaryIndexUpdate) obj; if (other.getUpdate() == null ^ this.getUpdate() == null) return false; if (other.getUpdate() != null && other.getUpdate().equals(this.getUpdate()) == false) return false; if (other.getCreate() == null ^ this.getCreate() == null) return false; if (other.getCreate() != null && other.getCreate().equals(this.getCreate()) == false) return false; if (other.getDelete() == null ^ this.getDelete() == null) return false; if (other.getDelete() != null && other.getDelete().equals(this.getDelete()) == false) return false; return true; }
public GlobalSecondaryIndexUpdate unmarshall(JsonUnmarshallerContext context) throws Exception { GlobalSecondaryIndexUpdate globalSecondaryIndexUpdate = new GlobalSecondaryIndexUpdate(); if (context.testExpression("Update", targetDepth)) { context.nextToken(); globalSecondaryIndexUpdate.setUpdate(UpdateGlobalSecondaryIndexActionJsonUnmarshaller.getInstance().unmarshall(context)); globalSecondaryIndexUpdate.setCreate(CreateGlobalSecondaryIndexActionJsonUnmarshaller.getInstance().unmarshall(context)); globalSecondaryIndexUpdate.setDelete(DeleteGlobalSecondaryIndexActionJsonUnmarshaller.getInstance().unmarshall(context));
private Index doCreateGSI( CreateGlobalSecondaryIndexAction create, AttributeDefinition ... keyDefinitions) { UpdateTableSpec spec = new UpdateTableSpec() .withAttributeDefinitions(keyDefinitions) .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withCreate(create)) ; updateTable(spec); return this.getIndex(create.getIndexName()); }
setCreate(create); return this;
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getUpdate() != null) sb.append("Update: ").append(getUpdate()).append(","); if (getCreate() != null) sb.append("Create: ").append(getCreate()).append(","); if (getDelete() != null) sb.append("Delete: ").append(getDelete()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(GlobalSecondaryIndexUpdate globalSecondaryIndexUpdate, ProtocolMarshaller protocolMarshaller) { if (globalSecondaryIndexUpdate == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(globalSecondaryIndexUpdate.getUpdate(), UPDATE_BINDING); protocolMarshaller.marshall(globalSecondaryIndexUpdate.getCreate(), CREATE_BINDING); protocolMarshaller.marshall(globalSecondaryIndexUpdate.getDelete(), DELETE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUpdate() == null) ? 0 : getUpdate().hashCode()); hashCode = prime * hashCode + ((getCreate() == null) ? 0 : getCreate().hashCode()); hashCode = prime * hashCode + ((getDelete() == null) ? 0 : getDelete().hashCode()); return hashCode; }