Search in sources :

Example 6 with UnsentMessageType

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

the class UnsentMessageMapper method mapToUnsentMessagePropertyEntities.

private static List<UnsentMessageProperty> mapToUnsentMessagePropertyEntities(UnsentMessageType message, UnsentMessage entity) {
    List<UnsentMessageTypeProperty> properties = message.getProperties();
    List<UnsentMessageProperty> unsentMessageProperties = new ArrayList<>();
    for (UnsentMessageTypeProperty property : properties) {
        UnsentMessageProperty unsentMessageProperty = new UnsentMessageProperty();
        unsentMessageProperty.setKey(property.getKey());
        unsentMessageProperty.setValue(property.getValue());
        unsentMessageProperty.setUnsentMessage(entity);
        unsentMessageProperties.add(unsentMessageProperty);
    }
    return unsentMessageProperties;
}
Also used : ArrayList(java.util.ArrayList) UnsentMessageTypeProperty(eu.europa.ec.fisheries.schema.exchange.v1.UnsentMessageTypeProperty) UnsentMessageProperty(eu.europa.ec.fisheries.uvms.exchange.entity.unsent.UnsentMessageProperty)

Aggregations

UnsentMessageType (eu.europa.ec.fisheries.schema.exchange.v1.UnsentMessageType)5 ExchangeModelException (eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelException)4 UnsentMessage (eu.europa.ec.fisheries.uvms.exchange.entity.unsent.UnsentMessage)2 ExchangeDaoException (eu.europa.ec.fisheries.uvms.exchange.exception.ExchangeDaoException)2 InputArgumentException (eu.europa.ec.fisheries.uvms.exchange.model.exception.InputArgumentException)2 ExchangeLogException (eu.europa.ec.fisheries.uvms.exchange.service.exception.ExchangeLogException)2 NotificationMessage (eu.europa.ec.fisheries.uvms.longpolling.notifications.NotificationMessage)2 ArrayList (java.util.ArrayList)2 UnsentMessageTypeProperty (eu.europa.ec.fisheries.schema.exchange.v1.UnsentMessageTypeProperty)1 UnsentMessageProperty (eu.europa.ec.fisheries.uvms.exchange.entity.unsent.UnsentMessageProperty)1 NoEntityFoundException (eu.europa.ec.fisheries.uvms.exchange.exception.NoEntityFoundException)1 ExchangeMessageException (eu.europa.ec.fisheries.uvms.exchange.message.exception.ExchangeMessageException)1