public boolean get(TileObject stObj) throws StorageException { stObj.setLayerId(idCache.getLayerId(stObj.getLayerName())); stObj.setFormatId(idCache.getFormatId(stObj.getBlobFormat())); stObj.setGridSetIdId(idCache.getGridSetsId(stObj.getGridSetId())); stObj.setParamtersId(idCache.getParametersId(stObj.getParameters())); try { boolean response = wrpr.getTile(stObj); while (stObj.getStatus().equals(Status.LOCK)) { try { Thread.sleep(lockRetryDelay); } catch (InterruptedException e) { e.printStackTrace(); } response = wrpr.getTile(stObj); } return response; } catch (SQLException se) { log.error("Failed to get tile: " + se.getMessage()); } return false; }
public boolean delete(TileObject stObj) throws StorageException { stObj.setLayerId(idCache.getLayerId(stObj.getLayerName())); stObj.setFormatId(idCache.getFormatId(stObj.getBlobFormat())); long parametersId = idCache.getParametersId(stObj.getParameters()); stObj.setParamtersId(parametersId); try { wrpr.deleteTile(stObj); return true; } catch (SQLException se) { log.error("Failed to get tile: " + se.getMessage()); } return false; }
public void put(TileObject stObj) throws StorageException { stObj.setLayerId(idCache.getLayerId(stObj.getLayerName())); stObj.setFormatId(idCache.getFormatId(stObj.getBlobFormat())); stObj.setGridSetIdId(idCache.getGridSetsId(stObj.getGridSetId())); stObj.setParamtersId(idCache.getParametersId(stObj.getParameters())); try { wrpr.deleteTile(stObj); } catch (SQLException se) { log.error("Failed to delete tile: " + se.getMessage()); } try { wrpr.putTile(stObj); } catch (SQLException se) { log.error("Failed to put tile: " + se.getMessage()); } }
public boolean expire(TileRange trObj) throws StorageException { long layerId = idCache.getLayerId(trObj.getLayerName()); long formatId = idCache.getFormatId(trObj.getMimeType().getFormat()); long parametersId = idCache.getParametersId(trObj.getParameters()); if (-1L != parametersId) { trObj.setParametersId(parametersId); } long gridSetIdId = idCache.getGridSetsId(trObj.getGridSetId()); for (int zoomLevel = trObj.getZoomStart(); zoomLevel <= trObj.getZoomStop(); zoomLevel++) { try { wrpr.expireRange(trObj, zoomLevel, layerId, formatId, parametersId, gridSetIdId); } catch (SQLException se) { log.error(se.getMessage()); } } return true; }
public boolean delete(BlobStore blobStore, TileRange trObj) throws StorageException { long layerId = idCache.getLayerId(trObj.getLayerName()); long formatId = idCache.getFormatId(trObj.getMimeType().getFormat()); // FRD Set the parameters ID long parametersId = -1; if (trObj.getParametersId() != null) { parametersId = trObj.getParametersId(); } else if (trObj.getParameters() != null) { parametersId = idCache.getParametersId(trObj.getParameters()); if (-1L != parametersId) { trObj.setParametersId(parametersId); } } long gridSetIdId = idCache.getGridSetsId(trObj.getGridSetId()); for (int zoomLevel = trObj.getZoomStart(); zoomLevel <= trObj.getZoomStop(); zoomLevel++) { wrpr.deleteRange(blobStore, trObj, zoomLevel, layerId, formatId, parametersId, gridSetIdId); } return true; }