use of eu.europa.ec.fisheries.uvms.activity.model.schemas.GetNonUniqueIdsResponse in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEventServiceBean method getNonUniqueIdsRequest.
@Override
public void getNonUniqueIdsRequest(@Observes @GetNonUniqueIdsRequestEvent EventMessage message) {
log.info(GOT_JMS_INSIDE_ACTIVITY_TO_GET + "Non Matching Ids of different Tables : ");
try {
log.debug(message.getJmsMessage().getText());
GetNonUniqueIdsRequest getNonUniqueIdsRequest = JAXBMarshaller.unmarshallTextMessage(message.getJmsMessage(), GetNonUniqueIdsRequest.class);
GetNonUniqueIdsResponse faCatchSummaryReportResponse = matchingIdsService.getMatchingIdsResponse(getNonUniqueIdsRequest.getActivityUniquinessLists());
String response = JAXBMarshaller.marshallJaxBObjectToString(faCatchSummaryReportResponse);
producer.sendResponseMessageToSender(message.getJmsMessage(), response);
} catch (ActivityModelMarshallException | JMSException | MessageException e) {
sendError(message, e);
}
}
use of eu.europa.ec.fisheries.uvms.activity.model.schemas.GetNonUniqueIdsResponse in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEventServiceBean method deleteDuplicatedReportsFromXMLDocument.
private void deleteDuplicatedReportsFromXMLDocument(FLUXFAReportMessage repMsg) {
GetNonUniqueIdsRequest getNonUniqueIdsRequest = null;
try {
getNonUniqueIdsRequest = ActivityModuleRequestMapper.mapToGetNonUniqueIdRequestObject(collectAllIdsFromMessage(repMsg));
} catch (ActivityModelMarshallException e) {
log.error("[ERROR] Error while trying to get the unique ids from FaReportDocumentIdentifiers table...");
}
GetNonUniqueIdsResponse matchingIdsResponse = matchingIdsService.getMatchingIdsResponse(getNonUniqueIdsRequest.getActivityUniquinessLists());
List<ActivityUniquinessList> activityUniquinessLists = matchingIdsResponse.getActivityUniquinessLists();
final List<FAReportDocument> faReportDocuments = repMsg.getFAReportDocuments();
if (CollectionUtils.isNotEmpty(activityUniquinessLists)) {
for (ActivityUniquinessList unique : activityUniquinessLists) {
deleteBranchesThatMatchWithTheIdsList(unique.getIds(), faReportDocuments);
}
}
}
use of eu.europa.ec.fisheries.uvms.activity.model.schemas.GetNonUniqueIdsResponse in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityMatchingIdsServiceBean method getMatchingIdsResponse.
public GetNonUniqueIdsResponse getMatchingIdsResponse(List<ActivityUniquinessList> activityUniquinessLists) {
if (CollectionUtils.isEmpty(activityUniquinessLists)) {
return null;
}
GetNonUniqueIdsResponse response = new GetNonUniqueIdsResponse();
List<ActivityUniquinessList> activityUniquinessResponseLists = new ArrayList<>();
response.setMethod(ActivityModuleMethod.GET_NON_UNIQUE_IDS);
response.setActivityUniquinessLists(activityUniquinessResponseLists);
for (ActivityUniquinessList actUniqueReq : activityUniquinessLists) {
activityUniquinessResponseLists.add(getActivityNonUniqueIdsList(actUniqueReq));
}
return response;
}
use of eu.europa.ec.fisheries.uvms.activity.model.schemas.GetNonUniqueIdsResponse in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEventServiceBeanTest method setUp.
@Before
@SneakyThrows
public void setUp() {
nonUniqueIdsMessage = new ActiveMQTextMessage(session);
Whitebox.setInternalState(nonUniqueIdsMessage, "text", new SimpleString(getStrRequest1()));
Whitebox.setInternalState(nonUniqueIdsMessage, "jmsCorrelationID", "SomeCorrId");
nonUniqueIdsMessageEventMessage = new EventMessage(nonUniqueIdsMessage);
faAndTripIdsFromTripIdsMessage = new ActiveMQTextMessage(session);
Whitebox.setInternalState(faAndTripIdsFromTripIdsMessage, "text", new SimpleString(getStrRequest2()));
Whitebox.setInternalState(faAndTripIdsFromTripIdsMessage, "jmsCorrelationID", "SomeCorrId");
faAndTripIdsFromTripIdsEventMessage = new EventMessage(faAndTripIdsFromTripIdsMessage);
getNonUniqueIdsResponse = JAXBMarshaller.unmarshallTextMessage(getResponseStr1(), GetNonUniqueIdsResponse.class);
getFishingActivitiesForTripResponse = JAXBMarshaller.unmarshallTextMessage(getResponseStr2(), GetFishingActivitiesForTripResponse.class);
}
Aggregations