Search in sources :

Example 26 with SystemType

use of net.opengis.sensorML.x101.SystemType in project arctic-sea by 52North.

the class SensorMLDecoderV101Test method should_set_identifier_by_identifier_prefix_and_suffix.

@Test
public void should_set_identifier_by_identifier_prefix_and_suffix() throws DecodingException {
    SensorMLDocument xbSmlDoc = getSensorMLDoc();
    SystemType xbSystem = (SystemType) xbSmlDoc.getSensorML().addNewMember().addNewProcess().substitute(SensorMLConstants.SYSTEM_QNAME, SystemType.type);
    IdentifierList xbIdentifierList = xbSystem.addNewIdentification().addNewIdentifierList();
    String definiton = OGCConstants.URN_UNIQUE_IDENTIFIER_START + "anything" + OGCConstants.URN_UNIQUE_IDENTIFIER_END;
    addIdentifier(xbIdentifierList, "any name", definiton, TEST_ID_1);
    addIdentifier(xbIdentifierList, "any other name", null, TEST_ID_2);
    AbstractProcess absProcess = decodeAbstractProcess(xbSmlDoc);
    assertThat(absProcess.getIdentifier(), is(TEST_ID_1));
    assertThat(absProcess.getIdentifications().size(), is(2));
}
Also used : SensorMLDocument(net.opengis.sensorML.x101.SensorMLDocument) AbstractProcess(org.n52.shetland.ogc.sensorML.AbstractProcess) SystemType(net.opengis.sensorML.x101.SystemType) IdentifierList(net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList) Test(org.junit.Test)

Example 27 with SystemType

use of net.opengis.sensorML.x101.SystemType in project arctic-sea by 52North.

the class SensorMLEncoderv101 method createProcessDescription.

private XmlObject createProcessDescription(final AbstractProcess sensorDesc) throws EncodingException {
    // TODO Review: System -> return doc; ProcessModel -> return type
    if (sensorDesc instanceof System) {
        System system = (System) sensorDesc;
        SystemDocument xbSystemDoc = SystemDocument.Factory.newInstance(getXmlOptions());
        SystemType xbSystem = xbSystemDoc.addNewSystem();
        addAbstractProcessValues(xbSystem, system);
        addSystemValues(xbSystem, system);
        return xbSystem;
    } else if (sensorDesc instanceof ProcessModel) {
        // TODO: set values
        ProcessModel processModel = (ProcessModel) sensorDesc;
        ProcessModelDocument xbProcessModelDoc = ProcessModelDocument.Factory.newInstance(getXmlOptions());
        ProcessModelType xbProcessModel = xbProcessModelDoc.addNewProcessModel();
        addAbstractProcessValues(xbProcessModel, processModel);
        addProcessModelValues(xbProcessModel, processModel);
        return xbProcessModel;
    } else if (sensorDesc instanceof org.n52.shetland.ogc.sensorML.Component) {
        org.n52.shetland.ogc.sensorML.Component component = (org.n52.shetland.ogc.sensorML.Component) sensorDesc;
        ComponentDocument cd = ComponentDocument.Factory.newInstance(getXmlOptions());
        ComponentType ct = cd.addNewComponent();
        addAbstractProcessValues(ct, component);
        return ct;
    } else {
        throw unsupportedDescriptionType();
    }
}
Also used : ProcessModel(org.n52.shetland.ogc.sensorML.ProcessModel) ComponentType(net.opengis.sensorML.x101.ComponentType) AbstractDataComponentType(net.opengis.swe.x101.AbstractDataComponentType) ComponentDocument(net.opengis.sensorML.x101.ComponentDocument) SystemType(net.opengis.sensorML.x101.SystemType) ProcessModelDocument(net.opengis.sensorML.x101.ProcessModelDocument) System(org.n52.shetland.ogc.sensorML.System) SystemDocument(net.opengis.sensorML.x101.SystemDocument) SmlComponent(org.n52.shetland.ogc.sensorML.elements.SmlComponent) Component(net.opengis.sensorML.x101.ComponentsDocument.Components.ComponentList.Component) SweAbstractDataComponent(org.n52.shetland.ogc.swe.SweAbstractDataComponent) ProcessModelType(net.opengis.sensorML.x101.ProcessModelType)

Aggregations

SystemType (net.opengis.sensorML.x101.SystemType)24 Test (org.junit.Test)18 SensorMLDocument (net.opengis.sensorML.x101.SensorMLDocument)15 AbstractProcess (org.n52.shetland.ogc.sensorML.AbstractProcess)13 System (org.n52.shetland.ogc.sensorML.System)11 SensorML (org.n52.shetland.ogc.sensorML.SensorML)9 IdentifierList (net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList)6 SimpleDataRecordType (net.opengis.swe.x101.SimpleDataRecordType)5 SmlPerson (org.n52.shetland.ogc.sensorML.SmlPerson)5 Capabilities (net.opengis.sensorML.x101.CapabilitiesDocument.Capabilities)4 Component (net.opengis.sensorML.x101.ComponentsDocument.Components.ComponentList.Component)4 ResponsibleParty (net.opengis.sensorML.x101.ResponsiblePartyDocument.ResponsibleParty)4 XmlObject (org.apache.xmlbeans.XmlObject)4 SmlResponsibleParty (org.n52.shetland.ogc.sensorML.SmlResponsibleParty)4 ComponentType (net.opengis.sensorML.x101.ComponentType)3 ContactList (net.opengis.sensorML.x101.ContactListDocument.ContactList)3 Person (net.opengis.sensorML.x101.PersonDocument.Person)3 SmlComponent (org.n52.shetland.ogc.sensorML.elements.SmlComponent)3 SweAbstractDataComponent (org.n52.shetland.ogc.swe.SweAbstractDataComponent)3 ComponentList (net.opengis.sensorML.x101.ComponentsDocument.Components.ComponentList)2