use of org.n52.shetland.ogc.ows.service.OwsServiceRequest in project arctic-sea by 52North.
the class KvpBinding method doGetOperation.
@Override
public void doGetOperation(HttpServletRequest req, HttpServletResponse res) throws HTTPException, IOException {
LOGGER.debug("KVP-REQUEST: {}", req.getQueryString());
OwsServiceRequest serviceRequest = null;
try {
serviceRequest = parseRequest(req);
// add request context information
serviceRequest.setRequestContext(getRequestContext(req));
OwsServiceResponse response = getServiceOperator(serviceRequest).receiveRequest(serviceRequest);
writeResponse(req, res, response);
} catch (OwsExceptionReport oer) {
oer.setVersion(serviceRequest != null ? serviceRequest.getVersion() : null);
writeOwsExceptionReport(req, res, oer);
}
}
use of org.n52.shetland.ogc.ows.service.OwsServiceRequest in project arctic-sea by 52North.
the class SosDecoderv100 method parseGetFeatureOfInterest.
/**
* parses the passes XmlBeans document and creates a SOS
* getFeatureOfInterest request
*
* @param getFoiDoc
* XmlBeans document representing the getFeatureOfInterest
* request
* @return Returns SOS getFeatureOfInterest request
*
* @throws DecodingException
* * if validation of the request failed
*/
private OwsServiceRequest parseGetFeatureOfInterest(GetFeatureOfInterestDocument getFoiDoc) throws DecodingException {
GetFeatureOfInterestRequest getFoiRequest = new GetFeatureOfInterestRequest();
GetFeatureOfInterest getFoi = getFoiDoc.getGetFeatureOfInterest();
getFoiRequest.setService(getFoi.getService());
getFoiRequest.setVersion(getFoi.getVersion());
getFoiRequest.setFeatureIdentifiers(Arrays.asList(getFoi.getFeatureOfInterestIdArray()));
getFoiRequest.setSpatialFilters(parseSpatialFilters4GetFeatureOfInterest(getFoi.getLocation()));
return getFoiRequest;
}
use of org.n52.shetland.ogc.ows.service.OwsServiceRequest in project arctic-sea by 52North.
the class SosDecoderv100 method parseGetCapabilities.
/**
* parses the XmlBean representing the getCapabilities request and creates a
* SosGetCapabilities request
*
* @param getCapsDoc
* XmlBean created from the incoming request stream
* @return Returns SosGetCapabilitiesRequest representing the request
*/
private OwsServiceRequest parseGetCapabilities(GetCapabilitiesDocument getCapsDoc) {
GetCapabilities getCaps = getCapsDoc.getGetCapabilities();
GetCapabilitiesRequest request = new GetCapabilitiesRequest(getCaps.getService());
if (getCaps.getAcceptFormats() != null && getCaps.getAcceptFormats().sizeOfOutputFormatArray() != 0) {
request.setAcceptFormats(Arrays.asList(getCaps.getAcceptFormats().getOutputFormatArray()));
}
if (getCaps.getAcceptVersions() != null && getCaps.getAcceptVersions().sizeOfVersionArray() != 0) {
request.setAcceptVersions(Arrays.asList(getCaps.getAcceptVersions().getVersionArray()));
}
if (getCaps.getSections() != null && getCaps.getSections().getSectionArray().length != 0) {
request.setSections(Arrays.asList(getCaps.getSections().getSectionArray()));
}
return request;
}
use of org.n52.shetland.ogc.ows.service.OwsServiceRequest in project arctic-sea by 52North.
the class SosDecoderv20 method parseGetObservation.
/**
* parses the XmlBean representing the getObservation request and creates a
* SoSGetObservation request
*
* @param getObsDoc
* XmlBean created from the incoming request stream
* @return Returns SosGetObservationRequest representing the request
*
* @throws DecodingException
* * If parsing the XmlBean failed
*/
private OwsServiceRequest parseGetObservation(final GetObservationDocument getObsDoc) throws DecodingException {
final GetObservationRequest getObsRequest = new GetObservationRequest();
final GetObservationType getObsType = getObsDoc.getGetObservation();
// TODO: check
getObsRequest.setService(getObsType.getService());
getObsRequest.setVersion(getObsType.getVersion());
getObsRequest.setOfferings(Arrays.asList(getObsType.getOfferingArray()));
getObsRequest.setObservedProperties(Arrays.asList(getObsType.getObservedPropertyArray()));
getObsRequest.setProcedures(Arrays.asList(getObsType.getProcedureArray()));
getObsRequest.setTemporalFilters(parseTemporalFilters4GetObservation(getObsType.getTemporalFilterArray()));
if (getObsType.isSetSpatialFilter()) {
getObsRequest.setSpatialFilter(parseSpatialFilter4GetObservation(getObsType.getSpatialFilter()));
}
getObsRequest.setFeatureIdentifiers(Arrays.asList(getObsType.getFeatureOfInterestArray()));
if (getObsType.isSetResponseFormat()) {
try {
final String responseFormat = URLDecoder.decode(getObsType.getResponseFormat(), "UTF-8");
getObsRequest.setResponseFormat(responseFormat);
} catch (final UnsupportedEncodingException e) {
throw new DecodingException(e, "Error while encoding response format!");
}
}
getObsRequest.setExtensions(parseExtensibleRequest(getObsType));
return getObsRequest;
}
use of org.n52.shetland.ogc.ows.service.OwsServiceRequest in project arctic-sea by 52North.
the class SosDecoderv20 method parseGetResult.
private OwsServiceRequest parseGetResult(final GetResultDocument getResultDoc) throws DecodingException {
final GetResultType getResult = getResultDoc.getGetResult();
final GetResultRequest sosGetResultRequest = new GetResultRequest();
sosGetResultRequest.setService(getResult.getService());
sosGetResultRequest.setVersion(getResult.getVersion());
sosGetResultRequest.setOffering(getResult.getOffering());
sosGetResultRequest.setObservedProperty(getResult.getObservedProperty());
sosGetResultRequest.setFeatureIdentifiers(Arrays.asList(getResult.getFeatureOfInterestArray()));
getResult.getFeatureOfInterestArray();
if (getResult.isSetSpatialFilter()) {
sosGetResultRequest.setSpatialFilter(parseSpatialFilter4GetResult(getResult.getSpatialFilter()));
}
sosGetResultRequest.setExtensions(parseExtensibleRequest(getResult));
sosGetResultRequest.setTemporalFilter(parseTemporalFilters4GetResult(getResult.getTemporalFilterArray()));
return sosGetResultRequest;
}
Aggregations