Search in sources :

Example 1 with QuantityType

use of net.opengis.swe.x20.QuantityType 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 QuantityType

use of net.opengis.swe.x20.QuantityType 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 3 with QuantityType

use of net.opengis.swe.x20.QuantityType in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapOperationsQuantity.

private void mapOperationsQuantity(FishingActivity target, FishingActivityEntity source) {
    if (ObjectUtils.allNotNull(target, target)) {
        QuantityType quantityType = new QuantityType();
        if (source.getOperationsQuantity() != null) {
            Double operationQuantity = source.getOperationsQuantity().getValue();
            if (operationQuantity != null) {
                quantityType.setValue(new BigDecimal(operationQuantity));
            }
            String unitCode = source.getOperationsQuantity().getUnitCode();
            if (StringUtils.isNotEmpty(unitCode)) {
                quantityType.setUnitCode(unitCode);
            }
            String unitCodeListID = source.getOperationsQuantity().getUnitCodeListID();
            if (StringUtils.isNotEmpty(unitCodeListID)) {
                quantityType.setUnitCodeListID(unitCodeListID);
            }
            target.setOperationsQuantity(quantityType);
        }
    }
}
Also used : QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) BigDecimal(java.math.BigDecimal)

Example 4 with QuantityType

use of net.opengis.swe.x20.QuantityType in project arctic-sea by 52North.

the class SweCommonDecoderV20 method parseAbstractDataComponent.

private SweAbstractDataComponent parseAbstractDataComponent(AbstractDataComponentType abstractDataComponent) throws DecodingException {
    SweAbstractDataComponent sosAbstractDataComponent = null;
    if (abstractDataComponent instanceof BooleanType) {
        sosAbstractDataComponent = parseBoolean((BooleanType) abstractDataComponent);
    } else if (abstractDataComponent instanceof CategoryType) {
        sosAbstractDataComponent = parseCategory((CategoryType) abstractDataComponent);
    } else if (abstractDataComponent instanceof CountRangeType) {
        sosAbstractDataComponent = parseCountRange((CountRangeType) abstractDataComponent);
    } else if (abstractDataComponent instanceof CountType) {
        sosAbstractDataComponent = parseCount((CountType) abstractDataComponent);
    } else if (abstractDataComponent instanceof QuantityType) {
        sosAbstractDataComponent = parseQuantity((QuantityType) abstractDataComponent);
    } else if (abstractDataComponent instanceof QuantityRangeType) {
        sosAbstractDataComponent = parseQuantityRange((QuantityRangeType) abstractDataComponent);
    } else if (abstractDataComponent instanceof TextType) {
        sosAbstractDataComponent = parseText((TextType) abstractDataComponent);
    } else if (abstractDataComponent instanceof TimeType) {
        sosAbstractDataComponent = parseTime((TimeType) abstractDataComponent);
    } else if (abstractDataComponent instanceof TimeRangeType) {
        sosAbstractDataComponent = parseTimeRange((TimeRangeType) abstractDataComponent);
    } else if (abstractDataComponent instanceof VectorType) {
        sosAbstractDataComponent = parseVector((VectorType) abstractDataComponent);
    } else if (abstractDataComponent instanceof DataRecordType) {
        SweDataRecord sosDataRecord = parseDataRecord((DataRecordType) abstractDataComponent);
        DataRecordDocument dataRecordDoc = DataRecordDocument.Factory.newInstance(getXmlOptions());
        dataRecordDoc.setDataRecord((DataRecordType) abstractDataComponent);
        sosDataRecord.setXml(dataRecordDoc.xmlText(getXmlOptions()));
        sosAbstractDataComponent = sosDataRecord;
    } else if (abstractDataComponent instanceof DataArrayType) {
        SweDataArray sosDataArray = parseDataArray((DataArrayType) abstractDataComponent);
        DataArrayDocument dataArrayDoc = DataArrayDocument.Factory.newInstance(getXmlOptions());
        dataArrayDoc.setDataArray1((DataArrayType) abstractDataComponent);
        sosDataArray.setXml(dataArrayDoc.xmlText(getXmlOptions()));
        sosAbstractDataComponent = sosDataArray;
    } else {
        throw new UnsupportedDecoderXmlInputException(this, abstractDataComponent);
    }
    if (sosAbstractDataComponent != null) {
        if (abstractDataComponent.isSetDefinition()) {
            sosAbstractDataComponent.setDefinition(abstractDataComponent.getDefinition());
        }
        if (abstractDataComponent.isSetDescription()) {
            sosAbstractDataComponent.setDescription(abstractDataComponent.getDescription());
        }
        if (abstractDataComponent.isSetIdentifier()) {
            sosAbstractDataComponent.setIdentifier(abstractDataComponent.getIdentifier());
        }
        if (abstractDataComponent.isSetLabel()) {
            sosAbstractDataComponent.setLabel(abstractDataComponent.getLabel());
        }
    }
    return sosAbstractDataComponent;
}
Also used : DataRecordType(net.opengis.swe.x20.DataRecordType) SweAbstractDataComponent(org.n52.shetland.ogc.swe.SweAbstractDataComponent) BooleanType(net.opengis.swe.x20.BooleanType) CategoryType(net.opengis.swe.x20.CategoryType) CountType(net.opengis.swe.x20.CountType) SweDataArray(org.n52.shetland.ogc.swe.SweDataArray) DataRecordDocument(net.opengis.swe.x20.DataRecordDocument) TextType(net.opengis.swe.x20.TextType) TimeType(net.opengis.swe.x20.TimeType) TimeRangeType(net.opengis.swe.x20.TimeRangeType) CountRangeType(net.opengis.swe.x20.CountRangeType) QuantityType(net.opengis.swe.x20.QuantityType) SweDataRecord(org.n52.shetland.ogc.swe.SweDataRecord) VectorType(net.opengis.swe.x20.VectorType) UnsupportedDecoderXmlInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderXmlInputException) QuantityRangeType(net.opengis.swe.x20.QuantityRangeType) DataArrayType(net.opengis.swe.x20.DataArrayType) DataArrayDocument(net.opengis.swe.x20.DataArrayDocument)

