mirror of https://github.com/apache/cloudstack.git
Not sure why listing of templates was using Integer instead of Long for pagesize but now correcting to keep things consistent.
This commit is contained in:
parent
5a4aaade73
commit
5cc496a78d
|
|
@ -64,7 +64,7 @@ public interface VMTemplateDao extends GenericDao<VMTemplateVO, Long> {
|
|||
public List<VMTemplateVO> findIsosByIdAndPath(Long domainId, Long accountId, String path);
|
||||
public List<VMTemplateVO> listReadyTemplates();
|
||||
public List<VMTemplateVO> listByAccountId(long accountId);
|
||||
public List<VMTemplateVO> 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<VMTemplateVO> 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<VMTemplateVO> listAllInZone(long dataCenterId);
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<VMTemplateVO> 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<VMTemplateVO> 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<VMTemplateVO> templates = new ArrayList<VMTemplateVO>();
|
||||
|
|
@ -338,7 +338,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> 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();
|
||||
|
|
|
|||
|
|
@ -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<VMTemplateVO> 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<VMTemplateVO> 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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue