use of eu.europa.ec.fisheries.wsdl.subscription.module.SubscriptionDataRequest in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEventServiceBean method getMapToSubscriptionMessage.
@Override
public void getMapToSubscriptionMessage(@Observes @MapToSubscriptionRequestEvent EventMessage message) {
log.info(GOT_JMS_INSIDE_ACTIVITY_TO_GET + "MapToSubscriptionRequestEvent");
try {
TextMessage jmsMessage = message.getJmsMessage();
String jmsCorrelationID = jmsMessage.getJMSMessageID();
String messageReceived = jmsMessage.getText();
SubscriptionDataRequest subscriptionDataRequest = null;
MapToSubscriptionRequest baseRequest = JAXBUtils.unMarshallMessage(messageReceived, MapToSubscriptionRequest.class);
switch(baseRequest.getMessageType()) {
case FLUX_FA_QUERY_MESSAGE:
FLUXFAQueryMessage fluxfaQueryMessage = JAXBUtils.unMarshallMessage(baseRequest.getRequest(), FLUXFAQueryMessage.class);
subscriptionDataRequest = SubscriptionMapper.mapToSubscriptionDataRequest(fluxfaQueryMessage.getFAQuery());
break;
case FLUX_FA_REPORT_MESSAGE:
FLUXFAReportMessage fluxFAReportMessage = JAXBUtils.unMarshallMessage(baseRequest.getRequest(), FLUXFAReportMessage.class);
subscriptionDataRequest = SubscriptionMapper.mapToSubscriptionDataRequest(fluxFAReportMessage);
break;
default:
sendError(message, new IllegalArgumentException("VERBODEN VRUCHT"));
}
subscriptionProducer.sendMessageWithSpecificIds(JAXBUtils.marshallJaxBObjectToString(subscriptionDataRequest), subscriptionProducer.getDestination(), JMSUtils.lookupQueue(MessageConstants.QUEUE_RULES), null, jmsCorrelationID);
} catch (JAXBException | MessageException | JMSException e) {
sendError(message, e);
}
}
use of eu.europa.ec.fisheries.wsdl.subscription.module.SubscriptionDataRequest in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivitySubscriptionPermissionChecker method checkPermissionForFaReport.
public SubscriptionPermissionResponse checkPermissionForFaReport(FLUXFAReportMessage faReport) throws ActivityModuleException {
SubscriptionDataRequest subscriptionDataRequest = SubscriptionMapper.mapToSubscriptionDataRequest(faReport);
String subscrPermissionRequest;
try {
subscrPermissionRequest = JAXBUtils.marshallJaxBObjectToString(subscriptionDataRequest);
} catch (JAXBException e) {
throw new ActivityModuleException("JAXBException while trying to unmarshall to SubscriptionDataRequest from Subscription Module!", e);
}
return getPermissionFromSubscription(subscrPermissionRequest, activityConsumerBean.getDestination());
}
Aggregations