use of eu.europa.ec.fisheries.uvms.spatial.model.schemas.FilterAreasSpatialRS in project UVMS-ActivityModule-APP by UnionVMS.
the class SpatialModuleServiceBean method getFilteredAreaGeom.
/**
* {@inheritDoc}
*/
@Override
public String getFilteredAreaGeom(Collection<AreaIdentifierType> areaIdentifiers) throws ServiceException {
try {
String request = SpatialModuleRequestMapper.mapToFilterAreaSpatialRequest(new ArrayList<>(areaIdentifiers), new ArrayList<AreaIdentifierType>());
String correlationId = spatialProducer.sendModuleMessage(request, activityConsumer.getDestination());
TextMessage message = activityConsumer.getMessage(correlationId, TextMessage.class);
if (message != null && !isUserFault(message)) {
FilterAreasSpatialRS response = SpatialModuleResponseMapper.mapToFilterAreasSpatialRSFromResponse(message, correlationId);
return response.getGeometry();
} else {
throw new ServiceException("FAILED TO GET DATA FROM SPATIAL");
}
} catch (ServiceException | MessageException | SpatialModelMapperException e) {
log.error("Exception in communication with spatial while retrieving filtered area", e);
throw new ServiceException(e.getMessage(), e);
}
}
Aggregations