Search in sources :

Example 1 with LogWithRawMsgAndType

use of eu.europa.ec.fisheries.schema.exchange.v1.LogWithRawMsgAndType in project UVMS-ExchangeModule-APP by UnionVMS.

the class ExchangeLogServiceBean method getExchangeLogRawMessageAndValidationByGuid.

@Override
public ExchangeLogWithValidationResults getExchangeLogRawMessageAndValidationByGuid(String guid) throws ExchangeLogException {
    LogWithRawMsgAndType rawMsg = exchangeLogModel.getExchangeLogRawXmlByGuid(guid);
    ExchangeLogWithValidationResults validationFromRules = exchangeToRulesSyncMsgBean.getValidationFromRules(guid, rawMsg.getType());
    validationFromRules.setMsg(rawMsg.getRawMsg() != null ? rawMsg.getRawMsg() : StringUtils.EMPTY);
    return validationFromRules;
}
Also used : LogWithRawMsgAndType(eu.europa.ec.fisheries.schema.exchange.v1.LogWithRawMsgAndType) ExchangeLogWithValidationResults(eu.europa.ec.fisheries.schema.exchange.v1.ExchangeLogWithValidationResults)

Example 2 with LogWithRawMsgAndType

use of eu.europa.ec.fisheries.schema.exchange.v1.LogWithRawMsgAndType in project UVMS-ExchangeModule-APP by UnionVMS.

the class ExchangeLogModelBean method getExchangeLogRawXmlByGuid.

@Override
public LogWithRawMsgAndType getExchangeLogRawXmlByGuid(String guid) {
    LogWithRawMsgAndType logWrapper = new LogWithRawMsgAndType();
    try {
        ExchangeLog exchangeLog = logDao.getExchangeLogByGuid(guid);
        String rawMsg = exchangeLog.getTypeRefMessage();
        TypeRefType type = exchangeLog.getTypeRefType();
        logWrapper.setRawMsg(rawMsg);
        logWrapper.setType(type);
    } catch (ExchangeDaoException e) {
        LOG.error("[ERROR] Couldn't find Log with the following GUID : [[" + guid + "]]", e);
    }
    return logWrapper;
}
Also used : LogWithRawMsgAndType(eu.europa.ec.fisheries.schema.exchange.v1.LogWithRawMsgAndType) TypeRefType(eu.europa.ec.fisheries.schema.exchange.v1.TypeRefType) ExchangeDaoException(eu.europa.ec.fisheries.uvms.exchange.exception.ExchangeDaoException) ExchangeLog(eu.europa.ec.fisheries.uvms.exchange.entity.exchangelog.ExchangeLog)

Aggregations

LogWithRawMsgAndType (eu.europa.ec.fisheries.schema.exchange.v1.LogWithRawMsgAndType)2 ExchangeLogWithValidationResults (eu.europa.ec.fisheries.schema.exchange.v1.ExchangeLogWithValidationResults)1 TypeRefType (eu.europa.ec.fisheries.schema.exchange.v1.TypeRefType)1 ExchangeLog (eu.europa.ec.fisheries.uvms.exchange.entity.exchangelog.ExchangeLog)1 ExchangeDaoException (eu.europa.ec.fisheries.uvms.exchange.exception.ExchangeDaoException)1