Search in sources :

Example 26 with IdType

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

the class VesselTransportMeansMapper method mapToVesselIdentifierEntities.

protected Set<VesselIdentifierEntity> mapToVesselIdentifierEntities(List<IDType> idTypes, VesselTransportMeansEntity vesselTransportMeansEntity) {
    if (idTypes == null || idTypes.isEmpty()) {
        return Collections.emptySet();
    }
    Set<VesselIdentifierEntity> vesselIdentifierEntities = new HashSet<>();
    for (IDType idType : idTypes) {
        VesselIdentifierEntity vesselIdentifierEntity = VesselTransportMeansMapper.INSTANCE.mapToVesselIdentifierEntity(idType);
        vesselIdentifierEntity.setVesselTransportMeans(vesselTransportMeansEntity);
        vesselIdentifierEntities.add(vesselIdentifierEntity);
    }
    return vesselIdentifierEntities;
}
Also used : VesselIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselIdentifierEntity) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) HashSet(java.util.HashSet)

Example 27 with IdType

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

the class ActivityEventServiceBean method collectAllIdsFromMessage.

private Map<ActivityTableType, List<IDType>> collectAllIdsFromMessage(FLUXFAReportMessage faRepMessage) {
    Map<ActivityTableType, List<IDType>> idsmap = new EnumMap<>(ActivityTableType.class);
    idsmap.put(ActivityTableType.RELATED_FLUX_REPORT_DOCUMENT_ENTITY, new ArrayList<IDType>());
    if (faRepMessage == null) {
        return idsmap;
    }
    List<FAReportDocument> faReportDocuments = faRepMessage.getFAReportDocuments();
    if (CollectionUtils.isNotEmpty(faReportDocuments)) {
        for (FAReportDocument faRepDoc : faReportDocuments) {
            FLUXReportDocument relatedFLUXReportDocument = faRepDoc.getRelatedFLUXReportDocument();
            if (relatedFLUXReportDocument != null) {
                List<IDType> idTypes = new ArrayList<>();
                idTypes.addAll(relatedFLUXReportDocument.getIDS());
                idTypes.add(relatedFLUXReportDocument.getReferencedID());
                idTypes.removeAll(Collections.singletonList(null));
                idsmap.get(ActivityTableType.RELATED_FLUX_REPORT_DOCUMENT_ENTITY).addAll(idTypes);
            }
        }
    }
    return idsmap;
}
Also used : FLUXReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument) ArrayList(java.util.ArrayList) ActivityTableType(eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityTableType) ActivityUniquinessList(eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityUniquinessList) List(java.util.List) ArrayList(java.util.ArrayList) EnumMap(java.util.EnumMap) ActivityIDType(eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityIDType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FAReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument)

Example 28 with IdType

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

the class MapperUtil method getFluxReportDocument.

public static FLUXReportDocument getFluxReportDocument() {
    List<IDType> ids = Arrays.asList(getIdType("flux_report_doc_1", "fhty58-gh586t-5tjf8-t58rjewe"));
    IDType referencedID = getIdType("Ref ID 1", "fhty58-gh586t-5tjf8-t58rjewe");
    DateTimeType creationDateTime = getDateTimeType("2016-07-01 11:15:00");
    CodeType purposeCode = getCodeType("5", "FLUX_GP_PURPOSE");
    final TextType purpose = getTextType("Purpose Text");
    CodeType typeCode = getCodeType("FluxReportTypeCode", "fhty58-gh586t-5tjf8-t58rjewe");
    FLUXParty ownerFLUXParty = new FLUXParty(Arrays.asList(getIdType("Owner flux party id 1", "58fjrut-tjfuri-586jte-5jfur")), Arrays.asList(getTextType("This is sample text for owner flux party")));
    FLUXReportDocument fluxReportDocument = new FLUXReportDocument(ids, referencedID, creationDateTime, purposeCode, purpose, typeCode, ownerFLUXParty);
    return fluxReportDocument;
}
Also used : FLUXReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FLUXParty(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 29 with IdType

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

the class MapperUtil method getFluxLocation.

public static FLUXLocation getFluxLocation() {
    FLUXLocation fluxLocation = new FLUXLocation();
    CodeType typeCode = getCodeType("AREA", "FLUX_LOCATION_TYPE");
    IDType countryID = getIdType("XEU", "TERRITORY");
    CodeType regionalFisheriesManagementOrganizationCode = getCodeType("RFMO1", "fhty58-gh586t-5tjf8-t58rjewe");
    FLUXGeographicalCoordinate specifiedPhysicalFLUXGeographicalCoordinate = getFluxGeographicalCoordinate();
    IDType id = getIdType("25.5b", "FAO_AREA");
    CodeType geopoliticalRegionCode = getCodeType("Code type 2", "fhty258-g3h586t-5t4jf8-t58rjew5e");
    List<TextType> names = Arrays.asList(getTextType("This is sample name"));
    IDType sovereignRightsCountryID = getIdType("sovereign rights id 1", "fhty58-gh5486t-5t5jf8-t58rjewe");
    IDType jurisdictionCountryID = getIdType("jurisdiction country id 1", "fht1y58-gh5876t-5t3jf8-t58rjewe");
    List<FLUXCharacteristic> applicableFLUXCharacteristics = null;
    List<StructuredAddress> postalStructuredAddresses = Arrays.asList(getStructuredAddress());
    StructuredAddress physicalStructuredAddress = getStructuredAddress();
    fluxLocation.setTypeCode(typeCode);
    fluxLocation.setCountryID(countryID);
    fluxLocation.setRegionalFisheriesManagementOrganizationCode(regionalFisheriesManagementOrganizationCode);
    fluxLocation.setSpecifiedPhysicalFLUXGeographicalCoordinate(specifiedPhysicalFLUXGeographicalCoordinate);
    fluxLocation.setID(id);
    fluxLocation.setGeopoliticalRegionCode(geopoliticalRegionCode);
    fluxLocation.setNames(names);
    fluxLocation.setSovereignRightsCountryID(sovereignRightsCountryID);
    fluxLocation.setJurisdictionCountryID(jurisdictionCountryID);
    fluxLocation.setApplicableFLUXCharacteristics(applicableFLUXCharacteristics);
    fluxLocation.setPostalStructuredAddresses(postalStructuredAddresses);
    fluxLocation.setPhysicalStructuredAddress(physicalStructuredAddress);
    return fluxLocation;
}
Also used : FLUXGeographicalCoordinate(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXGeographicalCoordinate) FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) StructuredAddress(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.StructuredAddress) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FLUXCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 30 with IdType

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

the class MapperUtil method getVesselTransportMeans.

public static VesselTransportMeans getVesselTransportMeans() {
    VesselTransportMeans vesselTransportMeans = new VesselTransportMeans();
    CodeType roleCode = getCodeType("CATCHING_VESSEL", "FA_VESSEL_ROLE");
    List<TextType> names = Arrays.asList(getTextType("Test Name"));
    List<FLAPDocument> grantedFLAPDocuments = Arrays.asList(getFlapDocument());
    List<IDType> ids = Arrays.asList(getIdType("ID 1", "CFR"));
    List<ContactParty> specifiedContactParties = Arrays.asList(getContactParty());
    List<RegistrationEvent> specifiedRegistrationEvents = Arrays.asList(getRegistrationEvent());
    VesselCountry vesselCounty = new VesselCountry(getIdType("Country Id 1", "tu587r-5jt85-tjfur7-tjgut7"));
    vesselTransportMeans.setRoleCode(roleCode);
    vesselTransportMeans.setNames(names);
    vesselTransportMeans.setGrantedFLAPDocuments(grantedFLAPDocuments);
    vesselTransportMeans.setIDS(ids);
    vesselTransportMeans.setSpecifiedContactParties(specifiedContactParties);
    vesselTransportMeans.setSpecifiedRegistrationEvents(specifiedRegistrationEvents);
    vesselTransportMeans.setRegistrationVesselCountry(vesselCounty);
    return vesselTransportMeans;
}
Also used : VesselCountry(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselCountry) RegistrationEvent(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationEvent) FLAPDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) VesselTransportMeans(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) ContactParty(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactParty)

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