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"); }
/** * @param layerName * @return the tile layer named {@code layerName} * @throws IllegalArgumentException if no {@link TileLayer} named {@code layeName} is found */ public TileLayer getTileLayerByName(String layerName) throws IllegalArgumentException { TileLayer tileLayer; try { tileLayer = tld.getTileLayer(layerName); } catch (GeoWebCacheException e) { throw new IllegalArgumentException(e.getMessage(), Throwables.getRootCause(e)); } return tileLayer; }
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"); }
/** * @param layerName * @return the tile layer named {@code layerName} * @throws IllegalArgumentException * if no {@link TileLayer} named {@code layeName} is found */ public TileLayer getTileLayerByName(String layerName) throws IllegalArgumentException { TileLayer tileLayer; try { tileLayer = tld.getTileLayer(layerName); } catch (GeoWebCacheException e) { throw new IllegalArgumentException(e.getMessage(), Throwables.getRootCause(e)); } return tileLayer; }
public boolean persist() throws GeoWebCacheException { try { return storageBroker.put((TileObject) stObj); } catch (StorageException e) { throw new GeoWebCacheException(e); } }
public boolean tryCacheFetch(ConveyorTile tile) { int expireCache = this.getExpireCache((int) tile.getTileIndex()[2]); if (expireCache != GWCVars.CACHE_DISABLE_CACHE) { try { return tile.retrieve(expireCache * 1000L); } catch (GeoWebCacheException gwce) { log.error(gwce.getMessage()); tile.setErrorMsg(gwce.getMessage()); return false; } } return false; }
@Override public ConveyorTile doNonMetatilingRequest(ConveyorTile tile) throws GeoWebCacheException { try { return getMetatilingReponse(tile, true, 1, 1); } catch (IOException e) { throw new GeoWebCacheException(e); } }
private boolean tryCacheFetch(ConveyorTile tile) { int expireCache = this.getExpireCache((int) tile.getTileIndex()[2]); if (expireCache != GWCVars.CACHE_DISABLE_CACHE) { try { return tile.retrieve(expireCache * 1000L); } catch (GeoWebCacheException gwce) { LOGGER.info(gwce.getMessage()); tile.setErrorMsg(gwce.getMessage()); return false; } } return false; }
@Override public void release() throws GeoWebCacheException { try { lock.release(); } catch (IllegalArgumentException trouble) { throw new GeoWebCacheException(trouble); } }
private boolean tryCacheFetch(ConveyorTile tile) { int expireCache = this.getExpireCache((int) tile.getTileIndex()[2]); if (expireCache != GWCVars.CACHE_DISABLE_CACHE) { try { return tile.retrieve(expireCache * 1000L); } catch (GeoWebCacheException gwce) { LOGGER.info(gwce.getMessage()); tile.setErrorMsg(gwce.getMessage()); return false; } } return false; }
@Override public ConveyorTile doNonMetatilingRequest(ConveyorTile tile) throws GeoWebCacheException { try { return getMetatilingReponse(tile, true, 1, 1); } catch (IOException e) { throw new GeoWebCacheException(e); } }
private void capabilityLayerOuter(StringBuilder str) { str.append(" <Layer>\n"); str.append(" <Title>GeoWebCache WMS</Title>\n"); str.append(" <Abstract>Note that not all GeoWebCache instances provide a full WMS service.</Abstract>\n"); str.append(" <LatLonBoundingBox minx=\"-180.0\" miny=\"-90.0\" maxx=\"180.0\" maxy=\"90.0\"/>\n"); Iterable<TileLayer> layerIter = tld.getLayerList(); for (TileLayer layer : layerIter) { if (!layer.isEnabled()) { continue; } try { capabilityLayerInner(str, layer); } catch (GeoWebCacheException e) { log.error(e.getMessage()); } } str.append(" </Layer>\n"); }
@Override public ConveyorTile getNoncachedTile(ConveyorTile tile) throws GeoWebCacheException { try { return getMetatilingReponse(tile, false, 1, 1); } catch (IOException e) { throw new GeoWebCacheException(e); } }
public GWCTask call() { try { task.doAction(); } catch (GeoWebCacheException gwce) { log.error(gwce.getMessage(), gwce); } catch (InterruptedException e) { log.info(task.getType() + " task #" + task.getTaskId() + " has been interrupted"); Thread.currentThread().interrupt(); } catch (RuntimeException e) { log.error(task.getType() + " task #" + task.getTaskId() + " failed", e); } return task; } }
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."); } }
/** * METHOD that handles the seeding/truncating task from the POST method. * * @param layerName * @param obj */ protected void handleRequest(String layerName, Object obj) { final SeedRequest sr = (SeedRequest) obj; try { seeder.seed(layerName, sr); } catch (IllegalArgumentException e) { throw new RestException(e.getMessage(), HttpStatus.BAD_REQUEST); } catch (GeoWebCacheException e) { throw new RestException(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); } }
@Override public ConveyorTile getNoncachedTile(ConveyorTile tile) throws GeoWebCacheException { try { return getMetatilingReponse(tile, false, 1, 1); } catch (IOException e) { throw new GeoWebCacheException(e); } }
/** * 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); } }
/** * 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; }
/** * 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); } }