Search in sources :

Example 1 with ConnectionListType

use of net.opengis.sensorml.x20.ConnectionListType in project arctic-sea by 52North.

the class SensorMLEncoderv20 method createConnections.

private ConnectionListPropertyType createConnections(SmlConnection connections) {
    ConnectionListPropertyType clpt = ConnectionListPropertyType.Factory.newInstance(getXmlOptions());
    if (!Strings.isNullOrEmpty(connections.getHref())) {
        clpt.setHref(connections.getHref());
        if (!Strings.isNullOrEmpty(connections.getTitle())) {
            clpt.setTitle(connections.getTitle());
        }
        if (!Strings.isNullOrEmpty(connections.getRole())) {
            clpt.setRole(connections.getRole());
        }
    } else {
        ConnectionListType clt = clpt.addNewConnectionList();
        for (SmlLink link : connections.getConnections()) {
            LinkType lt = clt.addNewConnection().addNewLink();
            lt.addNewDestination().setRef(link.getDestination());
            lt.addNewSource().setRef(link.getSource());
            if (!Strings.isNullOrEmpty(link.getId())) {
                lt.setId(link.getId());
            }
        }
    }
    return clpt;
}
Also used : ConnectionListType(net.opengis.sensorml.x20.ConnectionListType) ConnectionListPropertyType(net.opengis.sensorml.x20.ConnectionListPropertyType) SmlLink(org.n52.shetland.ogc.sensorML.elements.SmlLink) LinkType(net.opengis.sensorml.x20.LinkType)

Aggregations

ConnectionListPropertyType (net.opengis.sensorml.x20.ConnectionListPropertyType)1 ConnectionListType (net.opengis.sensorml.x20.ConnectionListType)1 LinkType (net.opengis.sensorml.x20.LinkType)1 SmlLink (org.n52.shetland.ogc.sensorML.elements.SmlLink)1