Search in sources :

Example 1 with InfoDialog

use of org.opennms.netmgt.vaadin.core.InfoDialog in project opennms by OpenNMS.

the class AbstractAnalysisOperation method execute.

@Override
public void execute(List<VertexRef> targets, OperationContext operationContext) {
    final List<AbstractBusinessServiceVertex> vertices = getVertices(targets);
    final BusinessServiceStateMachine stateMachine = SimulationAwareStateMachineFactory.createStateMachine(businessServiceManager, operationContext.getGraphContainer().getCriteria());
    final Set<GraphVertex> graphVerticesToFocus = Sets.newHashSet();
    final BusinessServiceVertexVisitor<Collection<GraphVertex>> visitor = getVisitorForVerticesToFocus(stateMachine);
    for (AbstractBusinessServiceVertex vertex : vertices) {
        graphVerticesToFocus.addAll(vertex.accept(visitor));
    }
    LOG.debug("Found {} business services.", graphVerticesToFocus.size());
    if (graphVerticesToFocus.isEmpty()) {
        new InfoDialog("No result", getMessageForNoResultDialog()).open();
    } else {
        focusOnVertices(targets.get(0), graphVerticesToFocus, operationContext.getGraphContainer());
    }
}
Also used : GraphVertex(org.opennms.netmgt.bsm.service.model.graph.GraphVertex) BusinessServiceStateMachine(org.opennms.netmgt.bsm.service.BusinessServiceStateMachine) InfoDialog(org.opennms.netmgt.vaadin.core.InfoDialog) Collection(java.util.Collection) AbstractBusinessServiceVertex(org.opennms.features.topology.plugins.topo.bsm.AbstractBusinessServiceVertex)

Aggregations

Collection (java.util.Collection)1 AbstractBusinessServiceVertex (org.opennms.features.topology.plugins.topo.bsm.AbstractBusinessServiceVertex)1 BusinessServiceStateMachine (org.opennms.netmgt.bsm.service.BusinessServiceStateMachine)1 GraphVertex (org.opennms.netmgt.bsm.service.model.graph.GraphVertex)1 InfoDialog (org.opennms.netmgt.vaadin.core.InfoDialog)1