/** * Deletes the table from the storage service. * * @throws StorageException * If a storage service error occurred during the operation. */ @DoesServiceRequest public void delete() throws StorageException { this.delete(null /* options */, null /* opContext */); }
public void handleActionOnTable(String tableName, ActionOnTable actionTable) throws IOException, StorageException, InvalidKeyException, URISyntaxException { // FIXME How does this will behave in a distributed runtime ? See where to place correctly this // instruction... CloudTable cloudTable = connection.getCloudStorageAccount().createCloudTableClient().getTableReference(tableName); switch (actionTable) { case Create_table: cloudTable.create(null, AzureStorageUtils.getTalendOperationContext()); break; case Create_table_if_does_not_exist: cloudTable.createIfNotExists(null, AzureStorageUtils.getTalendOperationContext()); break; case Drop_and_create_table: cloudTable.delete(null, AzureStorageUtils.getTalendOperationContext()); createTableAfterDeletion(cloudTable); break; case Drop_table_if_exist_and_create: cloudTable.deleteIfExists(null, AzureStorageUtils.getTalendOperationContext()); createTableAfterDeletion(cloudTable); break; case Default: default: return; } }
public void handleActionOnTable(String tableName, ActionOnTable actionTable) throws IOException, StorageException, InvalidKeyException, URISyntaxException { // FIXME How does this will behave in a distributed runtime ? See where to place correctly this // instruction... CloudTable cloudTable = connection.getCloudStorageAccount().createCloudTableClient().getTableReference(tableName); switch (actionTable) { case Create_table: cloudTable.create(null, AzureStorageUtils.getTalendOperationContext()); break; case Create_table_if_does_not_exist: cloudTable.createIfNotExists(null, AzureStorageUtils.getTalendOperationContext()); break; case Drop_and_create_table: cloudTable.delete(null, AzureStorageUtils.getTalendOperationContext()); createTableAfterDeletion(cloudTable); break; case Drop_table_if_exist_and_create: cloudTable.deleteIfExists(null, AzureStorageUtils.getTalendOperationContext()); createTableAfterDeletion(cloudTable); break; case Default: default: return; } }
/** * Deletes the table from the storage service. * * @throws StorageException * If a storage service error occurred during the operation. */ @DoesServiceRequest public void delete() throws StorageException { this.delete(null /* options */, null /* opContext */); }
@Test public void testTableDeleteWhenExistAndNotExists() throws StorageException, URISyntaxException { CloudTableClient tClient = TableTestHelper.createCloudTableClient(); String tableName = TableTestHelper.generateRandomTableName(); CloudTable table = tClient.getTableReference(tableName); try { // Should fail as it doesnt already exists try { table.delete(); fail(); } catch (StorageException ex) { assertEquals(ex.getMessage(), "Not Found"); } table.create(); assertTrue(table.exists()); table.delete(); assertFalse(table.exists()); } finally { table.deleteIfExists(); } }
this.delete(options, opContext);
this.delete(options, opContext);
@Override public void eventOccurred(SendingRequestEvent eventArg) { if (((HttpURLConnection) eventArg.getConnectionObject()).getRequestMethod().equals("DELETE")) { try { table.delete(); assertFalse(table.exists()); } catch (StorageException e) { fail("Delete should succeed."); } } } });
for (String s : tables) { CloudTable table = tClient.getTableReference(s); table.delete();
for (String s : tables) { CloudTable table = tClient.getTableReference(s); table.delete();
for (String s : tables) { CloudTable table = tClient.getTableReference(s); table.delete();