Search in sources :

Example 1 with MeasurementsWrapper

use of org.opennms.features.topology.api.info.MeasurementsWrapper in project opennms by OpenNMS.

the class GraphMLEdgeStatusProvider method createBindings.

private SimpleBindings createBindings(GraphMLEdge edge) {
    SimpleBindings bindings = new SimpleBindings();
    bindings.put("edge", edge);
    bindings.put("sourceNode", getNodeForEdgeVertexConnector(edge.getSource()));
    bindings.put("targetNode", getNodeForEdgeVertexConnector(edge.getTarget()));
    bindings.put("measurements", new MeasurementsWrapper(serviceAccessor.getMeasurementsService()));
    bindings.put("nodeDao", serviceAccessor.getNodeDao());
    bindings.put("snmpInterfaceDao", serviceAccessor.getSnmpInterfaceDao());
    return bindings;
}
Also used : SimpleBindings(javax.script.SimpleBindings) MeasurementsWrapper(org.opennms.features.topology.api.info.MeasurementsWrapper)

Example 2 with MeasurementsWrapper

use of org.opennms.features.topology.api.info.MeasurementsWrapper in project opennms by OpenNMS.

the class GenericInfoPanelItemProvider method createContext.

private Map<String, Object> createContext(final GraphContainer container) {
    final Map<String, Object> context = Maps.newHashMap();
    Optional.ofNullable(Iterables.getOnlyElement(container.getSelectionManager().getSelectedEdgeRefs(), null)).map(this::createEdgeContext).ifPresent(context::putAll);
    Optional.ofNullable(Iterables.getOnlyElement(container.getSelectionManager().getSelectedVertexRefs(), null)).map(this::createVertexContext).ifPresent(context::putAll);
    context.put("measurements", new MeasurementsWrapper(measurementsService));
    return context;
}
Also used : MeasurementsWrapper(org.opennms.features.topology.api.info.MeasurementsWrapper)

Aggregations

MeasurementsWrapper (org.opennms.features.topology.api.info.MeasurementsWrapper)2 SimpleBindings (javax.script.SimpleBindings)1