From c9ef31f5430d43c86a639edc01cb11471fc57db5 Mon Sep 17 00:00:00 2001 From: Carl Schroedl Date: Tue, 13 Sep 2016 10:57:25 -0500 Subject: [PATCH] Added public wrapper methods #199 --- .../rest/GeoServerRESTPublisher.java | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/main/java/it/geosolutions/geoserver/rest/GeoServerRESTPublisher.java b/src/main/java/it/geosolutions/geoserver/rest/GeoServerRESTPublisher.java index 2816b6b..873b44d 100644 --- a/src/main/java/it/geosolutions/geoserver/rest/GeoServerRESTPublisher.java +++ b/src/main/java/it/geosolutions/geoserver/rest/GeoServerRESTPublisher.java @@ -3253,7 +3253,7 @@ public class GeoServerRESTPublisher { /** * - * Recalculate the bounding box for a feature or a type + * Recalculate the bounding box for a feature type or a coverage * * @param type * @param workspace @@ -3270,11 +3270,35 @@ public class GeoServerRESTPublisher { layerName + "." + Format.XML.toString() + "?recalculate=" + calculationMode.getParamValue(); - LOGGER.debug("Constructed the following url for bounding box recalculation: "); + LOGGER.debug("Constructed the following url for bounding box recalculation: " + sUrl); String sendResult = HTTPUtils.put(sUrl, "", "text/plain", gsuser, gspass); - - return sendResult != null; + boolean success = sendResult != null; + return success; + } + + /** + * Recalculate a bounding box for a feature type + * @param workspace + * @param storeName + * @param layerName + * @param calculationMode + * @return + */ + public boolean recalculateFeatureTypeBBox(String workspace, String storeName, String layerName, BBoxRecalculationMode calculationMode){ + return recalculateBBox(StoreType.DATASTORES, workspace, storeName, layerName, calculationMode); + } + + /** + * Recalculate a bounding box for a coverage + * @param workspace + * @param storeName + * @param layerName + * @param calculationMode + * @return + */ + public boolean recalculateCoverageBBox(String workspace, String storeName, String layerName, BBoxRecalculationMode calculationMode){ + return recalculateBBox(StoreType.COVERAGESTORES, workspace, storeName, layerName, calculationMode); } }