use of org.n52.shetland.ogc.ows.service.OwsServiceResponse in project arctic-sea by 52North.
the class SimpleBinding method writeResponse.
protected void writeResponse(HttpServletRequest request, HttpServletResponse response, OwsServiceResponse serviceResponse) throws HTTPException, IOException {
try {
MediaType contentType = chooseResponseContentType(serviceResponse, HTTPHeaders.getAcceptHeader(request), getDefaultContentType());
if (!serviceResponse.isSetContentType()) {
serviceResponse.setContentType(contentType);
}
httpUtils.writeObject(request, response, contentType, serviceResponse, this);
} finally {
serviceResponse.close();
}
}
use of org.n52.shetland.ogc.ows.service.OwsServiceResponse in project arctic-sea by 52North.
the class EXIBinding method doPostOperation.
@Override
public void doPostOperation(HttpServletRequest req, HttpServletResponse res) throws HTTPException, IOException {
OwsServiceRequest sosRequest = null;
try {
sosRequest = parseRequest(req);
OwsServiceResponse sosResponse = getServiceOperator(sosRequest).receiveRequest(sosRequest);
writeResponse(req, res, sosResponse);
} catch (OwsExceptionReport oer) {
oer.setVersion(sosRequest != null ? sosRequest.getVersion() : null);
writeOwsExceptionReport(req, res, oer);
}
}
use of org.n52.shetland.ogc.ows.service.OwsServiceResponse in project arctic-sea by 52North.
the class PoxBinding method doPostOperation.
@Override
public void doPostOperation(HttpServletRequest req, HttpServletResponse res) throws HTTPException, IOException {
OwsServiceRequest request = null;
try {
request = parseRequest(req);
OwsServiceResponse response = getServiceOperator(request).receiveRequest(request);
writeResponse(req, res, response);
} catch (OwsExceptionReport oer) {
oer.setVersion(request != null ? request.getVersion() : null);
LOG.warn("Unexpected error", oer);
writeOwsExceptionReport(req, res, oer);
}
}
use of org.n52.shetland.ogc.ows.service.OwsServiceResponse in project arctic-sea by 52North.
the class GenericRequestOperator method checkForModifierAndProcess.
private void checkForModifierAndProcess(OwsServiceRequest request, OwsServiceResponse response) throws OwsExceptionReport {
if (!this.modifierRepository.hasRequestResponseModifier(request, response)) {
return;
}
List<RequestResponseModifier> defaultModifier = new LinkedList<>();
List<RequestResponseModifier> remover = new LinkedList<>();
List<RequestResponseModifier> merger = new LinkedList<>();
this.modifierRepository.getRequestResponseModifier(request, response).stream().forEach(modifier -> {
if (modifier.getFacilitator().isMerger()) {
merger.add(modifier);
} else if (modifier.getFacilitator().isAdderRemover()) {
remover.add(modifier);
} else {
defaultModifier.add(modifier);
}
});
// execute merger
for (RequestResponseModifier modifier : merger) {
modifier.modifyResponse(request, response);
}
// execute default
for (RequestResponseModifier modifier : defaultModifier) {
modifier.modifyResponse(request, response);
}
// execute adder/remover
for (RequestResponseModifier modifier : remover) {
modifier.modifyResponse(request, response);
}
}
use of org.n52.shetland.ogc.ows.service.OwsServiceResponse in project arctic-sea by 52North.
the class SosDecoderv20 method parseGetResultResponse.
private OwsServiceResponse parseGetResultResponse(final GetResultResponseDocument getResultResponseDoc) throws DecodingException {
final GetResultResponse sosGetResultResponse = new GetResultResponse();
final GetResultResponseType getResultResponse = getResultResponseDoc.getGetResultResponse();
final String resultValues = parseResultValues(getResultResponse.getResultValues());
sosGetResultResponse.setResultValues(resultValues);
return sosGetResultResponse;
}
Aggregations