@Override public boolean executeOperation(BlobStore store, Object... objs) throws StorageException { if (objs == null || objs.length < 1 || !(objs[0] instanceof TileRange)) { return false; } return store.delete((TileRange) objs[0]); } },
@Override public boolean executeOperation(BlobStore store, Object... objs) throws StorageException { if (objs == null || objs.length < 1 || !(objs[0] instanceof TileObject)) { return false; } return store.delete((TileObject) objs[0]); } },
@Override public boolean executeOperation(BlobStore store, Object... objs) throws StorageException { if (objs == null || objs.length < 2 || !(objs[0] instanceof String)) { return false; } return store.delete((String) objs[0]); } },
public boolean delete(String layerName) throws StorageException { return blobStore.delete(layerName); }
public boolean delete(TileRange trObj) throws StorageException { return blobStore.delete(trObj); }
@Override public boolean delete(TileObject obj) throws StorageException { // Check if the blobstore has already been configured if (configured.get()) { // Increment the number of current operations // This behavior is used in order to wait // the end of all the operations after setting // the configured parameter to false actualOperations.incrementAndGet(); try { // Deletes the single TileObject return delegate.delete(obj); } finally { // Decrement the number of current operations. actualOperations.decrementAndGet(); } } return true; }
@Override public boolean delete(TileRange obj) throws StorageException { // Check if the blobstore has already been configured if (configured.get()) { // Increment the number of current operations // This behavior is used in order to wait // the end of all the operations after setting // the configured parameter to false actualOperations.incrementAndGet(); try { // Deletes this TileRange return delegate.delete(obj); } finally { // Decrement the number of current operations. actualOperations.decrementAndGet(); } } return true; }
@Override public boolean delete(String layerName) throws StorageException { // NOTE that if the blobstore has already been configured, the user must // always call setConfig() for // setting the new configuration if (configured.get()) { // Increment the number of current operations // This behavior is used in order to wait // the end of all the operations after setting // the configured parameter to false actualOperations.incrementAndGet(); try { // Delete the selected Layer return delegate.delete(layerName); } finally { // Decrement the number of current operations. actualOperations.decrementAndGet(); } } return true; }
@Override public boolean delete(String layerName) throws StorageException { return readFunctionUnsafe(() -> store(layerName).delete(layerName)); }
@Override public boolean delete(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).delete(obj)); }
@Override public boolean delete(TileRange obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).delete(obj)); }
public void testTileDelete() throws Exception { fbs = setup(); Map<String, String> parameters = new HashMap<String, String>(); parameters.put("a", "x"); parameters.put("b", "ø"); Resource bytes = new ByteArrayResource("1 2 3 4 5 6 test".getBytes()); long[] xyz = {5L, 6L, 7L}; TileObject to = TileObject.createCompleteTileObject( "test:123123 112", xyz, "EPSG:4326", "image/jpeg", parameters, bytes); fbs.put(to); TileObject to2 = TileObject.createQueryTileObject( "test:123123 112", xyz, "EPSG:4326", "image/jpeg", parameters); fbs.get(to2); try (InputStream is = to2.getBlob().getInputStream(); InputStream is2 = bytes.getInputStream()) { assertTrue(IOUtils.contentEquals(is, is2)); } TileObject to3 = TileObject.createQueryTileObject( "test:123123 112", xyz, "EPSG:4326", "image/jpeg", parameters); fbs.delete(to3); TileObject to4 = TileObject.createQueryTileObject( "test:123123 112", xyz, "EPSG:4326", "image/jpeg", parameters); assertFalse(fbs.get(to4)); }
store.delete(remove); EasyMock.verify(listener); assertThat(store.get(fromCache), is(false));
store.delete(remove); EasyMock.verify(listener); assertThat(store.get(fromCache1_2), is(false));
store.delete(remove); EasyMock.verify(listener); assertThat(store.get(fromCache1_2), is(false));
parameters); fbs.delete(trObj);