diff --git a/server/src/com/cloud/host/dao/HostDao.java b/server/src/com/cloud/host/dao/HostDao.java index 6a266b7eb13..d3d43490f39 100644 --- a/server/src/com/cloud/host/dao/HostDao.java +++ b/server/src/com/cloud/host/dao/HostDao.java @@ -67,8 +67,7 @@ public interface HostDao extends GenericDao { */ List findDirectlyConnectedHosts(); - List findDirectAgentToLoad(long msid, long clusterId, long lastPingSecondsAfter, Long limit); - List findExternalNetworkAppliancesToLoad(long lastPingSecondsAfter); + List findDirectAgentToLoad(long msid, long lastPingSecondsAfter, Long limit); /** * Mark the host as disconnected if it is in one of these states. diff --git a/server/src/com/cloud/host/dao/HostDaoImpl.java b/server/src/com/cloud/host/dao/HostDaoImpl.java index 45481f6cfa3..b6622300529 100644 --- a/server/src/com/cloud/host/dao/HostDaoImpl.java +++ b/server/src/com/cloud/host/dao/HostDaoImpl.java @@ -190,8 +190,6 @@ public class HostDaoImpl extends GenericDaoBase implements HostDao UnmanagedDirectConnectSearch = createSearchBuilder(); UnmanagedDirectConnectSearch.and("resource", UnmanagedDirectConnectSearch.entity().getResource(), SearchCriteria.Op.NNULL); UnmanagedDirectConnectSearch.and("server", UnmanagedDirectConnectSearch.entity().getManagementServerId(), SearchCriteria.Op.NULL); - UnmanagedDirectConnectSearch.and("avoidstatus", UnmanagedDirectConnectSearch.entity().getStatus(), SearchCriteria.Op.NEQ); - UnmanagedDirectConnectSearch.and("clusterId", UnmanagedDirectConnectSearch.entity().getClusterId(), SearchCriteria.Op.EQ); UnmanagedDirectConnectSearch.and("lastPinged", UnmanagedDirectConnectSearch.entity().getLastPinged(), SearchCriteria.Op.LTEQ); /* @@ -257,22 +255,11 @@ public class HostDaoImpl extends GenericDaoBase implements HostDao } @Override - public List findDirectAgentToLoad(long msid, long clusterId, long lastPingSecondsAfter, Long limit) { + public List findDirectAgentToLoad(long msid, long lastPingSecondsAfter, Long limit) { SearchCriteria sc = UnmanagedDirectConnectSearch.create(); - sc.setParameters("avoidstatus", Status.Removed.toString()); - sc.setParameters("clusterId", clusterId); - sc.setParameters("lastPinged", lastPingSecondsAfter); - - return search(sc, new Filter(HostVO.class, "id", true, 0L, limit)); + sc.setParameters("lastPinged", lastPingSecondsAfter); + return search(sc, new Filter(HostVO.class, "clusterId", true, 0L, limit)); } - - @Override - public List findExternalNetworkAppliancesToLoad(long lastPingSecondsAfter) { - SearchCriteria sc = UnmanagedExternalNetworkApplianceSearch.create(); - sc.setParameters("types", new Object[]{Type.ExternalFirewall, Type.ExternalLoadBalancer}); - sc.setParameters("lastPinged", lastPingSecondsAfter); - return search(sc, null); - } @Override public void markHostsAsDisconnected(long msId, Status... states) {