/** * A static factory method returning a {@link TableOperation} instance to replace the specified table entity. To * execute this {@link TableOperation} on a given table, call the * {@link CloudTable#execute(TableOperation)} method. * * @param entity * The object instance implementing {@link TableEntity} to associate with the operation. * @return * A new {@link TableOperation} instance for replacing the table entity. */ public static TableOperation replace(final TableEntity entity) { Utility.assertNotNullOrEmpty("entity etag", entity.getEtag()); return new TableOperation(entity, TableOperationType.REPLACE); }
/** * A static factory method returning a {@link TableOperation} instance to replace the specified table entity. To * execute this {@link TableOperation} on a given table, call the * {@link CloudTable#execute(TableOperation)} method. * * @param entity * The object instance implementing {@link TableEntity} to associate with the operation. * @return * A new {@link TableOperation} instance for replacing the table entity. */ public static TableOperation replace(final TableEntity entity) { Utility.assertNotNullOrEmpty("entity etag", entity.getEtag()); return new TableOperation(entity, TableOperationType.REPLACE); }
/** * A static factory method returning a {@link TableOperation} instance to merge the specified table entity into * Microsoft Azure storage. To execute this {@link TableOperation} on a given table, call the * {@link CloudTable#execute(TableOperation)} method on a {@link CloudTableClient} instance with the * * @param entity * The object instance implementing {@link TableEntity} to associate with the operation. * @return * A new {@link TableOperation} instance for merging the table entity. */ public static TableOperation merge(final TableEntity entity) { Utility.assertNotNull("entity", entity); Utility.assertNotNullOrEmpty("entity etag", entity.getEtag()); return new TableOperation(entity, TableOperationType.MERGE); }
/** * A static factory method returning a {@link TableOperation} instance to delete the specified entity from Microsoft * Azure storage. To execute this {@link TableOperation} on a given table, call the * {@link CloudTable#execute(TableOperation)} method on a {@link CloudTableClient} instance with the * * @param entity * The object instance implementing {@link TableEntity} to associate with the operation. * @return * A new {@link TableOperation} instance to insert the table entity. */ public static TableOperation delete(final TableEntity entity) { Utility.assertNotNull("entity", entity); Utility.assertNotNullOrEmpty("entity etag", entity.getEtag()); return new TableOperation(entity, TableOperationType.DELETE); }
/** * A static factory method returning a {@link TableOperation} instance to merge the specified table entity into * Microsoft Azure storage. To execute this {@link TableOperation} on a given table, call the * {@link CloudTable#execute(TableOperation)} method on a {@link CloudTableClient} instance with the * * @param entity * The object instance implementing {@link TableEntity} to associate with the operation. * @return * A new {@link TableOperation} instance for merging the table entity. */ public static TableOperation merge(final TableEntity entity) { Utility.assertNotNull("entity", entity); Utility.assertNotNullOrEmpty("entity etag", entity.getEtag()); return new TableOperation(entity, TableOperationType.MERGE); }
/** * A static factory method returning a {@link TableOperation} instance to delete the specified entity from Microsoft * Azure storage. To execute this {@link TableOperation} on a given table, call the * {@link CloudTable#execute(TableOperation)} method on a {@link CloudTableClient} instance with the * * @param entity * The object instance implementing {@link TableEntity} to associate with the operation. * @return * A new {@link TableOperation} instance to insert the table entity. */ public static TableOperation delete(final TableEntity entity) { Utility.assertNotNull("entity", entity); Utility.assertNotNullOrEmpty("entity etag", entity.getEtag()); return new TableOperation(entity, TableOperationType.DELETE); }
@Override public HttpURLConnection buildRequest(CloudTableClient client, TableOperation operation, OperationContext context) throws Exception { this.setSendStream(new ByteArrayInputStream(entityBytes)); this.setLength((long) entityBytes.length); return TableRequest.update( client.getTransformedEndPoint(context).getUri(this.getCurrentLocation()), options, null, context, tableName, generateRequestIdentity(false, null), operation.getEntity() .getEtag()); }
@Override public HttpURLConnection buildRequest(CloudTableClient client, TableOperation operation, OperationContext context) throws Exception { this.setSendStream(new ByteArrayInputStream(entityBytes)); this.setLength((long) entityBytes.length); return TableRequest.merge(client.getTransformedEndPoint(opContext) .getUri(this.getCurrentLocation()), options, null, opContext, tableName, generateRequestIdentity(false, null), operation.getEntity().getEtag()); }
@Override public HttpURLConnection buildRequest(CloudTableClient client, TableOperation operation, OperationContext context) throws Exception { this.setSendStream(new ByteArrayInputStream(entityBytes)); this.setLength((long) entityBytes.length); return TableRequest.merge(client.getTransformedEndPoint(opContext) .getUri(this.getCurrentLocation()), options, null, opContext, tableName, generateRequestIdentity(false, null), operation.getEntity().getEtag()); }
@Override public HttpURLConnection buildRequest(CloudTableClient client, TableOperation operation, OperationContext context) throws Exception { this.setSendStream(new ByteArrayInputStream(entityBytes)); this.setLength((long) entityBytes.length); return TableRequest.update( client.getTransformedEndPoint(context).getUri(this.getCurrentLocation()), options, null, context, tableName, generateRequestIdentity(false, null), operation.getEntity() .getEtag()); }
@Override public HttpURLConnection buildRequest(CloudTableClient client, TableOperation operation, OperationContext context) throws Exception { return TableRequest.delete(client.getTransformedEndPoint(context).getUri(this.getCurrentLocation()), options, null, context, tableName, generateRequestIdentity(isTableEntry, tableIdentity), operation.getEntity().getEtag()); }
@Override public HttpURLConnection buildRequest(CloudTableClient client, TableOperation operation, OperationContext context) throws Exception { return TableRequest.delete(client.getTransformedEndPoint(context).getUri(this.getCurrentLocation()), options, null, context, tableName, generateRequestIdentity(isTableEntry, tableIdentity), operation.getEntity().getEtag()); }
@Override public HttpURLConnection buildRequest(CloudTableClient client, TableOperation operation, OperationContext context) throws Exception { this.setSendStream(new ByteArrayInputStream(entityBytes)); this.setLength((long) entityBytes.length); return TableRequest.insert( client.getTransformedEndPoint(opContext).getUri(this.getCurrentLocation()), options, null, opContext, tableName, generateRequestIdentity(isTableEntry, tableIdentity), operation.opType != TableOperationType.INSERT ? operation.getEntity().getEtag() : null, operation.getEchoContent(), operation.opType.getUpdateType()); }
@Override public HttpURLConnection buildRequest(CloudTableClient client, TableOperation operation, OperationContext context) throws Exception { this.setSendStream(new ByteArrayInputStream(entityBytes)); this.setLength((long) entityBytes.length); return TableRequest.insert( client.getTransformedEndPoint(opContext).getUri(this.getCurrentLocation()), options, null, opContext, tableName, generateRequestIdentity(isTableEntry, tableIdentity), operation.opType != TableOperationType.INSERT ? operation.getEntity().getEtag() : null, operation.getEchoContent(), operation.opType.getUpdateType()); }
Utility.assertNotNullOrEmpty(SR.ETAG_INVALID_FOR_DELETE, this.getEntity().getEtag()); Utility.assertNotNull(SR.PARTITIONKEY_MISSING_FOR_DELETE, this.getEntity().getPartitionKey()); Utility.assertNotNull(SR.ROWKEY_MISSING_FOR_DELETE, this.getEntity().getRowKey());
Utility.assertNotNullOrEmpty(SR.ETAG_INVALID_FOR_DELETE, this.getEntity().getEtag()); Utility.assertNotNull(SR.PARTITIONKEY_MISSING_FOR_DELETE, this.getEntity().getPartitionKey()); Utility.assertNotNull(SR.ROWKEY_MISSING_FOR_DELETE, this.getEntity().getRowKey());
private StorageRequest<CloudTableClient, TableOperation, TableResult> updateImpl(final CloudTableClient client, final String tableName, final TableRequestOptions options, final OperationContext opContext) throws StorageException { Utility.assertNotNullOrEmpty(SR.ETAG_INVALID_FOR_UPDATE, this.getEntity().getEtag()); Utility.assertNotNull(SR.PARTITIONKEY_MISSING_FOR_UPDATE, this.getEntity().getPartitionKey()); Utility.assertNotNull(SR.ROWKEY_MISSING_FOR_UPDATE, this.getEntity().getRowKey());
private StorageRequest<CloudTableClient, TableOperation, TableResult> mergeImpl(final CloudTableClient client, final String tableName, final TableRequestOptions options, final OperationContext opContext) throws StorageException { Utility.assertNotNullOrEmpty(SR.ETAG_INVALID_FOR_MERGE, this.getEntity().getEtag()); Utility.assertNotNull(SR.PARTITIONKEY_MISSING_FOR_MERGE, this.getEntity().getPartitionKey()); Utility.assertNotNull(SR.ROWKEY_MISSING_FOR_MERGE, this.getEntity().getRowKey());
private StorageRequest<CloudTableClient, TableOperation, TableResult> mergeImpl(final CloudTableClient client, final String tableName, final TableRequestOptions options, final OperationContext opContext) throws StorageException { Utility.assertNotNullOrEmpty(SR.ETAG_INVALID_FOR_MERGE, this.getEntity().getEtag()); Utility.assertNotNull(SR.PARTITIONKEY_MISSING_FOR_MERGE, this.getEntity().getPartitionKey()); Utility.assertNotNull(SR.ROWKEY_MISSING_FOR_MERGE, this.getEntity().getRowKey());
private StorageRequest<CloudTableClient, TableOperation, TableResult> updateImpl(final CloudTableClient client, final String tableName, final TableRequestOptions options, final OperationContext opContext) throws StorageException { Utility.assertNotNullOrEmpty(SR.ETAG_INVALID_FOR_UPDATE, this.getEntity().getEtag()); Utility.assertNotNull(SR.PARTITIONKEY_MISSING_FOR_UPDATE, this.getEntity().getPartitionKey()); Utility.assertNotNull(SR.ROWKEY_MISSING_FOR_UPDATE, this.getEntity().getRowKey());