@Override public Boolean call() throws Exception { boolean result = false; try { // Execution of the requested operation result = action.executeOperation(store, objs); } catch (StorageException s) { if (LOG.isErrorEnabled()) { LOG.error(s.getMessage(), s); } } return result; } }
/** * Notification that a layer has been added; to be called by {@link CatalogConfiguration} * whenever {@link CatalogConfiguration#save() save} is called and a layer has been renamed. * <p> * NOTE: this should be hanlded by GWC itself somehow, like with a configuration listener of * some sort. * * @param oldLayerName * @param newLayerName */ public void layerRenamed(String oldLayerName, String newLayerName) { try { log.info("Renaming GWC TileLayer '" + oldLayerName + "' as '" + newLayerName + "'"); // /embeddedConfig.rename(oldLayerName, newLayerName); storageBroker.rename(oldLayerName, newLayerName); } catch (StorageException e) { log.log(Level.WARNING, e.getMessage(), e); throw new RuntimeException(e); } }
/** * Notification that a layer has been added; to be called by {@link CatalogConfiguration} * whenever {@link CatalogConfiguration#save() save} is called and a layer has been renamed. * * <p>NOTE: this should be hanlded by GWC itself somehow, like with a configuration listener of * some sort. * * @param oldLayerName * @param newLayerName */ public void layerRenamed(String oldLayerName, String newLayerName) { try { log.info("Renaming GWC TileLayer '" + oldLayerName + "' as '" + newLayerName + "'"); // /embeddedConfig.rename(oldLayerName, newLayerName); storageBroker.rename(oldLayerName, newLayerName); } catch (StorageException e) { log.log(Level.WARNING, e.getMessage(), e); throw new RuntimeException(e); } }
respons = respons + "FileNotFoundException encountered: " + fileNotFoundException.getMessage(); } catch (StorageException storageException) { respons = respons + "StorageException encountered: " + storageException.getMessage(); } catch (IOException e) { respons = respons + "IOexception encountered: " + e.getMessage();
throw new RestException(e.getMessage(), HttpStatus.BAD_REQUEST); } catch (StorageException e) { throw new RestException(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); } catch (GeoWebCacheException e) { throw new RestException(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
+ layerName + " was successful but deletion of cached tiles failed: " + storageBrokerDeleteException.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR, storageBrokerDeleteException);
protected void handleRequest(HttpServletRequest req, HttpServletResponse resp, Object obj) { MassTruncateRequest mtr = (MassTruncateRequest) obj; try { if (!mtr.doTruncate(broker, breeder)) { throw new RestException("Truncation failed", HttpStatus.INTERNAL_SERVER_ERROR); } } catch (IllegalArgumentException e) { throw new RestException(e.getMessage(), HttpStatus.BAD_REQUEST); } catch (StorageException e) { throw new RestException(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); } catch (GeoWebCacheException e) { throw new RestException(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); } }
public boolean retrieve(long maxAge) throws GeoWebCacheException { try { if (isMetaTileCacheOnly) { boolean cached = storageBroker.getTransient((TileObject) stObj); this.setCacheResult(cached ? CacheResult.HIT : CacheResult.MISS); return cached; } boolean ret = storageBroker.get((TileObject) stObj); // Do we use expiration, and if so, is the tile recent enough ? if (ret && maxAge > 0 && stObj.getCreated() + maxAge < System.currentTimeMillis()) { ret = false; } if (ret) { this.setCacheResult(CacheResult.HIT); } else { this.setCacheResult(CacheResult.MISS); } return ret; } catch (StorageException se) { log.warn(se.getMessage()); return false; } }