use of org.n52.janmayen.http.MediaType in project arctic-sea by 52North.
the class SimpleBinding method encodeResponse.
protected Object encodeResponse(OwsServiceResponse response, MediaType contentType) throws OwsExceptionReport {
try {
OperationResponseEncoderKey key = new OperationResponseEncoderKey(new OwsOperationKey(response), contentType);
Encoder<Object, OwsServiceResponse> encoder = getEncoder(key);
if (encoder == null) {
throw new NoEncoderForKeyException(key);
}
return encoder.encode(response);
} catch (EncodingException ex) {
throw new NoApplicableCodeException().withMessage(ex.getMessage()).causedBy(ex);
}
}
use of org.n52.janmayen.http.MediaType in project arctic-sea by 52North.
the class SosDecoderv100 method parseDescribeSensor.
/**
* parses the XmlBean representing the describeSensor request and creates a
* DescribeSensor request
*
* @param descSensorDoc
* XmlBean created from the incoming request stream
* @return Returns SosDescribeSensorRequest representing the request
*/
private OwsServiceCommunicationObject parseDescribeSensor(DescribeSensorDocument descSensorDoc) {
DescribeSensorRequest request = new DescribeSensorRequest();
DescribeSensor descSensor = descSensorDoc.getDescribeSensor();
request.setService(descSensor.getService());
request.setVersion(descSensor.getVersion());
// parse outputFormat through MediaType to ensure it's a mime type and
// eliminate whitespace variations
request.setProcedureDescriptionFormat(MediaType.normalizeString(descSensor.getOutputFormat()));
request.setProcedure(descSensor.getProcedure());
return request;
}
Aggregations