public void update(TileLayer layer, String gridSetId, int zoomStart, int zoomStop) throws GeoWebCacheException { throw new GeoWebCacheException( "TileLayer layer, String gridSetId, int z) is not appropriate for FileRasterFilters"); }
public void update(byte[] filterData, TileLayer layer, String gridSetId, int z) throws GeoWebCacheException { throw new GeoWebCacheException( "update(byte[] filterData, TileLayer layer, String gridSetId, int z) is not appropriate for WMSRasterFilters"); }
public boolean persist() throws GeoWebCacheException { try { return storageBroker.put((TileObject) stObj); } catch (StorageException e) { throw new GeoWebCacheException(e); } }
@Override public ConveyorTile doNonMetatilingRequest(ConveyorTile tile) throws GeoWebCacheException { try { return getMetatilingReponse(tile, true, 1, 1); } catch (IOException e) { throw new GeoWebCacheException(e); } }
@Override public void release() throws GeoWebCacheException { try { lock.release(); } catch (IllegalArgumentException trouble) { throw new GeoWebCacheException(trouble); } }
@Override public ConveyorTile doNonMetatilingRequest(ConveyorTile tile) throws GeoWebCacheException { try { return getMetatilingReponse(tile, true, 1, 1); } catch (IOException e) { throw new GeoWebCacheException(e); } }
@Override public ConveyorTile getNoncachedTile(ConveyorTile tile) throws GeoWebCacheException { try { return getMetatilingReponse(tile, false, 1, 1); } catch (IOException e) { throw new GeoWebCacheException(e); } }
public static SRS getSRS(String epsgStr) throws GeoWebCacheException { final String crsAuthPrefix = "EPSG:"; if (epsgStr.substring(0, 5).equalsIgnoreCase(crsAuthPrefix)) { int epsgNumber = Integer.parseInt(epsgStr.substring(5, epsgStr.length())); return getSRS(epsgNumber); } else { throw new GeoWebCacheException("Can't parse " + epsgStr + " as SRS string."); } }
@Override public ConveyorTile getNoncachedTile(ConveyorTile tile) throws GeoWebCacheException { try { return getMetatilingReponse(tile, false, 1, 1); } catch (IOException e) { throw new GeoWebCacheException(e); } }
/** * Find a layer by name. * * @param layerName * @return * @throws GeoWebCacheException if the layer is not found */ public TileLayer findTileLayer(String layerName) throws GeoWebCacheException { TileLayer layer = null; layer = layerDispatcher.getTileLayer(layerName); if (layer == null) { throw new GeoWebCacheException("Unknown layer: " + layerName); } return layer; }
@Override public void proxyRequest(ConveyorTile tile) throws GeoWebCacheException { try { GWC.get().proxyOwsRequest(tile); } catch (Exception e) { throw new GeoWebCacheException("Failed to cascade request", e); } }
private TileLayer findLayer(Iterable<TileLayer> layers, String layerName) throws GeoWebCacheException { Iterator<TileLayer> iter = layers.iterator(); int i = 0; while (iter.hasNext()) { TileLayer layer = iter.next(); if (layer.getName().equals(layerName)) { return layer; } i++; } throw new GeoWebCacheException( "Layer " + layerName + " not found, set has " + i + " layers."); }
@Before public void setup() throws Exception { layers = mock(TileLayerDispatcher.class); bsa = mock(BlobStoreAggregator.class); defaultStorageFinder = mock(DefaultStorageFinder.class); configuration = mock(XMLConfiguration.class); configs = new LinkedList<>(); when(bsa.getBlobStores()).thenReturn(configs); when(defaultStorageFinder.getDefaultPath()) .thenReturn(tmpFolder.getRoot().getAbsolutePath()); defaultLayer = mock(TileLayer.class); when(layers.getTileLayer(eq(DEFAULT_LAYER))).thenReturn(defaultLayer); when(layers.getTileLayer((String) argThat(new NotEq<>(DEFAULT_LAYER)))) .thenThrow(new GeoWebCacheException("layer not found")); }
void checkPosMediaType(Representation entity) throws GeoWebCacheException { String remoteAdr = getRequest().getClientInfo().getAddress(); if (entity == null || ((!entity.getMediaType().includes(MediaType.APPLICATION_XML)) && (!entity.getMediaType().includes(MediaType.APPLICATION_JSON)))) { String message = "Request from "+ remoteAdr + " did not specify MIME type" + " of the document posted. Please specify application/xml " + " or application/json"; throw new GeoWebCacheException(message); } else { log.info("Received seed request from " + remoteAdr); } }
public void testTruncateLayerFully() throws Exception { when(tld.getTileLayer(eq(tileLayerGroup.getName()))).thenThrow( new GeoWebCacheException("fake")); mediator.truncate(tileLayerGroup.getName()); verify(storageBroker, never()).deleteByGridSetId(anyString(), anyString()); mediator.truncate(tileLayer.getName()); verify(storageBroker, times(tileLayer.getGridSubsets().size())).deleteByGridSetId( anyString(), anyString()); }
public ConveyorTile doNonMetatilingRequest(ConveyorTile tile) throws GeoWebCacheException { tile.setTileLayer(this); ByteArrayResource buffer = getImageBuffer(WMS_BUFFER); sourceHelper.makeRequest(tile, buffer); if (tile.getError() || buffer.getSize() == 0) { throw new GeoWebCacheException("Empty tile, error message: " + tile.getErrorMessage()); } tile.setBlob(buffer); return tile; }
@Test public void testExceptionInModifyListenerIsWrapped() throws Exception { BlobStoreConfigurationListener listener = EasyMock.createMock("listener", BlobStoreConfigurationListener.class); BlobStoreInfo goodInfo = prepForModify(); this.config.addBlobStoreListener(listener); GeoWebCacheException ex = new GeoWebCacheException("TEST"); listener.handleModifyBlobStore(goodInfo); EasyMock.expectLastCall().andThrow(ex); EasyMock.replay(listener); exception.expect( allOf( instanceOf(ConfigurationPersistenceException.class), hasProperty("cause", sameInstance(ex)))); this.modifyInfo(this.config, goodInfo); }
@Test public void testExceptionInRenameListenerIsWrapped() throws Exception { BlobStoreConfigurationListener listener = EasyMock.createMock("listener", BlobStoreConfigurationListener.class); BlobStoreInfo goodInfo = prepForRename(); this.config.addBlobStoreListener(listener); GeoWebCacheException ex = new GeoWebCacheException("TEST"); listener.handleRenameBlobStore("test", goodInfo); EasyMock.expectLastCall().andThrow(ex); EasyMock.replay(listener); exception.expect( allOf( instanceOf(ConfigurationPersistenceException.class), hasProperty("cause", sameInstance(ex)))); this.renameInfo(this.config, "test", "test2"); }
@Test public void testExceptionInRemoveListenerIsWrapped() throws Exception { BlobStoreConfigurationListener listener = EasyMock.createMock("listener", BlobStoreConfigurationListener.class); BlobStoreInfo goodInfo = prepForRemove(); this.config.addBlobStoreListener(listener); GeoWebCacheException ex = new GeoWebCacheException("TEST"); listener.handleRemoveBlobStore(goodInfo); EasyMock.expectLastCall().andThrow(ex); EasyMock.replay(listener); exception.expect( allOf( instanceOf(ConfigurationPersistenceException.class), hasProperty("cause", sameInstance(ex)))); this.removeInfo(this.config, "test"); }
@Test public void testExceptionInAddListenerIsWrapped() throws Exception { BlobStoreConfigurationListener listener = EasyMock.createMock("listener", BlobStoreConfigurationListener.class); BlobStoreInfo goodInfo = this.getGoodInfo("test", 1); this.config.addBlobStoreListener(listener); listener.handleAddBlobStore(goodInfo); GeoWebCacheException ex = new GeoWebCacheException("TEST"); EasyMock.expectLastCall().andThrow(ex); EasyMock.replay(listener); exception.expect( allOf( instanceOf(ConfigurationPersistenceException.class), hasProperty("cause", sameInstance(ex)))); this.addInfo(this.config, goodInfo); }