public List<Node> getNode() { return m_rtcCategory.getNode(); }
public List<Node> getNode() { return m_rtcCategory.getNode(); }
@XmlElementWrapper(name="nodes") @XmlElement(name="node") public List<Long> getNodeIds() { final List<Long> nodeIds = new ArrayList<>(); if (m_rtcCategory != null) { for (final Node node : m_rtcCategory.getNode()) { nodeIds.add(node.getNodeid()); } } return nodeIds; }
@XmlElementWrapper(name="nodes") @XmlElement(name="node") public List<Long> getNodeIds() { final List<Long> nodeIds = new ArrayList<>(); if (m_rtcCategory != null) { for (final Node node : m_rtcCategory.getNode()) { nodeIds.add(node.getNodeid()); } } return nodeIds; }
public AvailabilityNode getNode(final Long nodeId) { if (m_rtcCategory != null) { for (final Node node : m_rtcCategory.getNode()) { if (node.getNodeid() == nodeId) { return new AvailabilityNode(node); } } } return null; }
public NodeList getNodes() { if (m_rtcCategory != null) { return NodeList.forNodes(m_rtcCategory.getNode()); } return new NodeList(); }
public AvailabilityNode getNode(final Long nodeId) { if (m_rtcCategory != null) { for (final Node node : m_rtcCategory.getNode()) { if (node.getNodeid() == nodeId) { return new AvailabilityNode(node); } } } return null; }
public NodeList getNodes() { if (m_rtcCategory != null) { return NodeList.forNodes(m_rtcCategory.getNode()); } return new NodeList(); }
/** * Convenience method to count the number of services under a category and * the number of those services that are currently down. * * @param category a {@link org.opennms.netmgt.xml.rtc.Category} object. * @return an array of long. */ protected static long[] getServiceCounts(final org.opennms.netmgt.xml.rtc.Category category) { if (category == null) { throw new IllegalArgumentException("Cannot take null parameters."); } long count = 0; long downCount = 0; for (Node node : category.getNode()) { count += node.getNodesvccount(); downCount += node.getNodesvcdowncount(); } return new long[] { count, downCount }; } }
/** * Convenience method to count the number of services under a category and * the number of those services that are currently down. * * @param category a {@link org.opennms.netmgt.xml.rtc.Category} object. * @return an array of long. */ protected static long[] getServiceCounts(final org.opennms.netmgt.xml.rtc.Category category) { if (category == null) { throw new IllegalArgumentException("Cannot take null parameters."); } long count = 0; long downCount = 0; for (Node node : category.getNode()) { count += node.getNodesvccount(); downCount += node.getNodesvcdowncount(); } return new long[] { count, downCount }; } }
levelCat.getNode().add(levelNode);
@Test public void categoryIsFullyAvailableWhenNoServicesArePresent() throws Exception { final RTCCategory rtcCat = EasyMock.createNiceMock(RTCCategory.class); EasyMock.expect(rtcCat.getLabel()).andReturn("Routers"); // This nodeid should not exist in the database EasyMock.expect(rtcCat.getNodes()).andReturn(Lists.newArrayList(99999)); EasyMock.replay(rtcCat); final EuiLevel euiLevel = m_availabilityService.getEuiLevel(rtcCat); assertEquals(1, euiLevel.getCategory().size()); final Category category = euiLevel.getCategory().get(0); assertEquals(100.0, category.getCatvalue(), 0.001); assertEquals(1, category.getNode().size()); final Node node = category.getNode().get(0); assertEquals(100.0, node.getNodevalue(), 0.001); assertEquals(0, node.getNodesvccount()); assertEquals(0, node.getNodesvcdowncount()); }
levelCat.getNode().add(levelNode);