You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2013/07/15 20:51:46 UTC
git commit: updated refs/heads/master to 9b521be
Updated Branches:
refs/heads/master 0392b571f -> 9b521be4d
CLOUDSTACK-1948: fixed pagesize to support -1 (unlimited) value
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9b521be4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9b521be4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9b521be4
Branch: refs/heads/master
Commit: 9b521be4d0b63659be1b6ef5c306f45faddb9501
Parents: 0392b57
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Mon Jul 15 11:32:18 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Mon Jul 15 11:35:46 2013 -0700
----------------------------------------------------------------------
api/src/org/apache/cloudstack/api/BaseListCmd.java | 12 ++++++------
.../api/command/admin/config/ListCfgsByCmd.java | 14 +++++++++-----
2 files changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9b521be4/api/src/org/apache/cloudstack/api/BaseListCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseListCmd.java b/api/src/org/apache/cloudstack/api/BaseListCmd.java
index 4d9b350..071c02d 100644
--- a/api/src/org/apache/cloudstack/api/BaseListCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseListCmd.java
@@ -53,7 +53,7 @@ public abstract class BaseListCmd extends BaseCmd {
}
public Integer getPageSize() {
- if (pageSize != null && MAX_PAGESIZE != null && pageSize.longValue() > MAX_PAGESIZE.longValue()) {
+ if (pageSize != null && MAX_PAGESIZE.longValue() != PAGESIZE_UNLIMITED && pageSize.longValue() > MAX_PAGESIZE.longValue()) {
throw new InvalidParameterValueException("Page size can't exceed max allowed page size value: " + MAX_PAGESIZE.longValue());
}
@@ -84,12 +84,12 @@ public abstract class BaseListCmd extends BaseCmd {
Long defaultPageSize = MAX_PAGESIZE;
Integer pageSizeInt = getPageSize();
if (pageSizeInt != null) {
- if (pageSizeInt.longValue() == PAGESIZE_UNLIMITED) {
- defaultPageSize = null;
- } else {
- defaultPageSize = pageSizeInt.longValue();
- }
+ defaultPageSize = pageSizeInt.longValue();
+ }
+ if (defaultPageSize.longValue() == PAGESIZE_UNLIMITED) {
+ defaultPageSize = null;
}
+
return defaultPageSize;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9b521be4/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
index a11904e..dce87c3 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
@@ -88,12 +88,16 @@ public class ListCfgsByCmd extends BaseListCmd {
@Override
public Long getPageSizeVal() {
- Long pageSizeVal = 500L;
- Integer pageSize = getPageSize();
- if (pageSize != null) {
- pageSizeVal = pageSize.longValue();
+ Long defaultPageSize = 500L;
+ Integer pageSizeInt = getPageSize();
+ if (pageSizeInt != null) {
+ if (pageSizeInt.longValue() == PAGESIZE_UNLIMITED) {
+ defaultPageSize = null;
+ } else {
+ defaultPageSize = pageSizeInt.longValue();
+ }
}
- return pageSizeVal;
+ return defaultPageSize;
}
// ///////////////////////////////////////////////////