From e51f4eae256340deb5ddfb44d4699b9642519a7a Mon Sep 17 00:00:00 2001 From: kishan Date: Wed, 23 Feb 2011 12:34:42 +0530 Subject: [PATCH] bug 8613: Added accountId to listUsageRecords API, use active account incase of multiple account with same name status 8613: resolved fixed --- core/src/com/cloud/user/dao/AccountDao.java | 3 ++- core/src/com/cloud/user/dao/AccountDaoImpl.java | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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); + } + }