@Override public Status getStatus() { return reductionKeyVertex.getStatus(); } });
@Override public Status getOperationalStatus(String reductionKey) { m_rwLock.readLock().lock(); try { GraphVertex vertex = m_g.getVertexByReductionKey(reductionKey); if (vertex != null) { return vertex.getStatus(); } return null; } finally { m_rwLock.readLock().unlock(); } }
@Override public Status getOperationalStatus(IpService ipService) { m_rwLock.readLock().lock(); try { GraphVertex vertex = m_g.getVertexByIpServiceId(ipService.getId()); if (vertex != null) { return vertex.getStatus(); } return null; } finally { m_rwLock.readLock().unlock(); } }
@Override public Status getOperationalStatus(Edge edge) { m_rwLock.readLock().lock(); try { GraphVertex vertex = m_g.getVertexByEdgeId(edge.getId()); if (vertex != null) { return vertex.getStatus(); } return null; } finally { m_rwLock.readLock().unlock(); } }
@Override public Status getOperationalStatus(BusinessService businessService) { Objects.requireNonNull(businessService); m_rwLock.readLock().lock(); try { GraphVertex vertex = m_g.getVertexByBusinessServiceId(businessService.getId()); if (vertex != null) { return vertex.getStatus(); } return null; } finally { m_rwLock.readLock().unlock(); } }
public static List<GraphVertex> calculateRootCause(BusinessServiceGraph graph, GraphVertex vertex) { if (vertex == null || vertex.getStatus().isLessThanOrEqual(Status.NORMAL)) { return Collections.emptyList(); } // Gather the list of child vertices that impact the current vertex final List<GraphVertex> childVerticesWithImpact = calculateImpacting(graph, vertex) .stream() .map(e -> graph.getOpposite(vertex, e)) .sorted() .collect(Collectors.toList()); // Recurse final List<GraphVertex> causes = Lists.newArrayList(childVerticesWithImpact); for (GraphVertex childVertexWithImpact : childVerticesWithImpact) { causes.addAll(calculateRootCause(graph, childVertexWithImpact)); } return causes; }
public static org.opennms.netmgt.bsm.service.model.Status getStatus(BusinessServiceStateMachine stateMachine, AbstractBusinessServiceVertex vertex) { final GraphVertex graphVertex = getGraphVertex(vertex, stateMachine.getGraph()); return graphVertex != null ? graphVertex.getStatus() : null; }
private void onStatusUpdated(BusinessServiceGraph graph, GraphVertex vertex, Status previousStatus) { BusinessService businessService = vertex.getBusinessService(); if (businessService == null) { // Only send updates for business services (and not for reduction keys) return; } if (graph != m_g) { // We're working with a new graph, only send a status update if the new status is different // than the one in the previous graph GraphVertex previousVertex = m_g.getVertexByBusinessServiceId(businessService.getId()); if (previousVertex != null && vertex.getStatus().equals(previousVertex.getStatus())) { // The vertex for this business service in the previous graph // had the same status, don't issue any notifications return; } } for (BusinessServiceStateChangeHandler handler : m_handlers) { handler.handleBusinessServiceStateChanged(businessService, vertex.getStatus(), previousStatus); } }
GraphVertex reductionKeyVertex = m_g.getVertexByReductionKey(reductionKey); if (reductionKeyVertex != null) { updateAndPropagateVertex(g, g.getVertexByReductionKey(reductionKey), reductionKeyVertex.getStatus()); } else { reductionsKeysToLookup.add(reductionKey);
Status previousStatus = vertex.getStatus(); if (previousStatus.equals(newStatus)) {