Search in sources :

Example 21 with IdType

use of eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdType in project UVMS-ActivityModule-APP by UnionVMS.

the class FaReportDocumentMapper method mapToFAReportIdentifierEntities.

protected Set<FaReportIdentifierEntity> mapToFAReportIdentifierEntities(List<IDType> idTypes, FaReportDocumentEntity faReportDocumentEntity) {
    if (CollectionUtils.isEmpty(idTypes)) {
        return Collections.emptySet();
    }
    Set<FaReportIdentifierEntity> faReportIdentifierEntities = new HashSet<>();
    for (IDType idType : idTypes) {
        FaReportIdentifierEntity faReportIdentifierEntity = FaReportDocumentMapper.INSTANCE.mapToFAReportIdentifierEntity(idType);
        faReportIdentifierEntity.setFaReportDocument(faReportDocumentEntity);
        faReportIdentifierEntities.add(faReportIdentifierEntity);
    }
    return faReportIdentifierEntities;
}
Also used : FaReportIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FaReportIdentifierEntity) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) HashSet(java.util.HashSet)

Example 22 with IdType

use of eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdType in project UVMS-ActivityModule-APP by UnionVMS.

the class FishingActivityMapper method mapToFishingActivityIdentifierEntities.

protected Set<FishingActivityIdentifierEntity> mapToFishingActivityIdentifierEntities(List<IDType> idTypes, FishingActivityEntity fishingActivityEntity) {
    if (idTypes == null || idTypes.isEmpty()) {
        return Collections.emptySet();
    }
    Set<FishingActivityIdentifierEntity> identifierEntities = new HashSet<>();
    for (IDType idType : idTypes) {
        FishingActivityIdentifierEntity identifier = FishingActivityMapper.INSTANCE.mapToFishingActivityIdentifierEntity(idType);
        identifier.setFishingActivity(fishingActivityEntity);
        identifierEntities.add(identifier);
    }
    return identifierEntities;
}
Also used : FishingActivityIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityIdentifierEntity) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) HashSet(java.util.HashSet)

Example 23 with IdType

use of eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdType in project UVMS-ActivityModule-APP by UnionVMS.

the class FluxPartyMapper method mapFluxPartyIdentifiers.

private void mapFluxPartyIdentifiers(FLUXParty target, Set<FluxPartyIdentifierEntity> fluxPartyIdentifierEntities) {
    if (CollectionUtils.isNotEmpty(fluxPartyIdentifierEntities)) {
        List<IDType> idTypeList = new ArrayList<>();
        for (FluxPartyIdentifierEntity source : fluxPartyIdentifierEntities) {
            IDType idType = new IDType();
            String fluxPartyIdentifierId = source.getFluxPartyIdentifierId();
            String fluxPartyIdentifierSchemeId = source.getFluxPartyIdentifierSchemeId();
            idType.setSchemeID(fluxPartyIdentifierSchemeId);
            idType.setValue(fluxPartyIdentifierId);
            idTypeList.add(idType);
        }
        target.setIDS(idTypeList);
    }
}
Also used : ArrayList(java.util.ArrayList) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FluxPartyIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxPartyIdentifierEntity)

Example 24 with IdType

use of eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdType in project UVMS-ActivityModule-APP by UnionVMS.

the class FluxPartyMapper method mapToFluxPartyIdentifierEntities.

protected Set<FluxPartyIdentifierEntity> mapToFluxPartyIdentifierEntities(List<IDType> idTypes, FluxPartyEntity fluxPartyEntity) {
    if (idTypes == null || idTypes.isEmpty()) {
        return Collections.emptySet();
    }
    Set<FluxPartyIdentifierEntity> fluxPartyIdentifierEntities = new HashSet<>();
    for (IDType idType : idTypes) {
        FluxPartyIdentifierEntity entity = FluxPartyMapper.INSTANCE.mapToFluxPartyIdentifierEntity(idType);
        entity.setFluxParty(fluxPartyEntity);
        fluxPartyIdentifierEntities.add(entity);
    }
    return fluxPartyIdentifierEntities;
}
Also used : IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FluxPartyIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxPartyIdentifierEntity) HashSet(java.util.HashSet)

Example 25 with IdType

use of eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdType in project UVMS-ActivityModule-APP by UnionVMS.

the class SubscriptionMapper method mapFluxPartyToSenderSubscriptionCriteria.

private static List<SubscriptionDataCriteria> mapFluxPartyToSenderSubscriptionCriteria(FLUXParty party) {
    List<SubscriptionDataCriteria> dataCriteriaList = new ArrayList<>();
    List<IDType> organisationIds = party.getIDS();
    for (IDType organisationId : organisationIds) {
        if ("FLUX_GP_PARTY".equals(organisationId.getSchemeID())) {
            String value = organisationId.getValue();
            dataCriteriaList.add(createCriteria(SENDER, ORGANISATION, SCHEME_ID, value));
        }
    }
    return dataCriteriaList;
}
Also used : ArrayList(java.util.ArrayList) SubscriptionDataCriteria(eu.europa.ec.fisheries.wsdl.subscription.module.SubscriptionDataCriteria) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)

Aggregations

IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)31 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)14 ArrayList (java.util.ArrayList)9 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)7 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)7 HashSet (java.util.HashSet)5 FLUXParty (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty)5 DelimitedPeriod (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod)4 FLUXReportDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument)4 FAQueryParameter (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQueryParameter)3 FLAPDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument)3 FaReportIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FaReportIdentifierEntity)2 FluxPartyIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxPartyIdentifierEntity)2 VesselIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.VesselIdentifierEntity)2 SubscriptionDataCriteria (eu.europa.ec.fisheries.wsdl.subscription.module.SubscriptionDataCriteria)2 GregorianCalendar (java.util.GregorianCalendar)2 List (java.util.List)2 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)2 SneakyThrows (lombok.SneakyThrows)2 Before (org.junit.Before)2