/** {@inheritDoc} */ @Override public List<OnmsResource> getResourcesForParent(OnmsResource parent) { if (parent == null) { return Collections.emptyList(); } List<OnmsResource> resources = Lists.newArrayList(); List<String> indexes = getQueryableIndexes(new ResourcePath(parent.getPath(), m_name)); for (String index : indexes) { resources.add(getResourceByPath(new ResourcePath(parent.getPath(), m_name, index), parent)); } return OnmsResource.sortIntoResourceList(resources); }
/** {@inheritDoc} */ @Override public List<OnmsResource> getResourcesForParent(OnmsResource parent) { if (!NodeResourceType.isNode(parent)) { return Collections.emptyList(); } final OnmsNode node = ResourceTypeUtils.getNodeFromResource(parent); final List<OnmsResource> resources = Lists.newLinkedList(); final Collection<LocationMonitorIpInterface> statuses = m_locationMonitorDao.findStatusChangesForNodeForUniqueMonitorAndInterface(node.getId()); for (LocationMonitorIpInterface status : statuses) { String definitionName = status.getLocationMonitor().getLocation(); String id = status.getLocationMonitor().getId(); final OnmsIpInterface ipInterface = status.getIpInterface(); String ipAddr = InetAddressUtils.str(ipInterface.getIpAddress()); if (m_resourceStorageDao.exists(getRelativeInterfacePath(id, ipAddr), 0)) { resources.add(createResource(definitionName, id, ipAddr)); } } return OnmsResource.sortIntoResourceList(resources); }