diff options
author | Dimitar Misev <dimitar@debian.(none)> | 2011-02-05 22:44:35 +0100 |
---|---|---|
committer | www-data <www-data@ubuntu.localdomain> | 2011-02-16 10:01:49 +0100 |
commit | 3d356cc9ef7b1055242256c00a2e6b93b5462880 (patch) | |
tree | 977d6292418f8bce19632e10e13ac39da617c226 /petascope/src/petascope/wcs/server | |
parent | 054f18a0e07c429609aae393f6bde67f21f9b82c (diff) | |
download | rasdaman-upstream-3d356cc9ef7b1055242256c00a2e6b93b5462880.tar.gz rasdaman-upstream-3d356cc9ef7b1055242256c00a2e6b93b5462880.tar.xz rasdaman-upstream-3d356cc9ef7b1055242256c00a2e6b93b5462880.zip |
Diffstat (limited to 'petascope/src/petascope/wcs/server')
30 files changed, 134 insertions, 1297 deletions
diff --git a/petascope/src/petascope/wcs/server/WcsServer.java b/petascope/src/petascope/wcs/server/WcsServer.java index fddb549..12625bd 100644 --- a/petascope/src/petascope/wcs/server/WcsServer.java +++ b/petascope/src/petascope/wcs/server/WcsServer.java @@ -14,15 +14,13 @@ * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. + * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH. * * For more information please see <http://www.rasdaman.org> * or contact Peter Baumann via <baumann@rasdaman.com>. */ package petascope.wcs.server; -//~--- non-JDK imports -------------------------------------------------------- import javax.servlet.ServletException; import net.opengis.ows.v_1_0_0.ExceptionReport; import net.opengis.wcs.v_1_1_0.Capabilities; @@ -30,23 +28,19 @@ import net.opengis.wcs.v_1_1_0.CoverageDescriptions; import net.opengis.wcs.v_1_1_0.DescribeCoverage; import net.opengis.wcs.v_1_1_0.GetCapabilities; import net.opengis.wcs.v_1_1_0.GetCoverage; - -import petascope.wcps.server.core.DbMetadataSource; +import petascope.core.DbMetadataSource; +import petascope.exceptions.PetascopeException; import petascope.wcps.server.core.WCPS; -import petascope.wcps.server.exceptions.WCPSException; -import petascope.wcs.server.exceptions.WCSException; +import petascope.exceptions.WCPSException; +import petascope.exceptions.WCSException; +import petascope.exceptions.ExceptionCode; import petascope.wcs.server.core.convertGetCoverage; import petascope.wcs.server.core.executeDescribeCoverage; import petascope.wcs.server.core.executeGetCapabilities; - import petascope.ConfigManager; import petascope.PetascopeXmlNamespaceMapper; - -//~--- JDK imports ------------------------------------------------------------ - import java.io.StringReader; import java.io.StringWriter; - import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; @@ -55,8 +49,6 @@ import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamWriter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import petascope.wcs.server.exceptions.InternalComponentException; -import petascope.wcs.server.exceptions.XmlStructuresException; /** * The Web Coverage Service (WcsServer) @@ -69,7 +61,7 @@ import petascope.wcs.server.exceptions.XmlStructuresException; */ public class WcsServer { - private static Logger LOG = LoggerFactory.getLogger(WcsServer.class); + private static Logger log = LoggerFactory.getLogger(WcsServer.class); /* Status variable */ private static Boolean ok; @@ -91,26 +83,26 @@ public class WcsServer { /** * WcsServer GetCapabilities operation */ - public String GetCapabilities(String stringXml) throws WCSException { + public String GetCapabilities(String stringXml) throws WCSException, PetascopeException { String output = "Default output. "; try { // read the input XML - LOG.trace("Reading the input XML file ... "); + log.trace("Reading the input XML file ... "); JAXBContext context = JAXBContext.newInstance("net.opengis.wcs.v_1_1_0"); Unmarshaller unmarshaller = context.createUnmarshaller(); Object xml = unmarshaller.unmarshal(new StringReader(stringXml)); // Find out which class to execute ... - LOG.trace("It is a " + xml.getClass().getSimpleName() + " request."); + log.trace("It is a " + xml.getClass().getSimpleName() + " request."); - LOG.trace("Compiling data into XML format for GetCapabilities ... "); + log.trace("Compiling data into XML format for GetCapabilities ... "); GetCapabilities input = (GetCapabilities) xml; Capabilities cap = new executeGetCapabilities(input, meta).get(); // Write the output - LOG.trace("MArshalling with context: " + cap.getClass().getPackage().getName()); + log.trace("MArshalling with context: " + cap.getClass().getPackage().getName()); final StringWriter writer = new StringWriter(); try { context = JAXBContext.newInstance(cap.getClass()); @@ -127,15 +119,15 @@ public class WcsServer { throw new RuntimeException(e.getMessage(), e); } output = writer.toString(); - LOG.trace("Done! User has the GetCapabilities result !"); + log.trace("Done! User has the GetCapabilities result !"); } catch (javax.xml.bind.JAXBException ex) { - throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", ex); + throw new WCSException(ExceptionCode.XmlStructuresError, "Could not marshall/unmarshall XML structures.", ex); } - LOG.trace("---------------------OUTPUT--------------------------"); - LOG.trace(output); - LOG.trace("-----------------------------------------------------"); + log.trace("---------------------OUTPUT--------------------------"); + log.trace(output); + log.trace("-----------------------------------------------------"); return output; } @@ -148,28 +140,28 @@ public class WcsServer { try { // read the input XML - LOG.trace("Reading the input XML file ... "); + log.trace("Reading the input XML file ... "); JAXBContext context = JAXBContext.newInstance("net.opengis.wcs.v_1_1_0"); Unmarshaller unmarshaller = context.createUnmarshaller(); Object xml = unmarshaller.unmarshal(new StringReader(stringXml)); - LOG.trace("It is a " + xml.getClass().getSimpleName() + " request."); + log.trace("It is a " + xml.getClass().getSimpleName() + " request."); // Convert the WcsServer into WCPS - LOG.trace("Converting to WCPS request ... please wait"); + log.trace("Converting to WCPS request ... please wait"); GetCoverage wcs = (GetCoverage) xml; output = new convertGetCoverage(wcs, meta).get(); - LOG.trace("Done! User has his WCPS request !"); + log.trace("Done! User has his WCPS request !"); } catch (JAXBException ex) { - throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", ex); + throw new WCSException(ExceptionCode.XmlStructuresError, "Could not marshall/unmarshall XML structures.", ex); } catch (WCPSException e) { - throw new InternalComponentException(e.getMessage(), e); + throw new WCSException(ExceptionCode.InternalComponentError, e.getMessage(), e); } - LOG.trace("---------------------OUTPUT--------------------------"); - LOG.trace(output); - LOG.trace("-----------------------------------------------------"); + log.trace("---------------------OUTPUT--------------------------"); + log.trace(output); + log.trace("-----------------------------------------------------"); return output; } @@ -182,19 +174,19 @@ public class WcsServer { try { // read the input XML - LOG.trace("Reading the input XML file ... "); + log.trace("Reading the input XML file ... "); JAXBContext context = JAXBContext.newInstance("net.opengis.wcs.v_1_1_0"); Unmarshaller unmarshaller = context.createUnmarshaller(); Object xml = unmarshaller.unmarshal(new StringReader(stringXml)); - LOG.trace("It is a " + xml.getClass().getSimpleName() + " request."); + log.trace("It is a " + xml.getClass().getSimpleName() + " request."); - LOG.trace("Querying the WCPS architecture for the details on this coverage ..."); + log.trace("Querying the WCPS architecture for the details on this coverage ..."); DescribeCoverage input = (DescribeCoverage) xml; CoverageDescriptions covs = new executeDescribeCoverage(input, meta).get(); // Write the output file - LOG.trace("Marshalling with context: " + covs.getClass().getPackage().getName()); + log.trace("Marshalling with context: " + covs.getClass().getPackage().getName()); final StringWriter writer = new StringWriter(); try { context = JAXBContext.newInstance(covs.getClass()); @@ -211,14 +203,14 @@ public class WcsServer { throw new RuntimeException(e.getMessage(), e); } output = writer.toString(); - LOG.trace("Done! User has the DescribeCoverage result !"); + log.trace("Done! User has the DescribeCoverage result !"); } catch (JAXBException ex) { - throw new XmlStructuresException("Could not marshall/unmarshall XML structures.", ex); + throw new WCSException(ExceptionCode.XmlStructuresError, "Could not marshall/unmarshall XML structures.", ex); } - LOG.trace("---------------------OUTPUT--------------------------"); - LOG.trace(output); - LOG.trace("-----------------------------------------------------"); + log.trace("---------------------OUTPUT--------------------------"); + log.trace(output); + log.trace("-----------------------------------------------------"); return output; } @@ -239,10 +231,10 @@ public class WcsServer { marshaller.marshal(report, strWriter); output = strWriter.toString(); ok = true; - LOG.trace("Done marshalling Error Report."); + log.trace("Done marshalling Error Report."); } catch (Exception e2) { - LOG.error("Error marshalling Exception Report."); - LOG.error("Stack trace: " + e2); + log.error("Error marshalling Exception Report."); + log.error("Stack trace: " + e2); } return output; diff --git a/petascope/src/petascope/wcs/server/cli/CLI.java b/petascope/src/petascope/wcs/server/cli/CLI.java index e6312d5..0c33d1e 100644 --- a/petascope/src/petascope/wcs/server/cli/CLI.java +++ b/petascope/src/petascope/wcs/server/cli/CLI.java @@ -1,22 +1,8 @@ package petascope.wcs.server.cli; -import petascope.wcs.server.core.executeGetCapabilities; -import petascope.wcs.server.exceptions.WCSException; -import petascope.wcs.server.core.convertGetCoverage; -import petascope.wcs.server.core.executeDescribeCoverage; import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; import java.util.Properties; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; -import net.opengis.ows.v_1_0_0.ExceptionReport; -import net.opengis.wcs.v_1_1_0.Capabilities; -import net.opengis.wcs.v_1_1_0.CoverageDescriptions; -import net.opengis.wcs.v_1_1_0.DescribeCoverage; -import net.opengis.wcs.v_1_1_0.GetCapabilities; -import net.opengis.wcs.v_1_1_0.GetCoverage; -//import wcs.server.core.ProcessCoverage; /** * Command Line Interface class, for testing the WCS Server operation diff --git a/petascope/src/petascope/wcs/server/core/TimeString.java b/petascope/src/petascope/wcs/server/core/TimeString.java index 6e5d04f..d93d98a 100644 --- a/petascope/src/petascope/wcs/server/core/TimeString.java +++ b/petascope/src/petascope/wcs/server/core/TimeString.java @@ -14,19 +14,16 @@ * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. + * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH. * * For more information please see <http://www.rasdaman.org> * or contact Peter Baumann via <baumann@rasdaman.com>. */ -package petascope.wcs.server.core;
-
-//~--- non-JDK imports --------------------------------------------------------
-import org.joda.time.DateTime;
-import org.joda.time.format.DateTimeFormat;
-import org.joda.time.format.DateTimeFormatter;
-
+package petascope.wcs.server.core; + +import org.joda.time.DateTime; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.ISODateTimeFormat;
/**
diff --git a/petascope/src/petascope/wcs/server/core/convertGetCoverage.java b/petascope/src/petascope/wcs/server/core/convertGetCoverage.java index 92262e6..153728c 100644 --- a/petascope/src/petascope/wcs/server/core/convertGetCoverage.java +++ b/petascope/src/petascope/wcs/server/core/convertGetCoverage.java @@ -14,16 +14,15 @@ * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. + * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH. * * For more information please see <http://www.rasdaman.org> * or contact Peter Baumann via <baumann@rasdaman.com>. */ package petascope.wcs.server.core; -//~--- non-JDK imports -------------------------------------------------------- -import petascope.wcs.server.exceptions.WCSException; +import petascope.exceptions.WCSException; +import petascope.exceptions.ExceptionCode; import net.opengis.gml.v_3_1_1.TimePositionType; import net.opengis.ows.v_1_0_0.BoundingBoxType; import net.opengis.wcs.v_1_1_0.DomainSubsetType; @@ -31,27 +30,18 @@ import net.opengis.wcs.v_1_1_0.GetCoverage; import net.opengis.wcs.v_1_1_0.GridCrsType; import net.opengis.wcs.v_1_1_0.RangeSubsetType; import net.opengis.wcs.v_1_1_0.TimePeriodType; - -import petascope.wcps.server.core.DbMetadataSource; +import petascope.core.DbMetadataSource; import petascope.wcps.server.core.ProcessCoveragesRequest; -import petascope.wcps.server.exceptions.WCPSException; +import petascope.exceptions.WCPSException; import petascope.wcps.server.core.DomainElement; - import petascope.ConfigManager; - -//~--- JDK imports ------------------------------------------------------------ - import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.antlr.runtime.RecognitionException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import petascope.wcps.server.core.Metadata; -import petascope.wcs.server.exceptions.InvalidParameterValueException; -import petascope.wcs.server.exceptions.InvalidTemporalMetadataException; -import petascope.wcs.server.exceptions.MissingParameterValueException; -import petascope.wcs.server.exceptions.NoApplicableCodeException; +import petascope.core.Metadata; /** * This class takes a WCS GetCoverage XML request and converts this request into @@ -62,7 +52,7 @@ import petascope.wcs.server.exceptions.NoApplicableCodeException; */ public class convertGetCoverage { - private static Logger LOG = LoggerFactory.getLogger(convertGetCoverage.class); + private static Logger log = LoggerFactory.getLogger(convertGetCoverage.class); // Trimming private boolean xAxisTrim = false; private boolean yAxisTrim = false; @@ -125,11 +115,11 @@ public class convertGetCoverage { } /* Convert the abstract syntax query to a ProcessCoveragesRequest */ - LOG.debug("Converting WCPS abstract query '{}' to xml", abstractRequest); + log.debug("Converting WCPS abstract query '{}' to xml", abstractRequest); xmlRequest = ProcessCoveragesRequest.abstractQueryToXmlQuery(abstractRequest); - LOG.debug("Resulting XML query is: \n{}", xmlRequest); + log.debug("Resulting XML query is: \n{}", xmlRequest); } catch (RecognitionException re) { - throw new NoApplicableCodeException("Internal error: Generated abstract syntax query was not valid.", re); + throw new WCSException(ExceptionCode.NoApplicableCode, "Internal error: Generated abstract syntax query was not valid.", re); } return xmlRequest; @@ -149,10 +139,10 @@ public class convertGetCoverage { */ private void readField2() throws WCSException { if (!wcs.isSetDomainSubset()) { - throw new MissingParameterValueException("DomainSubset"); + throw new WCSException(ExceptionCode.MissingParameterValue, "DomainSubset"); } if (!wcs.getDomainSubset().isSetBoundingBox()) { - throw new MissingParameterValueException("BoundingBox"); + throw new WCSException(ExceptionCode.MissingParameterValue, "BoundingBox"); } DomainSubsetType domain = wcs.getDomainSubset(); @@ -166,27 +156,27 @@ public class convertGetCoverage { crsName = bbox.getCrs(); if (crsName != null) { if (crsName.equals(DomainElement.IMAGE_CRS)) { - LOG.trace("CRS: NATIVE_IMAGE_CRS"); + log.trace("CRS: NATIVE_IMAGE_CRS"); } else if (crsName.equals(DomainElement.WGS84_CRS)) { - LOG.trace("CRS: WGS84"); + log.trace("CRS: WGS84"); } else { - throw new InvalidParameterValueException("BoundingBox.crs. Explanation: " + throw new WCSException(ExceptionCode.InvalidParameterValue, "BoundingBox.crs. Explanation: " + "CRS '" + crsName + "' not available on this server."); } } else { - LOG.debug("CRS: None specified for bounding box"); - LOG.debug("CRS: Using default IMAGE_CRS"); + log.debug("CRS: None specified for bounding box"); + log.debug("CRS: Using default IMAGE_CRS"); crsName = DomainElement.IMAGE_CRS; } /* BBox declarations */ if (bbox.getLowerCorner().size() != 2) { - throw new InvalidParameterValueException("LowerCorner. Explanation: " + throw new WCSException(ExceptionCode.InvalidParameterValue, "LowerCorner. Explanation: " + "BoundingBox -> LowerCorner should have exactly two " + "values, not " + bbox.getLowerCorner().size()); } if (bbox.getUpperCorner().size() != 2) { - throw new InvalidParameterValueException("UpperCorner. Explanation: " + throw new WCSException(ExceptionCode.InvalidParameterValue, "UpperCorner. Explanation: " + "BoundingBox -> UpperCorner should have exactly two " + "values, not " + bbox.getUpperCorner().size()); } @@ -194,13 +184,13 @@ public class convertGetCoverage { xAxisTrim = true; int u2 = bbox.getLowerCorner().get(0).intValue(); int u3 = bbox.getUpperCorner().get(0).intValue(); - LOG.trace("Added X-axis trimming ! (DomainSubset->BoundingBox): " + u2 + " ... " + log.trace("Added X-axis trimming ! (DomainSubset->BoundingBox): " + u2 + " ... " + u3); yAxisTrim = true; int v2 = bbox.getLowerCorner().get(1).intValue(); int v3 = bbox.getUpperCorner().get(1).intValue(); - LOG.trace("Added Y-axis trimming ! (DomainSubset->BoundingBox): " + v2 + " ... " + log.trace("Added Y-axis trimming ! (DomainSubset->BoundingBox): " + v2 + " ... " + v3); /* Use bounding-box values as they are given */ @@ -211,7 +201,7 @@ public class convertGetCoverage { if (crsName.equals(DomainElement.IMAGE_CRS) == false && crsName.equals(DomainElement.WGS84_CRS) == false) { - throw new NoApplicableCodeException("Unknown CRS: " + crsName); + throw new WCSException(ExceptionCode.NoApplicableCode, "Unknown CRS: " + crsName); } } @@ -220,7 +210,7 @@ public class convertGetCoverage { // TemporalSubset is of type TimeSequenceType = choice(gml:TimePosition, wcs:TimePeriodType) Object one = domain.getTemporalSubset().getTimePositionOrTimePeriod().get(0); - LOG.trace("Inside TemporalSubset there is " + one.getClass()); + log.trace("Inside TemporalSubset there is " + one.getClass()); if (one instanceof net.opengis.gml.v_3_1_1.TimePositionType) { // TemporalSubset = gml:TimePosition // use WCPS:slice @@ -232,7 +222,7 @@ public class convertGetCoverage { /* Default syntax is ISO 8601. However, we also accept direct time-axis coordinates, as a fail-back solution. */ timePos = parseTimePosition(pos); - LOG.trace("Added time-axis slicing ! ( DomainSubset->TemporalSubset->gml:TimePositionType): position " + log.trace("Added time-axis slicing ! ( DomainSubset->TemporalSubset->gml:TimePositionType): position " + timePos); } else if (one instanceof net.opengis.wcs.v_1_1_0.TimePeriodType) { // TemporalSubset = wcs:TimePeriodType @@ -248,7 +238,7 @@ public class convertGetCoverage { time1 = parseTimePosition(pos1); time2 = parseTimePosition(pos2); - LOG.trace("Added time-axis trimming ! ( DomainSubset->TemporalSubset->wcs:TimePeriodType): " + log.trace("Added time-axis trimming ! ( DomainSubset->TemporalSubset->wcs:TimePeriodType): " + time1 + " ... " + time2); } } @@ -270,9 +260,9 @@ public class convertGetCoverage { RangeSubsetType.FieldSubset field = it.next(); fields.add(field.getIdentifier().getValue()); - LOG.trace("RangeSubsetType->FieldSubset->Identifier is " + log.trace("RangeSubsetType->FieldSubset->Identifier is " + field.getIdentifier().getValue()); - LOG.trace("RangeSubsetType->FieldSubset->Interpolation is " + log.trace("RangeSubsetType->FieldSubset->Interpolation is " + field.getInterpolationType()); /* NOTE: We ignore interpolation instructions (optional) */ /* NOTE: We ignore axis subset lists (optional) */ @@ -287,26 +277,26 @@ public class convertGetCoverage { */ private void readField4() throws WCSException { if (!wcs.isSetOutput()) { - throw new MissingParameterValueException("Output"); + throw new WCSException(ExceptionCode.MissingParameterValue, "Output"); } - LOG.trace("Format: " + wcs.getOutput().getFormat()); + log.trace("Format: " + wcs.getOutput().getFormat()); if (wcs.getOutput().isSetGridCRS()) { GridCrsType crs = wcs.getOutput().getGridCRS(); - throw new NoApplicableCodeException("Currently, the Output->GridCRS node is not supported !"); + throw new WCSException(ExceptionCode.NoApplicableCode, "Currently, the Output->GridCRS node is not supported !"); } String wcsMimeFormat = wcs.getOutput().getFormat(); format = meta.mimetypeToFormat(wcsMimeFormat); - LOG.trace("New format: " + format); + log.trace("New format: " + format); if ((format == null) || format.equals("")) { - throw new InvalidParameterValueException("Output format"); + throw new WCSException(ExceptionCode.InvalidParameterValue, "Output format"); } - LOG.trace("issetstore = " + wcs.getOutput().isSetStore()); - LOG.trace("isstore = " + wcs.getOutput().isStore()); + log.trace("issetstore = " + wcs.getOutput().isSetStore()); + log.trace("isstore = " + wcs.getOutput().isStore()); store = false; if (wcs.getOutput().isSetStore() && wcs.getOutput().isStore()) { store = true; @@ -314,7 +304,7 @@ public class convertGetCoverage { /* WCPS does not support "store=true" */ if (store) { - throw new InvalidParameterValueException("Output Store. Explanation: " + throw new WCSException(ExceptionCode.InvalidParameterValue, "Output Store. Explanation: " + "Cannot store result image on server."); } } @@ -327,50 +317,50 @@ public class convertGetCoverage { public void process() throws WCSException { /** * Processing starts here ... with the nodes of the WCS * */ // Service Description - LOG.debug("WCS service: \"" + wcs.SERVICE + "\""); - LOG.debug("WCS version: \"" + wcs.VERSION + "\""); + log.debug("WCS service: \"" + wcs.SERVICE + "\""); + log.debug("WCS version: \"" + wcs.VERSION + "\""); if (!wcs.SERVICE.equalsIgnoreCase("WCS")) { - throw new InvalidParameterValueException("Service. Explanation: " + throw new WCSException(ExceptionCode.InvalidParameterValue, "Service. Explanation: " + "Only the WCS service is supported."); } if (!wcs.VERSION.equals("1.1.0")) { - throw new InvalidParameterValueException("Version. Explanation: " + throw new WCSException(ExceptionCode.InvalidParameterValue, "Version. Explanation: " + "Only WCS Version 1.1.0 is currently supported."); } // First of all, error checking: is the coverage offered by the server? if (!wcs.isSetIdentifier()) { - throw new MissingParameterValueException("Identifier"); + throw new WCSException(ExceptionCode.MissingParameterValue, "Identifier"); } try { if (!meta.existsCoverageName(wcs.getIdentifier().getValue())) { - throw new InvalidParameterValueException("Identifier. Explanation: " + throw new WCSException(ExceptionCode.InvalidParameterValue, "Identifier. Explanation: " + "Coverage " + wcs.getIdentifier().getValue() + " is not served by this server."); } covMeta = meta.read(wcs.getIdentifier().getValue()); - } catch (WCPSException e) { - throw new InvalidParameterValueException("Identifier. Explanation: " + } catch (Exception e) { + throw new WCSException(ExceptionCode.InvalidParameterValue, "Identifier. Explanation: " + "Coverage " + wcs.getIdentifier().getValue() + " is not served by this server."); } // Convert all the child nodes of WCS GetCoverage XML node - LOG.trace("*** Reading WCS node 1 ... "); + log.trace("*** Reading WCS node 1 ... "); readField1(); - LOG.trace("*** Reading WCS node 2 ..."); + log.trace("*** Reading WCS node 2 ..."); readField2(); - LOG.trace("*** Reading WCS node 3 ..."); + log.trace("*** Reading WCS node 3 ..."); readField3(); - LOG.trace("*** Reading WCS node 4 ..."); + log.trace("*** Reading WCS node 4 ..."); readField4(); - LOG.trace("*** Assembling WCPS abstract syntax query ..."); + log.trace("*** Assembling WCPS abstract syntax query ..."); assembleFinalWcpsQuery(); /* Done building WCPS abstract query. */ finished = true; - LOG.trace("Done Converting WCS GetCoverage into WCPS ProcessCoverage."); + log.trace("Done Converting WCS GetCoverage into WCPS ProcessCoverage."); } /** @@ -442,55 +432,55 @@ public class convertGetCoverage { private String parseTimePosition(TimePositionType pos) throws WCSException { String result; - LOG.trace("TimePosition has length " + pos.getValue().size()); + log.trace("TimePosition has length " + pos.getValue().size()); if (pos.getValue().size() != 1) { - throw new InvalidParameterValueException("TimePosition. Explanation: " + throw new WCSException(ExceptionCode.InvalidParameterValue, "TimePosition. Explanation: " + "The TimePosition element should have exactly one item, and not " + pos.getValue().size()); } String timeStr = pos.getValue().get(0); - LOG.debug("Parsing time position: " + timeStr); + log.debug("Parsing time position: " + timeStr); try { // ISO 8601 parsing TimeString ts = new TimeString(timeStr); - LOG.debug("Found time position (ISO 8601): " + timeStr); + log.debug("Found time position (ISO 8601): " + timeStr); if (ts.subtract(covMeta.getTimePeriodBeginning()) < 0 || TimeString.difference(covMeta.getTimePeriodEnd(), timeStr) < 0) { - throw new InvalidParameterValueException("TimePosition: value " + timeStr + throw new WCSException(ExceptionCode.InvalidParameterValue, "TimePosition: value " + timeStr + " is outside this coverage's time range."); } String begin = covMeta.getTimePeriodBeginning(); if (begin == null) { - throw new InvalidTemporalMetadataException("Coverage '" + covMeta.getCoverageName() + throw new WCSException(ExceptionCode.InvalidTemporalMetadata, "Coverage '" + covMeta.getCoverageName() + "' has no time axis beginning or end in table PS_Domain."); } long diff1 = ts.subtract(begin); - LOG.trace("Selected time span (ISO 8601, in ms) : " + diff1); + log.trace("Selected time span (ISO 8601, in ms) : " + diff1); long diff2 = covMeta.getTimeSpan(); if (diff2 == -1) { - throw new InvalidTemporalMetadataException("Coverage '" + covMeta.getCoverageName() + throw new WCSException(ExceptionCode.InvalidTemporalMetadata, "Coverage '" + covMeta.getCoverageName() + "' has no time axis beginning or end in table PS_Domain."); } - LOG.trace("Coverage " + covMeta.getCoverageName() + " has time span (ISO 8601, in ms) : " + diff2); - LOG.trace("Coverage " + covMeta.getCoverageName() + " has time indexes span : " + covMeta.getTimeIndexesSpan()); + log.trace("Coverage " + covMeta.getCoverageName() + " has time span (ISO 8601, in ms) : " + diff2); + log.trace("Coverage " + covMeta.getCoverageName() + " has time indexes span : " + covMeta.getTimeIndexesSpan()); Double dIndex = covMeta.getTimeIndexesSpan() * diff1 * new Double(1.0) / diff2; if (dIndex == -1) { - throw new InvalidTemporalMetadataException("Coverage '" + covMeta.getCoverageName() + throw new WCSException(ExceptionCode.InvalidTemporalMetadata, "Coverage '" + covMeta.getCoverageName() + "' has no time axis."); } - LOG.trace("Computed time axis index: " + dIndex); + log.trace("Computed time axis index: " + dIndex); long timeIndex = dIndex.longValue(); result = String.valueOf(timeIndex); } catch (IllegalArgumentException e) { - LOG.warn("Time position '" + timeStr + "' was not in ISO 8601 format. Trying to parse integer..."); + log.warn("Time position '" + timeStr + "' was not in ISO 8601 format. Trying to parse integer..."); try { Integer tPos = Integer.parseInt(timeStr); - LOG.debug("Found time position in integer coordinates: " + tPos); + log.debug("Found time position in integer coordinates: " + tPos); result = tPos.toString(); } catch (NumberFormatException e2) { - throw new InvalidParameterValueException("TimePosition: " + timeStr, e2); + throw new WCSException(ExceptionCode.InvalidParameterValue, "TimePosition: " + timeStr, e2); } } diff --git a/petascope/src/petascope/wcs/server/core/executeDescribeCoverage.java b/petascope/src/petascope/wcs/server/core/executeDescribeCoverage.java index 1a7f882..5847559 100644 --- a/petascope/src/petascope/wcs/server/core/executeDescribeCoverage.java +++ b/petascope/src/petascope/wcs/server/core/executeDescribeCoverage.java @@ -14,16 +14,17 @@ * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. + * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH. * * For more information please see <http://www.rasdaman.org> * or contact Peter Baumann via <baumann@rasdaman.com>. */ package petascope.wcs.server.core; -//~--- non-JDK imports -------------------------------------------------------- -import petascope.wcs.server.exceptions.WCSException; +import petascope.core.Metadata; +import petascope.core.DbMetadataSource; +import petascope.exceptions.WCSException; +import petascope.exceptions.ExceptionCode; import net.opengis.ows.v_1_0_0.BoundingBoxType; import net.opengis.wcs.ows.v_1_1_0.DomainMetadataType; import net.opengis.wcs.ows.v_1_1_0.InterpolationMethodType; @@ -36,13 +37,8 @@ import net.opengis.wcs.v_1_1_0.DescribeCoverage; import net.opengis.wcs.v_1_1_0.FieldType; import net.opengis.wcs.v_1_1_0.RangeType; import net.opengis.wcs.v_1_1_0.SpatialDomainType; - import petascope.wcps.server.core.*; - -//~--- JDK imports ------------------------------------------------------------ - import java.util.Iterator; - import javax.xml.XMLConstants; import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; @@ -51,8 +47,6 @@ import net.opengis.wcs.ows.v_1_1_0.AnyValue; import net.opengis.wcs.v_1_1_0.TimeSequenceType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import petascope.wcs.server.exceptions.InvalidParameterValueException; -import petascope.wcs.server.exceptions.NoApplicableCodeException; /** * This class takes a WCS DescribeCoverage XML request and executes request, @@ -62,7 +56,7 @@ import petascope.wcs.server.exceptions.NoApplicableCodeException; */ public class executeDescribeCoverage { - private static Logger LOG = LoggerFactory.getLogger(executeDescribeCoverage.class); + private static Logger log = LoggerFactory.getLogger(executeDescribeCoverage.class); private boolean finished; private DescribeCoverage input; private DbMetadataSource meta; @@ -92,7 +86,7 @@ public class executeDescribeCoverage { process(); } if (finished == false) { - throw new NoApplicableCodeException("Could not execute the GetCapabilities request! " + throw new WCSException(ExceptionCode.NoApplicableCode, "Could not execute the GetCapabilities request! " + "Please see the other errors..."); } @@ -118,12 +112,12 @@ public class executeDescribeCoverage { * @return CoverageDescriptionType object, that can just be plugged in the respose object */ private CoverageDescriptionType getCoverageDescription(String name) throws WCSException { - LOG.trace("Building coverage description for coverage '" + name + "' ..."); + log.trace("Building coverage description for coverage '" + name + "' ..."); CoverageDescriptionType desc = new CoverageDescriptionType(); // Error checking: is the coverage available? if (meta.existsCoverageName(name) == false) { - throw new InvalidParameterValueException("Identifier. Explanation: Coverage " + throw new WCSException(ExceptionCode.InvalidParameterValue, "Identifier. Explanation: Coverage " + name + " is not served by this server !"); } @@ -133,7 +127,7 @@ public class executeDescribeCoverage { try { cov = meta.read(name); } catch (Exception e) { - throw new NoApplicableCodeException("Metadata for coverage " + name + " is not valid."); + throw new WCSException(ExceptionCode.NoApplicableCode, "Metadata for coverage " + name + " is not valid."); } desc.setIdentifier(name); @@ -169,7 +163,7 @@ public class executeDescribeCoverage { bbox.getUpperCorner().add(hi1); bbox.getUpperCorner().add(hi2); } else { - throw new NoApplicableCodeException("Internal error: Could " + throw new WCSException(ExceptionCode.NoApplicableCode, "Internal error: Could " + "not find X and Y cell domain extents."); } @@ -202,7 +196,7 @@ public class executeDescribeCoverage { /* Find a time-axis if exists */ CellDomainElement T = cov.getTCellDomain(); if (T != null) { - LOG.trace("Found time-axis for coverage: [" + T.getLo() + ", " + T.getHi() + "]"); + log.trace("Found time-axis for coverage: [" + T.getLo() + ", " + T.getHi() + "]"); TimeSequenceType temporal = new TimeSequenceType(); temporal.getTimePositionOrTimePeriod().add(T.getLo().intValue()); temporal.getTimePositionOrTimePeriod().add(T.getHi().intValue()); @@ -269,7 +263,7 @@ public class executeDescribeCoverage { desc.getSupportedCRS().add(DomainElement.WGS84_CRS); } - LOG.trace("Done building the Coverage Description for coverage '" + name + "'."); + log.trace("Done building the Coverage Description for coverage '" + name + "'."); return desc; } diff --git a/petascope/src/petascope/wcs/server/core/executeGetCapabilities.java b/petascope/src/petascope/wcs/server/core/executeGetCapabilities.java index 846f2c8..e000f9e 100644 --- a/petascope/src/petascope/wcs/server/core/executeGetCapabilities.java +++ b/petascope/src/petascope/wcs/server/core/executeGetCapabilities.java @@ -14,15 +14,16 @@ * You should have received a copy of the GNU General Public License * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. + * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH. * * For more information please see <http://www.rasdaman.org> * or contact Peter Baumann via <baumann@rasdaman.com>. */ package petascope.wcs.server.core; -import petascope.wcs.server.exceptions.WCSException; +import petascope.exceptions.PetascopeException; +import petascope.exceptions.WCSException; +import petascope.exceptions.ExceptionCode; import java.sql.SQLException; import java.util.Iterator; import javax.xml.bind.JAXBElement; @@ -44,17 +45,12 @@ import net.opengis.wcs.v_1_1_0.Capabilities; import net.opengis.wcs.v_1_1_0.Contents; import net.opengis.wcs.v_1_1_0.CoverageSummaryType; import net.opengis.wcs.v_1_1_0.GetCapabilities; -import petascope.wcps.server.core.DbMetadataSource; -import petascope.wcps.server.core.Metadata; -import petascope.wcps.server.exceptions.ResourceException; - +import petascope.core.DbMetadataSource; +import petascope.core.Metadata; import javax.xml.XMLConstants; import net.opengis.ows.v_1_0_0.AddressType; import net.opengis.wcs.ows.v_1_1_0.RequestMethodType; import petascope.ConfigManager; -import petascope.wcs.server.exceptions.InternalSqlException; -import petascope.wcs.server.exceptions.InvalidParameterValueException; -import petascope.wcs.server.exceptions.NoApplicableCodeException; /** * This class takes a WCS GetCapabilities XML request and executes request, @@ -87,12 +83,12 @@ public class executeGetCapabilities { * @return a Capabilities object. * @throws wcs_web_service.WCSException */ - public Capabilities get() throws WCSException { + public Capabilities get() throws WCSException, PetascopeException { if (finished == false) { process(); } if (finished == false) { - throw new NoApplicableCodeException("Could not execute the GetCapabilities request! " + throw new WCSException(ExceptionCode.NoApplicableCode, "Could not execute the GetCapabilities request! " + "Please see the other errors..."); } return output; @@ -102,9 +98,9 @@ public class executeGetCapabilities { * Computes the response to the GetCapabilities request given to the constructor. * @throws wcs_web_service.WCSException */ - public void process() throws WCSException { + public void process() throws WCSException, PetascopeException { if (!input.SERVICE.equalsIgnoreCase("WCS")) { - throw new InvalidParameterValueException("Service"); + throw new WCSException(ExceptionCode.InvalidParameterValue, "Service"); } try { @@ -117,7 +113,7 @@ public class executeGetCapabilities { finished = true; } catch (SQLException se) { finished = false; - throw new InternalSqlException(se.getMessage(), se); + throw new WCSException(ExceptionCode.InternalSqlError, se.getMessage(), se); } } @@ -252,14 +248,11 @@ public class executeGetCapabilities { * Builds the output node "Contents" * @throws java.sql.SQLException */ - private void buildField4() { + private void buildField4() throws PetascopeException { Contents cont = new Contents(); Iterator<String> coverages = null; - try { - coverages = meta.coverages().iterator(); - } catch (ResourceException e) { - } + coverages = meta.coverages().iterator(); while (coverages.hasNext()) { Metadata metadata = null; try { diff --git a/petascope/src/petascope/wcs/server/exceptions/ActionNotSupportedException.java b/petascope/src/petascope/wcs/server/exceptions/ActionNotSupportedException.java deleted file mode 100644 index 3211bb6..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/ActionNotSupportedException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class ActionNotSupportedException extends WCSException -{ - private final static String error = "ActionNotSupported"; - - public ActionNotSupportedException(String message) - { - super(error, message); - } - - public ActionNotSupportedException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/BadResponseHandlerException.java b/petascope/src/petascope/wcs/server/exceptions/BadResponseHandlerException.java deleted file mode 100644 index 5fa186c..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/BadResponseHandlerException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class BadResponseHandlerException extends WCSException -{ - private static final String error = "BadResponseHandler"; - - public BadResponseHandlerException(String message) - { - super(error, message); - } - - public BadResponseHandlerException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/InputOutputException.java b/petascope/src/petascope/wcs/server/exceptions/InputOutputException.java deleted file mode 100644 index f3a8667..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/InputOutputException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class InputOutputException extends WCSException -{ - private static final String error = "InputOutputError"; - - public InputOutputException(String message) - { - super(error, message); - } - - public InputOutputException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/InternalComponentException.java b/petascope/src/petascope/wcs/server/exceptions/InternalComponentException.java deleted file mode 100644 index 367ad3e..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/InternalComponentException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class InternalComponentException extends WCSException -{ - private static final String error = "InternalComponentError"; - - public InternalComponentException(String message) - { - super(error, message); - } - - public InternalComponentException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/InternalSqlException.java b/petascope/src/petascope/wcs/server/exceptions/InternalSqlException.java deleted file mode 100644 index d415864..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/InternalSqlException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class InternalSqlException extends WCSException -{ - private static final String error = "InternalSQLError"; - - public InternalSqlException(String message) - { - super(error, message); - } - - public InternalSqlException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidParameterValueException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidParameterValueException.java deleted file mode 100644 index 5f03a72..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/InvalidParameterValueException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class InvalidParameterValueException extends WCSException -{ - private static final String error = "InvalidParameterValue"; - - public InvalidParameterValueException(String message) - { - super(error, message); - } - - public InvalidParameterValueException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidPropertyValueException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidPropertyValueException.java deleted file mode 100644 index 9c036b3..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/InvalidPropertyValueException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class InvalidPropertyValueException extends WCSException -{ - private static final String error = "InvalidParameterValue"; - - public InvalidPropertyValueException(String message) - { - super(error, message); - } - - public InvalidPropertyValueException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidRequestException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidRequestException.java deleted file mode 100644 index e357684..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/InvalidRequestException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class InvalidRequestException extends WCSException -{ - private static final String error = "InvalidRequest"; - - public InvalidRequestException(String message) - { - super(error, message); - } - - public InvalidRequestException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidServiceConfigurationException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidServiceConfigurationException.java deleted file mode 100644 index 4f84673..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/InvalidServiceConfigurationException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class InvalidServiceConfigurationException extends WCSException -{ - private final static String error = "ActionNotSupported"; - - public InvalidServiceConfigurationException(String message) - { - super(error, message); - } - - public InvalidServiceConfigurationException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/InvalidTemporalMetadataException.java b/petascope/src/petascope/wcs/server/exceptions/InvalidTemporalMetadataException.java deleted file mode 100644 index 1ad11de..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/InvalidTemporalMetadataException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class InvalidTemporalMetadataException extends WCSException -{ - private static final String error = "InvalidParameterValue"; - - public InvalidTemporalMetadataException(String message) - { - super(error, message); - } - - public InvalidTemporalMetadataException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/MaliciousQueryException.java b/petascope/src/petascope/wcs/server/exceptions/MaliciousQueryException.java deleted file mode 100644 index bc00baa..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/MaliciousQueryException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class MaliciousQueryException extends WCSException -{ - private static final String error = "InvalidParameterValue"; - - public MaliciousQueryException(String message) - { - super(error, message); - } - - public MaliciousQueryException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/MissingParameterValueException.java b/petascope/src/petascope/wcs/server/exceptions/MissingParameterValueException.java deleted file mode 100644 index deb4390..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/MissingParameterValueException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class MissingParameterValueException extends WCSException -{ - private static final String error = "InvalidParameterValue"; - - public MissingParameterValueException(String message) - { - super(error, message); - } - - public MissingParameterValueException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/MultiBandImagesNotSupportedException.java b/petascope/src/petascope/wcs/server/exceptions/MultiBandImagesNotSupportedException.java deleted file mode 100644 index 63a9919..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/MultiBandImagesNotSupportedException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class MultiBandImagesNotSupportedException extends WCSException -{ - private static final String error = "InvalidParameterValue"; - - public MultiBandImagesNotSupportedException(String message) - { - super(error, message); - } - - public MultiBandImagesNotSupportedException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/NoApplicableCodeException.java b/petascope/src/petascope/wcs/server/exceptions/NoApplicableCodeException.java deleted file mode 100644 index 0568ece..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/NoApplicableCodeException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class NoApplicableCodeException extends WCSException -{ - private static final String error = "InvalidParameterValue"; - - public NoApplicableCodeException(String message) - { - super(error, message); - } - - public NoApplicableCodeException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/NodeParsingNotImplementedException.java b/petascope/src/petascope/wcs/server/exceptions/NodeParsingNotImplementedException.java deleted file mode 100644 index d1e278d..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/NodeParsingNotImplementedException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class NodeParsingNotImplementedException extends WCSException -{ - private static final String error = "NodeParsingNotImplemented"; - - public NodeParsingNotImplementedException(String message) - { - super(error, message); - } - - public NodeParsingNotImplementedException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/NotEnoughStorageException.java b/petascope/src/petascope/wcs/server/exceptions/NotEnoughStorageException.java deleted file mode 100644 index f1a668a..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/NotEnoughStorageException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class NotEnoughStorageException extends WCSException -{ - private static final String error = "InvalidParameterValue"; - - public NotEnoughStorageException(String message) - { - super(error, message); - } - - public NotEnoughStorageException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/RasdamanRequestFailedException.java b/petascope/src/petascope/wcs/server/exceptions/RasdamanRequestFailedException.java deleted file mode 100644 index 0960247..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/RasdamanRequestFailedException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class RasdamanRequestFailedException extends WCSException -{ - private final static String error = "InvalidParameterValue"; - - public RasdamanRequestFailedException(String message) - { - super(error, message); - } - - public RasdamanRequestFailedException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/RasdamanUnavailableException.java b/petascope/src/petascope/wcs/server/exceptions/RasdamanUnavailableException.java deleted file mode 100644 index db700c6..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/RasdamanUnavailableException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class RasdamanUnavailableException extends WCSException -{ - private final static String error = "InvalidParameterValue"; - - public RasdamanUnavailableException(String message) - { - super(error, message); - } - - public RasdamanUnavailableException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/ServletConnectionException.java b/petascope/src/petascope/wcs/server/exceptions/ServletConnectionException.java deleted file mode 100644 index d458cd2..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/ServletConnectionException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class ServletConnectionException extends WCSException -{ - private static final String error = "InvalidParameterValue"; - - public ServletConnectionException(String message) - { - super(error, message); - } - - public ServletConnectionException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/UnsupportedCombinationException.java b/petascope/src/petascope/wcs/server/exceptions/UnsupportedCombinationException.java deleted file mode 100644 index d9c388e..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/UnsupportedCombinationException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class UnsupportedCombinationException extends WCSException -{ - private final static String error = "UnsupportedCombination"; - - public UnsupportedCombinationException(String message) - { - super(error, message); - } - - public UnsupportedCombinationException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/WCSException.java b/petascope/src/petascope/wcs/server/exceptions/WCSException.java deleted file mode 100644 index 14e957a..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/WCSException.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ - - -package petascope.wcs.server.exceptions; - -//~--- non-JDK imports -------------------------------------------------------- - -import net.opengis.ows.v_1_0_0.ExceptionReport; -import net.opengis.ows.v_1_0_0.ExceptionType; - -//~--- JDK imports ------------------------------------------------------------ - -import java.util.Arrays; -import petascope.ConfigManager; - -/** - * Private Exception superclass for the WCS server. - * This class can return an error report, than can be marshalled into a - * WCS-standard compliant XML structure describing the error that has happened. - * - * @author Andrei Aiordachioaie - */ -public class WCSException extends Exception -{ -// private static Logger LOG = LoggerFactory.getLogger(WCSException.class); - - /* - private String[] errorCodes = - { - "MissingParameterValue", "InvalidParameterValue", "NoApplicableCode", - "UnsupportedCombination", "NotEnoughStorage", - "MaliciousQuery", "ActionNotSupported", "XmlStructuresError", - "BadResponseHandler", "MultiBandImagesNotSupported", "RasdamanUnavailable", - "ServletConnectionError", "XmlInputNotValid", "InvalidPropertyValue", - "InternalWcpsError", "InternalSqlError", "RasdamanRequestFailed", - "NodeParsingNotImplemented", "IOConnectionError", "InvalidTemporalMetadata", - "InvalidRequestString" - }; - */ - private ExceptionType item; - private ExceptionReport report; - private String errorCode; - private String errorDetail = ""; - - /** - * Default (minimal) constructor - * @param error Error Code - * @param detail Detailed message about the error - */ - protected WCSException(String error, String detail) - { - super(); - errorCode = error; - errorDetail = detail; - - createReport(); - } - - /** - * Convenience Constructor - * @param error Error Code - * @param detail Detailed message about the error - * @param e The cause of the current exception. - */ - protected WCSException(String error, String detail, Exception e) - { - super(e); - errorCode = error; - errorDetail = detail; - createReport(); - } - - private void createReport() - { - report = new ExceptionReport(); - report.setLanguage(ConfigManager.WCST_LANGUAGE); - report.setVersion(ConfigManager.WCST_VERSION); - - item = new ExceptionType(); - item.setExceptionCode(errorCode); - item.setLocator(errorDetail); - report.getException().add(item); - } - - /** Return the error code. - * - * @return - */ - public String getErrorCode() - { - return errorCode; - } - - /** Return the detailed error message. - * - * @return - */ - public String getErrorDetail() - { - return errorDetail; - } - - /** - * Retrieves a data structure that can be later marshalled into a XML - * "ExceptionReport" document. - * @return ExceptionReport object - */ - public ExceptionReport getReport() - { - return report; - } - - /** - * Adds text to this exception's detail message. - * @param msg - */ - public void appendErrorDetail(String msg) - { - this.errorDetail += msg; - createReport(); - } - - @Override - public String getMessage() - { - return this.errorDetail; - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/WcsRuntimeException.java b/petascope/src/petascope/wcs/server/exceptions/WcsRuntimeException.java deleted file mode 100644 index 4f37277..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/WcsRuntimeException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class WcsRuntimeException extends WCSException -{ - private static final String error = "RuntimeException"; - - public WcsRuntimeException(String message) - { - super(error, message); - } - - public WcsRuntimeException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/XmlNotValidException.java b/petascope/src/petascope/wcs/server/exceptions/XmlNotValidException.java deleted file mode 100644 index ba49b3a..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/XmlNotValidException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class XmlNotValidException extends WCSException -{ - private static final String error = "XmlDocumentNotValid"; - - public XmlNotValidException(String message) - { - super(error, message); - } - - public XmlNotValidException(String message, Exception e) - { - super(error, message, e); - } -} diff --git a/petascope/src/petascope/wcs/server/exceptions/XmlStructuresException.java b/petascope/src/petascope/wcs/server/exceptions/XmlStructuresException.java deleted file mode 100644 index 6016a51..0000000 --- a/petascope/src/petascope/wcs/server/exceptions/XmlStructuresException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of rasdaman community. - * - * Rasdaman community is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rasdaman community is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann / - rasdaman GmbH. - * - * For more information please see <http://www.rasdaman.org> - * or contact Peter Baumann via <baumann@rasdaman.com>. - */ -package petascope.wcs.server.exceptions; - -/** - * - * @author Andrei Aiordachioaie - */ -public class XmlStructuresException extends WCSException -{ - private static final String error = "XmlStructuresError"; - - public XmlStructuresException(String message) - { - super(error, message); - } - - public XmlStructuresException(String message, Exception e) - { - super(error, message, e); - } -} |