Search in sources :

Example 1 with FLUXLocation

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getStandardFishingActivity.

private static FishingActivity getStandardFishingActivity() {
    List<IDType> ids = Arrays.asList(getIdType("Id_1", "fhr574fh-thrud754-kgitjf754-gjtufe89"));
    CodeType typeCode = getCodeType("FISHING_OPERATION", "FLUX_FA_TYPE");
    DateTimeType occurrenceDateTime = getDateTimeType("2016-07-01 11:15:00");
    CodeType reasonCode = getCodeType("Reason_code_1", "FA_REASON_DEPARTURE");
    CodeType vesselRelatedActivityCode = getCodeType("Vessel activity 1", "58thft-58fjd8-gt85eje-hjgute8");
    CodeType fisheryTypeCode = getCodeType("Fishing_Type_code 1", "FA_FISHERY");
    CodeType speciesTargetCode = getCodeType("Species code 1", "FAO_SPECIES");
    QuantityType operationsQuantity = getQuantityType(100);
    MeasureType fishingDurationMeasure = getMeasureType(500, "C62", "4hr2yf0-t583thf-6jgttue8-6jtie844");
    List<FLAPDocument> specifiedFLAPDocument = Arrays.asList(getFlapDocument());
    VesselStorageCharacteristic sourceVesselStorageCharacteristic = getVesselStorageCharacteristic();
    VesselStorageCharacteristic destinationVesselStorageCharacteristic = getVesselStorageCharacteristic();
    List<FACatch> specifiedFACatches = Arrays.asList(getFaCatch());
    List<FLUXLocation> relatedFLUXLocations = Arrays.asList(getFluxLocation());
    List<GearProblem> specifiedGearProblems = Arrays.asList(getGearProblem());
    List<FLUXCharacteristic> specifiedFLUXCharacteristics = Arrays.asList(getFluxCharacteristics());
    List<FishingGear> specifiedFishingGears = Arrays.asList(getFishingGear());
    List<DelimitedPeriod> specifiedDelimitedPeriods = Arrays.asList(getDelimitedPeriod());
    FishingTrip specifiedFishingTrip = getFishingTrip();
    List<VesselTransportMeans> relatedVesselTransportMeans = Arrays.asList(getVesselTransportMeans());
    FishingActivity fishingActivity = new FishingActivity(ids, typeCode, occurrenceDateTime, reasonCode, vesselRelatedActivityCode, fisheryTypeCode, speciesTargetCode, operationsQuantity, fishingDurationMeasure, specifiedFACatches, relatedFLUXLocations, specifiedGearProblems, specifiedFLUXCharacteristics, specifiedFishingGears, sourceVesselStorageCharacteristic, destinationVesselStorageCharacteristic, null, specifiedFLAPDocument, specifiedDelimitedPeriods, specifiedFishingTrip, relatedVesselTransportMeans);
    return fishingActivity;
}
Also used : DelimitedPeriod(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod) FLAPDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument) FishingGear(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) GearProblem(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.GearProblem) FishingActivity(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity) VesselStorageCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselStorageCharacteristic) FLUXCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic) VesselTransportMeans(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) FishingTrip(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) FACatch(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)

Example 2 with FLUXLocation

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation in project UVMS-ActivityModule-APP by UnionVMS.

the class FluxLocationMapperTest method getFluxLocationEntityMock.

private FluxLocationEntity getFluxLocationEntityMock() {
    FLUXLocation fluxLocation = MapperUtil.getFluxLocation();
    FluxLocationCatchTypeEnum fluxLocationTypeEnum = FluxLocationCatchTypeEnum.FA_CATCH_SPECIFIED;
    FluxLocationEntity fluxLocationEntity = FluxLocationMapper.INSTANCE.mapToFluxLocationEntity(fluxLocation);
    fluxLocationEntity.setFluxLocationType(fluxLocationTypeEnum.getType());
    return fluxLocationEntity;
}
Also used : FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) FluxLocationCatchTypeEnum(eu.europa.ec.fisheries.ers.fa.utils.FluxLocationCatchTypeEnum) FluxLocationEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxLocationEntity)

Example 3 with FLUXLocation

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getFluxCharacteristics.

public static FLUXCharacteristic getFluxCharacteristics() {
    CodeType typeCode = getCodeType("Code 1", "57t3yf-ght43yrf-ght56yru-ght7565h");
    List<TextType> descriptions = Arrays.asList(getTextType("This is test description"));
    MeasureType valueMeasure = getMeasureType(333, "C62", "57t3yf-ght43yrf-ght56yru-ght7565h");
    DateTimeType valueDateTime = getDateTimeType("2016-07-01 11:15:00");
    IndicatorType valueIndicator = getIndicatorType(true, "Test value", "Test format");
    CodeType valueCode = getCodeType("Code Value 1", "57tr4t3yf-ght43yrf-ght56yr5u-ght75365h");
    List<TextType> values = Arrays.asList(getTextType("This is sample value"));
    QuantityType valueQuantity = getQuantityType(123);
    List<FLUXLocation> specifiedFLUXLocations = null;
    List<FLAPDocument> relatedFLAPDocuments = Arrays.asList(getFlapDocument());
    FLUXCharacteristic fluxCharacteristic = new FLUXCharacteristic(typeCode, descriptions, valueMeasure, valueDateTime, valueIndicator, valueCode, values, valueQuantity, specifiedFLUXLocations, relatedFLAPDocuments);
    return fluxCharacteristic;
}
Also used : DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) IndicatorType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IndicatorType) QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) FLAPDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) FLUXCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 4 with FLUXLocation

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation in project UVMS-ActivityModule-APP by UnionVMS.

the class FaCatchMapper method getFluxLocationEntities.

protected Set<FluxLocationEntity> getFluxLocationEntities(List<FLUXLocation> specifiedFluxLocations, List<FLUXLocation> destFluxLocations, FaCatchEntity faCatchEntity) {
    Set<FluxLocationEntity> fluxLocationEntities = new HashSet<>();
    if (specifiedFluxLocations != null && !specifiedFluxLocations.isEmpty()) {
        for (FLUXLocation fluxLocation : specifiedFluxLocations) {
            FluxLocationEntity fluxLocationEntity = FluxLocationMapper.INSTANCE.mapToFluxLocationEntity(fluxLocation);
            Set<StructuredAddressEntity> structuredAddressEntitySet = new HashSet<>();
            StructuredAddress physicalStructuredAddress = fluxLocation.getPhysicalStructuredAddress();
            StructuredAddressEntity physicalStructuredAddressEntity = StructuredAddressMapper.INSTANCE.mapToStructuredAddressEntity(physicalStructuredAddress);
            if (physicalStructuredAddressEntity != null) {
                physicalStructuredAddressEntity.setFluxLocation(fluxLocationEntity);
                physicalStructuredAddressEntity.setStructuredAddressType(StructuredAddressTypeEnum.FLUX_PHYSICAL.getType());
                structuredAddressEntitySet.add(physicalStructuredAddressEntity);
            }
            List<StructuredAddress> postalStructuredAddresses = fluxLocation.getPostalStructuredAddresses();
            if (postalStructuredAddresses != null && !postalStructuredAddresses.isEmpty()) {
                for (StructuredAddress structuredAddress : postalStructuredAddresses) {
                    StructuredAddressEntity structuredAddressEntity = StructuredAddressMapper.INSTANCE.mapToStructuredAddressEntity(structuredAddress);
                    if (structuredAddressEntity != null) {
                        structuredAddressEntity.setStructuredAddressType(StructuredAddressTypeEnum.FLUX_POSTAL.getType());
                        structuredAddressEntity.setFluxLocation(fluxLocationEntity);
                        structuredAddressEntitySet.add(structuredAddressEntity);
                    }
                }
            }
            fluxLocationEntity.setStructuredAddresses(structuredAddressEntitySet);
            fluxLocationEntity.setFaCatch(faCatchEntity);
            fluxLocationEntity.setFluxLocationType(FluxLocationCatchTypeEnum.FA_CATCH_SPECIFIED.getType());
            fluxLocationEntities.add(fluxLocationEntity);
        }
    }
    if (destFluxLocations != null && !destFluxLocations.isEmpty()) {
        for (FLUXLocation fluxLocation : destFluxLocations) {
            FluxLocationEntity fluxLocationEntity = FluxLocationMapper.INSTANCE.mapToFluxLocationEntity(fluxLocation);
            fluxLocationEntity.setFaCatch(faCatchEntity);
            fluxLocationEntity.setFluxLocationType(FluxLocationCatchTypeEnum.FA_CATCH_DESTINATION.getType());
            fluxLocationEntities.add(fluxLocationEntity);
        }
    }
    return fluxLocationEntities;
}
Also used : StructuredAddressEntity(eu.europa.ec.fisheries.ers.fa.entities.StructuredAddressEntity) FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) StructuredAddress(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.StructuredAddress) FluxLocationEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxLocationEntity) HashSet(java.util.HashSet)

Example 5 with FLUXLocation

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation in project UVMS-ActivityModule-APP by UnionVMS.

the class FishingActivityMapper method getFluxLocationEntities.

protected Set<FluxLocationEntity> getFluxLocationEntities(List<FLUXLocation> fluxLocations, FishingActivityEntity fishingActivityEntity) {
    if (fluxLocations == null || fluxLocations.isEmpty()) {
        return Collections.emptySet();
    }
    Set<FluxLocationEntity> fluxLocationEntities = new HashSet<>();
    for (FLUXLocation fluxLocation : fluxLocations) {
        FluxLocationEntity fluxLocationEntity = FluxLocationMapper.INSTANCE.mapToFluxLocationEntity(fluxLocation);
        fluxLocationEntity.setFluxLocationType(FluxLocationCatchTypeEnum.FA_RELATED.getType());
        fluxLocationEntity.setFishingActivity(fishingActivityEntity);
        fluxLocationEntities.add(fluxLocationEntity);
    }
    return fluxLocationEntities;
}
Also used : FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) FluxLocationEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxLocationEntity) HashSet(java.util.HashSet)

Aggregations

FLUXLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation)10 FluxLocationEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxLocationEntity)5 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)5 FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)4 MeasureType (un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)4 QuantityType (un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType)4 HashSet (java.util.HashSet)3 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)3 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)3 FACatch (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)2 FLAPDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument)2 FishingGear (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear)2 FishingTrip (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip)2 StructuredAddress (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.StructuredAddress)2 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)2 IndicatorType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IndicatorType)2 StructuredAddressEntity (eu.europa.ec.fisheries.ers.fa.entities.StructuredAddressEntity)1 FluxLocationCatchTypeEnum (eu.europa.ec.fisheries.ers.fa.utils.FluxLocationCatchTypeEnum)1 Test (org.junit.Test)1 AAPProcess (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess)1