Search in sources :

Example 1 with NCSPathEdge

use of org.opennms.features.topology.plugins.ncs.NCSPathEdgeProvider.NCSPathEdge in project opennms by OpenNMS.

the class NCSServicePath method getEdges.

public List<Edge> getEdges() {
    List<Edge> edges = new ArrayList<Edge>();
    if (m_vertices.size() >= 2) {
        String deviceA = m_vertices.get(0).getLabel();
        String deviceZ = m_vertices.get(m_vertices.size() - 1).getLabel();
        ListIterator<NCSVertex> iterator = m_vertices.listIterator();
        while (iterator.hasNext()) {
            NCSVertex sourceRef = iterator.next();
            if (iterator.hasNext()) {
                NCSVertex targetRef = m_vertices.get(iterator.nextIndex());
                NCSPathEdge ncsPathEdge = new NCSPathEdge(m_serviceName, deviceA, deviceZ, sourceRef, targetRef);
                ncsPathEdge.setStyleName("ncs edge direct");
                edges.add(ncsPathEdge);
            }
        }
    }
    return edges;
}
Also used : NCSVertex(org.opennms.features.topology.plugins.ncs.NCSEdgeProvider.NCSVertex) ArrayList(java.util.ArrayList) Edge(org.opennms.features.topology.api.topo.Edge) NCSPathEdge(org.opennms.features.topology.plugins.ncs.NCSPathEdgeProvider.NCSPathEdge) NCSPathEdge(org.opennms.features.topology.plugins.ncs.NCSPathEdgeProvider.NCSPathEdge)

Aggregations

ArrayList (java.util.ArrayList)1 Edge (org.opennms.features.topology.api.topo.Edge)1 NCSVertex (org.opennms.features.topology.plugins.ncs.NCSEdgeProvider.NCSVertex)1 NCSPathEdge (org.opennms.features.topology.plugins.ncs.NCSPathEdgeProvider.NCSPathEdge)1