All pastes #286331 Raw Edit

Miscellany

public text v1 · immutable
#286331 ·published 2006-12-20 16:13 UTC
rendered paste body

    public Collection<LocationMonitorIpInterface> findStatusChangesForNodeForUniqueMonitorAndInterface(int nodeId) {
        List l = getHibernateTemplate().find(
                        "select distinct status.locationMonitor, status.monitoredService.ipInterface from OnmsLocationSpecificStatus as status " +
                        "where status.monitoredService.ipInterface.node.id = ?",
                        nodeId
                        );
        
        HashSet<LocationMonitorIpInterface> ret = new HashSet<LocationMonitorIpInterface>();
        for (Object o : l) {
            OnmsLocationMonitor mon = (OnmsLocationMonitor) ((Object[]) o)[0];
            OnmsIpInterface ip = (OnmsIpInterface) ((Object[]) o)[1];
            ret.add(new LocationMonitorIpInterface(mon, ip));
        }
        
        return ret;
    }