Example 5 with QuantityType

use of net.opengis.swe.x20.QuantityType in project arctic-sea by 52North.

the class SweCommonEncoderv20 method asPropertyType.

private XmlObject asPropertyType(AbstractDataComponentType type) throws NotYetSupportedEncodingException {
    if (type instanceof BooleanType) {
        BooleanPropertyType propertyType = BooleanPropertyType.Factory.newInstance();
        propertyType.setBoolean((BooleanType) type);
        return propertyType;
    } else if (type instanceof CountType) {
        CountPropertyType propertyType = CountPropertyType.Factory.newInstance();
        propertyType.setCount((CountType) type);
        return propertyType;
    } else if (type instanceof CountRangeType) {
        CountRangePropertyType propertyType = CountRangePropertyType.Factory.newInstance();
        propertyType.setCountRange((CountRangeType) type);
        return propertyType;
    } else if (type instanceof QuantityType) {
        QuantityPropertyType propertyType = QuantityPropertyType.Factory.newInstance();
        propertyType.setQuantity((QuantityType) type);
        return propertyType;
    } else if (type instanceof QuantityRangeType) {
        QuantityRangePropertyType propertyType = QuantityRangePropertyType.Factory.newInstance();
        propertyType.setQuantityRange((QuantityRangeType) type);
        return propertyType;
    } else if (type instanceof TimeType) {
        TimePropertyType propertyType = TimePropertyType.Factory.newInstance();
        propertyType.setTime((TimeType) type);
        return propertyType;
    } else if (type instanceof TimeRangeType) {
        TimeRangePropertyType propertyType = TimeRangePropertyType.Factory.newInstance();
        propertyType.setTimeRange((TimeRangeType) type);
        return propertyType;
    } else if (type instanceof CategoryType) {
        CategoryPropertyType propertyType = CategoryPropertyType.Factory.newInstance();
        propertyType.setCategory((CategoryType) type);
        return propertyType;
    } else if (type instanceof CategoryRangeType) {
        CategoryRangePropertyType propertyType = CategoryRangePropertyType.Factory.newInstance();
        propertyType.setCategoryRange((CategoryRangeType) type);
        return propertyType;
    } else if (type instanceof MatrixType) {
        MatrixPropertyType propertyType = MatrixPropertyType.Factory.newInstance();
        propertyType.setMatrix((MatrixType) type);
        return propertyType;
    } else if (type instanceof DataArrayType) {
        DataArrayPropertyType propertyType = DataArrayPropertyType.Factory.newInstance();
        propertyType.setDataArray1((DataArrayType) type);
        return propertyType;
    } else if (type instanceof DataChoiceType) {
        DataChoicePropertyType propertyType = DataChoicePropertyType.Factory.newInstance();
        propertyType.setDataChoice((DataChoiceType) type);
        return propertyType;
    } else if (type instanceof DataRecordType) {
        DataRecordPropertyType propertyType = DataRecordPropertyType.Factory.newInstance();
        propertyType.setDataRecord((DataRecordType) type);
        return propertyType;
    } else if (type instanceof TextType) {
        TextPropertyType propertyType = TextPropertyType.Factory.newInstance();
        propertyType.setText((TextType) type);
        return propertyType;
    } else if (type instanceof VectorType) {
        VectorPropertyType propertyType = VectorPropertyType.Factory.newInstance();
        propertyType.setVector((VectorType) type);
        return propertyType;
    } else {
        throw new NotYetSupportedEncodingException(type.getClass().getName(), type);
    }
}
Also used : DataRecordType(net.opengis.swe.x20.DataRecordType) CategoryRangeType(net.opengis.swe.x20.CategoryRangeType) MatrixPropertyType(net.opengis.swe.x20.MatrixPropertyType) NotYetSupportedEncodingException(org.n52.svalbard.encode.exception.NotYetSupportedEncodingException) CategoryType(net.opengis.swe.x20.CategoryType) DataArrayPropertyType(net.opengis.swe.x20.DataArrayPropertyType) TimeRangePropertyType(net.opengis.swe.x20.TimeRangePropertyType) CountType(net.opengis.swe.x20.CountType) TimeType(net.opengis.swe.x20.TimeType) VectorPropertyType(net.opengis.swe.x20.VectorPropertyType) CountPropertyType(net.opengis.swe.x20.CountPropertyType) CountRangeType(net.opengis.swe.x20.CountRangeType) DataChoiceType(net.opengis.swe.x20.DataChoiceType) VectorType(net.opengis.swe.x20.VectorType) QuantityPropertyType(net.opengis.swe.x20.QuantityPropertyType) TextPropertyType(net.opengis.swe.x20.TextPropertyType) CountRangePropertyType(net.opengis.swe.x20.CountRangePropertyType) BooleanPropertyType(net.opengis.swe.x20.BooleanPropertyType) DataChoicePropertyType(net.opengis.swe.x20.DataChoicePropertyType) DataArrayType(net.opengis.swe.x20.DataArrayType) QuantityRangePropertyType(net.opengis.swe.x20.QuantityRangePropertyType) CategoryRangePropertyType(net.opengis.swe.x20.CategoryRangePropertyType) BooleanType(net.opengis.swe.x20.BooleanType) DataRecordPropertyType(net.opengis.swe.x20.DataRecordPropertyType) TextType(net.opengis.swe.x20.TextType) TimeRangeType(net.opengis.swe.x20.TimeRangeType) QuantityType(net.opengis.swe.x20.QuantityType) MatrixType(net.opengis.swe.x20.MatrixType) TimePropertyType(net.opengis.swe.x20.TimePropertyType) QuantityRangeType(net.opengis.swe.x20.QuantityRangeType) CategoryPropertyType(net.opengis.swe.x20.CategoryPropertyType)

Aggregations

QuantityType (un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType)9 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)6 MeasureType (un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)5 FLUXLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation)4 BigDecimal (java.math.BigDecimal)3 BooleanType (net.opengis.swe.x20.BooleanType)3 CategoryType (net.opengis.swe.x20.CategoryType)3 CountRangeType (net.opengis.swe.x20.CountRangeType)3 CountType (net.opengis.swe.x20.CountType)3 DataArrayType (net.opengis.swe.x20.DataArrayType)3 DataRecordType (net.opengis.swe.x20.DataRecordType)3 QuantityRangeType (net.opengis.swe.x20.QuantityRangeType)3 QuantityType (net.opengis.swe.x20.QuantityType)3 TextType (net.opengis.swe.x20.TextType)3 TimeRangeType (net.opengis.swe.x20.TimeRangeType)3 TimeType (net.opengis.swe.x20.TimeType)3 VectorType (net.opengis.swe.x20.VectorType)3 FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)3 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)3 CategoryRangeType (net.opengis.swe.x20.CategoryRangeType)2