@Test public void deleteNonExistingObject() throws Exception { boolean deleted = objectReferentialRepository.delete(new TapeLibraryObjectReferentialId("container", "objectName1")); assertThat(deleted).isFalse(); }
public boolean delete(TapeLibraryObjectReferentialId tapeLibraryObjectReferentialId) throws ObjectReferentialException { try { DeleteResult deleteResult = collection.deleteOne( Filters.eq(TapeObjectReferentialEntity.ID, toBson(tapeLibraryObjectReferentialId))); return (deleteResult.getDeletedCount() > 0L); } catch (MongoException ex) { throw new ObjectReferentialException( "Could not delete tar referential for id " + tapeLibraryObjectReferentialId.getContainerName() + "/" + tapeLibraryObjectReferentialId.getObjectName(), ex); } }
ObjectReferentialRepository { public boolean delete(TapeLibraryObjectReferentialId tapeLibraryObjectReferentialId) throws ObjectReferentialException { try { DeleteResult deleteResult = collection.deleteOne( Filters.eq(TapeObjectReferentialEntity.ID, toBson(tapeLibraryObjectReferentialId))); return (deleteResult.getDeletedCount() > 0L); } catch (MongoException ex) { throw new ObjectReferentialException( "Could not delete tar referential for id " + tapeLibraryObjectReferentialId.getContainerName() + "/" + tapeLibraryObjectReferentialId.getObjectName(), ex); } } }
ObjectReferentialRepository { public boolean delete(TapeLibraryObjectReferentialId tapeLibraryObjectReferentialId) throws ObjectReferentialException { try { DeleteResult deleteResult = collection.deleteOne( Filters.eq(TapeObjectReferentialEntity.ID, toBson(tapeLibraryObjectReferentialId))); return (deleteResult.getDeletedCount() > 0L); } catch (MongoException ex) { throw new ObjectReferentialException( "Could not delete tar referential for id " + tapeLibraryObjectReferentialId.getContainerName() + "/" + tapeLibraryObjectReferentialId.getObjectName(), ex); } } ObjectReferentialRepository(MongoCollection<Document> collection); }
ObjectReferentialRepository { public boolean delete(TapeLibraryObjectReferentialId tapeLibraryObjectReferentialId) throws ObjectReferentialException { try { DeleteResult deleteResult = collection.deleteOne( Filters.eq(TapeObjectReferentialEntity.ID, toBson(tapeLibraryObjectReferentialId))); return (deleteResult.getDeletedCount() > 0L); } catch (MongoException ex) { throw new ObjectReferentialException( "Could not delete tar referential for id " + tapeLibraryObjectReferentialId.getContainerName() + "/" + tapeLibraryObjectReferentialId.getObjectName(), ex); } } ObjectReferentialRepository(MongoCollection<Document> collection); void insertOrUpdate(TapeObjectReferentialEntity tapeObjectReferentialEntity); Optional<TapeObjectReferentialEntity> find(String containerName, String objectName); List<TapeObjectReferentialEntity> bulkFind(String containerName, Set<String> objectNames); void updateStorageLocation(String containerName, String objectName, String storageId,
        TapeLibraryTarObjectStorageLocation tapeLibraryTarStorageLocation); boolean delete(TapeLibraryObjectReferentialId tapeLibraryObjectReferentialId); }
ObjectReferentialRepository { public boolean delete(TapeLibraryObjectReferentialId tapeLibraryObjectReferentialId) throws ObjectReferentialException { try { DeleteResult deleteResult = collection.deleteOne( Filters.eq(TapeObjectReferentialEntity.ID, toBson(tapeLibraryObjectReferentialId))); return (deleteResult.getDeletedCount() > 0L); } catch (MongoException ex) { throw new ObjectReferentialException( "Could not delete tar referential for id " + tapeLibraryObjectReferentialId.getContainerName() + "/" + tapeLibraryObjectReferentialId.getObjectName(), ex); } } ObjectReferentialRepository(MongoCollection<Document> collection); void insertOrUpdate(TapeObjectReferentialEntity tapeObjectReferentialEntity); Optional<TapeObjectReferentialEntity> find(String containerName, String objectName); List<TapeObjectReferentialEntity> bulkFind(String containerName, Set<String> objectNames); void updateStorageLocation(String containerName, String objectName, String storageId,
        TapeLibraryTarObjectStorageLocation tapeLibraryTarStorageLocation); boolean delete(TapeLibraryObjectReferentialId tapeLibraryObjectReferentialId);  }