@Override public ResourceResponse<DocumentCollection> invoke() throws Exception { return client.deleteCollection(collectionLink, options); } });
public void deleteAll(String collectionName) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("execute deleteCollection in database {} collection {} with id {}", this.databaseName, collectionName); } try { documentDbFactory.getDocumentClient() .deleteCollection(getCollectionLink(this.databaseName, collectionName), null); if (this.collectionCache.contains(collectionName)) { this.collectionCache.remove(collectionName); } } catch (DocumentClientException ex) { if (ex.getStatusCode() == 404) { LOGGER.warn("deleteAll in database {} collection {} met NOTFOUND error {}", this.databaseName, collectionName, ex.getMessage()); } else { throw new RuntimeException("deleteAll exception", ex); } } }
@Override public void deleteCollection(@NonNull String collectionName) { Assert.hasText(collectionName, "collectionName should have text."); try { getDocumentClient().deleteCollection(getCollectionLink(this.databaseName, collectionName), null); this.collectionCache.remove(collectionName); } catch (DocumentClientException ex) { throw new DocumentDBAccessException("failed to delete collection: " + collectionName, ex); } }
public void deleteAll(String collectionName) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("execute deleteCollection in database {} collection {}", this.databaseName, collectionName); } try { documentDbFactory.getDocumentClient() .deleteCollection(getCollectionLink(this.databaseName, collectionName), null); if (this.collectionCache.contains(collectionName)) { this.collectionCache.remove(collectionName); } } catch (DocumentClientException ex) { if (ex.getStatusCode() == 404) { LOGGER.warn("deleteAll in database {} collection {} met NOTFOUND error {}", this.databaseName, collectionName, ex.getMessage()); } else { throw new DocumentDBAccessException("deleteAll exception", ex); } } }