From 5cc496a78db123dbd7d2c971efe8c11a43ab3438 Mon Sep 17 00:00:00 2001 From: will Date: Mon, 8 Nov 2010 14:57:30 -0800 Subject: [PATCH] Not sure why listing of templates was using Integer instead of Long for pagesize but now correcting to keep things consistent. --- core/src/com/cloud/storage/dao/VMTemplateDao.java | 2 +- core/src/com/cloud/storage/dao/VMTemplateDaoImpl.java | 4 ++-- server/src/com/cloud/server/ManagementServerImpl.java | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/com/cloud/storage/dao/VMTemplateDao.java b/core/src/com/cloud/storage/dao/VMTemplateDao.java index d78ae8d4864..0f8dca9562c 100644 --- a/core/src/com/cloud/storage/dao/VMTemplateDao.java +++ b/core/src/com/cloud/storage/dao/VMTemplateDao.java @@ -64,7 +64,7 @@ public interface VMTemplateDao extends GenericDao { public List findIsosByIdAndPath(Long domainId, Long accountId, String path); public List listReadyTemplates(); public List listByAccountId(long accountId); - public List searchTemplates(String name, String keyword, TemplateFilter templateFilter, boolean isIso, Boolean bootable, Account account, DomainVO domain, Integer pageSize, Long startIndex, Long zoneId, HypervisorType hyperType); + public List searchTemplates(String name, String keyword, TemplateFilter templateFilter, boolean isIso, Boolean bootable, Account account, DomainVO domain, Long pageSize, Long startIndex, Long zoneId, HypervisorType hyperType); public long addTemplateToZone(VMTemplateVO tmplt, long zoneId); public List listAllInZone(long dataCenterId); diff --git a/core/src/com/cloud/storage/dao/VMTemplateDaoImpl.java b/core/src/com/cloud/storage/dao/VMTemplateDaoImpl.java index 7aa4fc04e24..d31a962922f 100644 --- a/core/src/com/cloud/storage/dao/VMTemplateDaoImpl.java +++ b/core/src/com/cloud/storage/dao/VMTemplateDaoImpl.java @@ -217,7 +217,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase implem } @Override - public List searchTemplates(String name, String keyword, TemplateFilter templateFilter, boolean isIso, Boolean bootable, Account account, DomainVO domain, Integer pageSize, Long startIndex, Long zoneId, HypervisorType hyperType) { + public List searchTemplates(String name, String keyword, TemplateFilter templateFilter, boolean isIso, Boolean bootable, Account account, DomainVO domain, Long pageSize, Long startIndex, Long zoneId, HypervisorType hyperType) { Transaction txn = Transaction.currentTxn(); txn.start(); List templates = new ArrayList(); @@ -338,7 +338,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase implem return sql; } - private String getOrderByLimit(Integer pageSize, Long startIndex) { + private String getOrderByLimit(Long pageSize, Long startIndex) { String sql = " ORDER BY t.created DESC"; if ((pageSize != null) && (startIndex != null)) { sql += " LIMIT " + startIndex.toString() + "," + pageSize.toString(); diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index c60340eef75..16c08cec59a 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -1953,7 +1953,7 @@ public class ManagementServerImpl implements ManagementServer { } HypervisorType hypervisorType = HypervisorType.getType(cmd.getHypervisor()); - return listTemplates(cmd.getId(), cmd.getIsoName(), cmd.getKeyword(), isoFilter, true, cmd.isBootable(), accountId, cmd.getPageSizeVal().intValue(), cmd.getStartIndex(), cmd.getZoneId(), hypervisorType); + return listTemplates(cmd.getId(), cmd.getIsoName(), cmd.getKeyword(), isoFilter, true, cmd.isBootable(), accountId, cmd.getPageSizeVal(), cmd.getStartIndex(), cmd.getZoneId(), hypervisorType); } @Override @@ -1984,10 +1984,10 @@ public class ManagementServerImpl implements ManagementServer { } HypervisorType hypervisorType = HypervisorType.getType(cmd.getHypervisor()); - return listTemplates(cmd.getId(), cmd.getTemplateName(), cmd.getKeyword(), templateFilter, false, null, accountId, (cmd.getPageSizeVal() != null) ? cmd.getPageSizeVal().intValue() : null, cmd.getStartIndex(), cmd.getZoneId(), hypervisorType); + return listTemplates(cmd.getId(), cmd.getTemplateName(), cmd.getKeyword(), templateFilter, false, null, accountId, cmd.getPageSizeVal(), cmd.getStartIndex(), cmd.getZoneId(), hypervisorType); } - private List listTemplates(Long templateId, String name, String keyword, TemplateFilter templateFilter, boolean isIso, Boolean bootable, Long accountId, Integer pageSize, Long startIndex, Long zoneId, HypervisorType hyperType) throws InvalidParameterValueException { + private List listTemplates(Long templateId, String name, String keyword, TemplateFilter templateFilter, boolean isIso, Boolean bootable, Long accountId, Long pageSize, Long startIndex, Long zoneId, HypervisorType hyperType) throws InvalidParameterValueException { VMTemplateVO template = null; if (templateId != null) { template = _templateDao.findById(templateId);