diff --git a/core/src/com/cloud/user/dao/AccountDao.java b/core/src/com/cloud/user/dao/AccountDao.java index 895b74ba94c..6e2ac0647eb 100644 --- a/core/src/com/cloud/user/dao/AccountDao.java +++ b/core/src/com/cloud/user/dao/AccountDao.java @@ -39,5 +39,6 @@ public interface AccountDao extends GenericDao { List findNewAccounts(Long minAccountId, Filter filter); List findCleanups(); List findAdminAccountsForDomain(Long domainId); - void markForCleanup(long accountId); + void markForCleanup(long accountId); + List listAccounts(String accountName, Long domainId, Filter filter); } diff --git a/core/src/com/cloud/user/dao/AccountDaoImpl.java b/core/src/com/cloud/user/dao/AccountDaoImpl.java index 8a34ec3162e..19eb93c174f 100644 --- a/core/src/com/cloud/user/dao/AccountDaoImpl.java +++ b/core/src/com/cloud/user/dao/AccountDaoImpl.java @@ -179,5 +179,12 @@ public class AccountDaoImpl extends GenericDaoBase implements A account.setNeedsCleanup(true); update(accountId, account); } - } + } + + public List listAccounts(String accountName, Long domainId, Filter filter) { + SearchCriteria sc = AccountNameSearch.create("accountName", accountName); + sc.addAnd("domainId", SearchCriteria.Op.EQ, domainId); + return listBy(sc, filter); + } + }