use of eu.europa.ec.fisheries.uvms.exchange.service.exception.ExchangeLogException in project UVMS-ExchangeModule-APP by UnionVMS.
the class ExchangeLogServiceBean method log.
@Override
public ExchangeLogType log(ExchangeLogType log, String username) throws ExchangeLogException {
try {
ExchangeLogType exchangeLog = exchangeLogModel.createExchangeLog(log, username);
String guid = exchangeLog.getGuid();
sendAuditLogMessageForCreateExchangeLog(guid, username);
exchangeLogEvent.fire(new NotificationMessage("guid", guid));
LOG.debug("[INFO] Logging message with guid : [ " + guid + " ]..");
return exchangeLog;
} catch (ExchangeModelException e) {
throw new ExchangeLogException("Couldn't create log exchange log.");
}
}
use of eu.europa.ec.fisheries.uvms.exchange.service.exception.ExchangeLogException in project UVMS-ExchangeModule-APP by UnionVMS.
the class ExchangeLogServiceBean method removeUnsentMessage.
@Override
public void removeUnsentMessage(String unsentMessageId, String username) throws ExchangeLogException {
log.debug("removeUnsentMessage in service layer:{}", unsentMessageId);
try {
String removeMessageId = unsentModel.removeMessage(unsentMessageId);
List<String> removedMessageIds = Arrays.asList(removeMessageId);
sendAuditLogMessageForRemoveUnsentMessage(removeMessageId, username);
sendingQueueEvent.fire(new NotificationMessage("messageIds", removedMessageIds));
} catch (ExchangeModelException e) {
log.error("Couldn't add message to unsent list {} {}", unsentMessageId, e);
throw new ExchangeLogException("Couldn't add message to unsent list");
}
}
use of eu.europa.ec.fisheries.uvms.exchange.service.exception.ExchangeLogException in project UVMS-ExchangeModule-APP by UnionVMS.
the class ExchangeLogMapper method getPollExchangeLog.
private static ExchangeLogType getPollExchangeLog(CommandType command) throws ExchangeLogException {
if (command.getPoll() == null) {
throw new ExchangeLogException("No poll");
}
// TODO fix in mobileterminal
SendPollType log = new SendPollType();
log.setType(LogType.SEND_POLL);
log.setDateRecieved(command.getTimestamp());
log.setRecipient(getRecipientOfPoll(command.getPoll().getPollReceiver()));
log.setSenderReceiver("System");
LogRefType logRefType = new LogRefType();
logRefType.setRefGuid(command.getPoll().getPollId());
logRefType.setType(TypeRefType.POLL);
log.setFwdDate(command.getTimestamp());
log.setTypeRef(logRefType);
return log;
}
Aggregations