/** * Fully truncates the given layer, including any ParameterFilter * * @param layerName */ public void truncate(final String layerName) { checkNotNull(layerName, "layerName is null"); // easy, no need to issue truncate tasks TileLayer layer; try { layer = tld.getTileLayer(layerName); } catch (GeoWebCacheException e) { log.log(Level.INFO, e.getMessage(), e); return; } final Set<String> gridSubsets = layer.getGridSubsets(); for (String gridSetId : gridSubsets) { deleteCacheByGridSetId(layerName, gridSetId); } }
/** * Fully truncates the given layer, including any ParameterFilter * * @param layerName */ public void truncate(final String layerName) { checkNotNull(layerName, "layerName is null"); // easy, no need to issue truncate tasks TileLayer layer; try { layer = tld.getTileLayer(layerName); } catch (GeoWebCacheException e) { log.log(Level.INFO, e.getMessage(), e); return; } final Set<String> gridSubsets = layer.getGridSubsets(); for (String gridSetId : gridSubsets) { deleteCacheByGridSetId(layerName, gridSetId); } }
public void testDeleteCacheByGridSetId() throws Exception { when(storageBroker.deleteByGridSetId(eq("layer"), eq("gset1"))).thenThrow( new StorageException("fake")); try { mediator.deleteCacheByGridSetId("layer", "gset1"); fail(); } catch (RuntimeException e) { assertTrue(true); } mediator.deleteCacheByGridSetId("layer", "gset2"); verify(storageBroker, times(1)).deleteByGridSetId(eq("layer"), eq("gset2")); }
removedGridSets.removeAll(newGridSubsetNames); for (String removedGridset : removedGridSets) { mediator.deleteCacheByGridSetId(layerName, removedGridset);
if (tileLayer.getGridSubsets().contains(gridSetId)) { tileLayer.removeGridSubset(gridSetId); deleteCacheByGridSetId(layerName, gridSetId);
removedGridSets.removeAll(newGridSubsetNames); for (String removedGridset : removedGridSets) { mediator.deleteCacheByGridSetId(layerName, removedGridset);
if (tileLayer.getGridSubsets().contains(gridSetId)) { tileLayer.removeGridSubset(gridSetId); deleteCacheByGridSetId(layerName, gridSetId);
layer.removeGridSubset(oldGridSetName); if (needsTruncate) { deleteCacheByGridSetId(layer.getName(), oldGridSetName);
layer.removeGridSubset(oldGridSetName); if (needsTruncate) { deleteCacheByGridSetId(layer.getName(), oldGridSetName);