Compare commits

..

No commits in common. "85935c71d7ec87804e74a5e0d8cd963c29f759b6" and "8d5c498d0732651195bd821d1aaa97138097f9c4" have entirely different histories.

5 changed files with 21 additions and 28 deletions

View File

@ -51,7 +51,7 @@ public class ContextCache {
protected ContextCacheRenewal contextCacheRenewal; protected ContextCacheRenewal contextCacheRenewal;
// in millisec used only for logging and debugging // in millisec used for logging purposes only
protected Calendar creationTime; protected Calendar creationTime;
// in millisec // in millisec
protected Calendar expiringTime; protected Calendar expiringTime;

View File

@ -8,21 +8,21 @@ import org.gcube.informationsystem.model.reference.properties.Metadata;
*/ */
public class BaseRequestInfo implements RequestInfo { public class BaseRequestInfo implements RequestInfo {
public static final Integer DEFAULT_OFFSET = 0;
public static final Integer DEFAULT_LIMIT = 10; public static final Integer DEFAULT_LIMIT = 10;
public static final Integer UNBOUNDED_LIMIT = -1; public static final Integer UNBOUNDED_LIMIT = -1;
public static final Integer DEFAULT_OFFSET = 0;
/**
* The offset parameter indicates the starting position of the result.
*/
protected Integer offset;
/** /**
* To get unlimited results the limit query parameters must be set to -1. * To get unlimited results the limit query parameters must be set to -1.
* If the results are too much the operation could have a timeout. * If the results are too much the operation could have a timeout.
*/ */
protected Integer limit; protected int limit;
/**
* The offset parameter indicates the starting position of the result.
*/
protected int offset;
/** /**
* Track if the request requested to include {@link Metadata} * Track if the request requested to include {@link Metadata}
@ -47,12 +47,8 @@ public class BaseRequestInfo implements RequestInfo {
protected boolean includeContexts; protected boolean includeContexts;
public BaseRequestInfo() { public BaseRequestInfo() {
this(null, null); this.limit = BaseRequestInfo.DEFAULT_LIMIT;
} this.offset = BaseRequestInfo.DEFAULT_OFFSET;
public BaseRequestInfo(Integer offset, Integer limit) {
this.offset = offset;
this.limit = limit;
this.includeMeta = false; this.includeMeta = false;
this.allMeta = false; this.allMeta = false;
this.hierarchicalMode = false; this.hierarchicalMode = false;
@ -60,22 +56,22 @@ public class BaseRequestInfo implements RequestInfo {
} }
@Override @Override
public Integer getLimit() { public int getLimit() {
return limit; return limit;
} }
@Override @Override
public void setLimit(Integer limit) { public void setLimit(int limit) {
this.limit = limit; this.limit = limit;
} }
@Override @Override
public Integer getOffset() { public int getOffset() {
return offset; return offset;
} }
@Override @Override
public void setOffset(Integer offset) { public void setOffset(int offset) {
this.offset = offset; this.offset = offset;
} }

View File

@ -5,13 +5,13 @@ package org.gcube.informationsystem.resourceregistry.api.request;
*/ */
public interface RequestInfo { public interface RequestInfo {
public Integer getLimit(); public int getLimit();
public void setLimit(Integer limit); public void setLimit(int limit);
public Integer getOffset(); public int getOffset();
public void setOffset(Integer offset); public void setOffset(int offset);
public boolean includeMeta(); public boolean includeMeta();

View File

@ -22,10 +22,6 @@ public class AccessPath {
public static final String INCLUDE_META_QUERY_PARAMETER = InstancePath.INCLUDE_META_QUERY_PARAMETER; public static final String INCLUDE_META_QUERY_PARAMETER = InstancePath.INCLUDE_META_QUERY_PARAMETER;
public static final String INCLUDE_META_IN_ALL_INSTANCES_QUERY_PARAMETER = InstancePath.INCLUDE_META_IN_ALL_INSTANCES_QUERY_PARAMETER; public static final String INCLUDE_META_IN_ALL_INSTANCES_QUERY_PARAMETER = InstancePath.INCLUDE_META_IN_ALL_INSTANCES_QUERY_PARAMETER;
public static final String OFFSET_QUERY_PARAMETER = InstancePath.OFFSET_QUERY_PARAMETER;
public static final String LIMIT_QUERY_PARAMETER = InstancePath.LIMIT_QUERY_PARAMETER;
/** /**
* Used only in getRelated() function * Used only in getRelated() function
* The _ is prepended to avoid clash with field name * The _ is prepended to avoid clash with field name

View File

@ -10,9 +10,10 @@ public class InstancePath {
public static final String INSTANCES_PATH_PART = "instances"; public static final String INSTANCES_PATH_PART = "instances";
public static final String OFFSET_QUERY_PARAMETER = "offset";
public static final String LIMIT_QUERY_PARAMETER = "limit"; public static final String LIMIT_QUERY_PARAMETER = "limit";
public static final String OFFSET_QUERY_PARAMETER = "offset";
public static final String POLYMORPHIC_QUERY_PARAMETER = "polymorphic"; public static final String POLYMORPHIC_QUERY_PARAMETER = "polymorphic";
public static final String HIERARCHICAL_MODE_QUERY_PARAMETER = "hierarchical"; public static final String HIERARCHICAL_MODE_QUERY_PARAMETER = "hierarchical";