@Override public Status getStatus() { return reductionKeyVertex.getStatus(); } });
public IpServiceVertex(GraphVertex graphVertex) { this(graphVertex.getIpService(), graphVertex.getLevel()); }
public BusinessServiceVertex(GraphVertex graphVertex) { this(graphVertex.getBusinessService(), graphVertex.getLevel()); }
public ReductionKeyVertex(GraphVertex graphVertex) { this(graphVertex.getReductionKey(), graphVertex.getLevel()); }
public ApplicationVertex(GraphVertex graphVertex) { this(graphVertex.getApplication(), graphVertex.getLevel()); }
@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(); } }
@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(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(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(); } }
public static org.opennms.netmgt.bsm.service.model.Status getStatus(BusinessServiceStateMachine stateMachine, BusinessServiceEdge edge) { final BusinessServiceGraph graph = stateMachine.getGraph(); // We need both the source and target vertices to find the edge in the graph final GraphVertex source = getGraphVertex(edge.getBusinessServiceSource(), stateMachine.getGraph()); final GraphVertex target = getGraphVertex(edge.getBusinessServiceTarget(), stateMachine.getGraph()); final GraphEdge graphEdge = graph.findEdge(source, target); return graphEdge != null ? graphEdge.getStatus() : null; }
public double getWeightFactor(GraphEdge eachEdge) { int weightSum = getWeightSum(); return (double) eachEdge.getWeight() / (double) weightSum; }
public double getStatusFactor(GraphEdge eachEdge, Status status) { if (eachEdge.getStatus().isGreaterThanOrEqual(status)) { return getWeightFactor(eachEdge); } return 0; }
@Override public Void visit(BusinessServiceVertex vertex) { graphVertex.set(graph.getVertexByBusinessServiceId(vertex.getServiceId())); return null; }
@Override public Void visit(ReductionKeyVertex vertex) { graphVertex.set(graph.getVertexByReductionKey(vertex.getReductionKey())); return null; }
@Override public Void visit(ApplicationVertex vertex) { graphVertex.set(graph.getVertexByApplicationId(vertex.getApplicationId())); return null; } });
@Override public Void visit(IpServiceVertex vertex) { graphVertex.set(graph.getVertexByIpServiceId(vertex.getIpServiceId())); return null; }
private void load() { resetContainer(); BusinessServiceGraph graph = businessServiceManager.getGraph(); for (GraphVertex topLevelBusinessService : graph.getVerticesByLevel(0)) { addVertex(graph, topLevelBusinessService, null); } }
public double getWeightFactor(GraphEdge eachEdge) { int weightSum = getWeightSum(); return (double) eachEdge.getWeight() / (double) weightSum; }
public double getStatusFactor(GraphEdge eachEdge, Status status) { if (eachEdge.getStatus().isGreaterThanOrEqual(status)) { return getWeightFactor(eachEdge); } return 0; }
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; }