tempStorage = _dedicatedDao.searchDedicatedPods(null, vmDomainId, vmAccountId, null, new Filter(DedicatedResourceVO.class, "id", true, 0L, 1L)).first(); tempStorage = _dedicatedDao.searchDedicatedPods(null, vmDomainId, null, null, new Filter(DedicatedResourceVO.class, "id", true, 0L, 1L)).first();
@Override public Pair<List<? extends DedicatedResourceVO>, Integer> listDedicatedPods(ListDedicatedPodsCmd cmd) { Long podId = cmd.getPodId(); Long domainId = cmd.getDomainId(); String accountName = cmd.getAccountName(); Long accountId = null; Long affinityGroupId = cmd.getAffinityGroupId(); Long startIndex = cmd.getStartIndex(); Long pageSize = cmd.getPageSizeVal(); if (accountName != null) { if (domainId != null) { Account account = _accountDao.findActiveAccount(accountName, domainId); if (account != null) { accountId = account.getId(); } } else { throw new InvalidParameterValueException("Please specify the domain id of the account: " + accountName); } } Filter searchFilter = new Filter(DedicatedResourceVO.class, "id", true, startIndex, pageSize); Pair<List<DedicatedResourceVO>, Integer> result = _dedicatedDao.searchDedicatedPods(podId, domainId, accountId, affinityGroupId, searchFilter); return new Pair<List<? extends DedicatedResourceVO>, Integer>(result.first(), result.second()); }