@Override public int compare(OnmsIpInterface o1, OnmsIpInterface o2) { if (o1 == null) { if (o2 == null) { return 0; } else { return -1; // Put nulls at the end of the list } } else { if (o2 == null) { return 1; // Put nulls at the end of the list } else { if (o1.getIpLastCapsdPoll() == null) { if (o2.getIpLastCapsdPoll() == null) { return 0; } else { return 1; // Descending order } } else { if (o2.getIpLastCapsdPoll() == null) { return -1; // Descending order } else { // Reverse the comparison so that we get a descending order return o2.getIpLastCapsdPoll().compareTo(o1.getIpLastCapsdPoll()); } } } } } });
@Override public List<OnmsIpInterface> findObsoleteIpInterfaces(final Integer nodeId, final Date scanStamp) { final List<OnmsIpInterface> ifaces = new ArrayList<>(); final OnmsNode node = get(nodeId); if (node == null) return ifaces; for (final OnmsIpInterface iface : node.getIpInterfaces()) { if (iface.isPrimary()) continue; if (truncateMillis(iface.getIpLastCapsdPoll()) < truncateMillis(scanStamp)) { LOG.debug("findObsoleteIpInterfaces: {} < {}", truncateMillis(iface.getIpLastCapsdPoll()), truncateMillis(scanStamp)); ifaces.add(iface); } } return ifaces; }
@Override public List<OnmsIpInterface> findObsoleteIpInterfaces(final Integer nodeId, final Date scanStamp) { final List<OnmsIpInterface> ifaces = new ArrayList<>(); final OnmsNode node = get(nodeId); if (node == null) return ifaces; for (final OnmsIpInterface iface : node.getIpInterfaces()) { if (iface.isPrimary()) continue; if (truncateMillis(iface.getIpLastCapsdPoll()) < truncateMillis(scanStamp)) { LOG.debug("findObsoleteIpInterfaces: {} < {}", truncateMillis(iface.getIpLastCapsdPoll()), truncateMillis(scanStamp)); ifaces.add(iface); } } return ifaces; }
if (hasNewValue(scannedIface.getIpLastCapsdPoll(), getIpLastCapsdPoll())) { setIpLastCapsdPoll(scannedIface.getIpLastCapsdPoll());