From 82c984534961387ab3d6d52a4e787510f98895cc Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Mon, 6 Aug 2018 16:10:21 -0400 Subject: Add page support to A&AI Client Issue-ID: SO-805 Change-Id: Id95c29db4594db494c647937636c09b0837335be Signed-off-by: Benjamin, Max (mb388a) --- .../onap/so/client/aai/entities/uri/AAIResourceUri.java | 6 ++++++ .../onap/so/client/aai/entities/uri/AAISimpleUri.java | 15 +++++++++++++++ .../org/onap/so/client/aai/entities/uri/AAIUri.java | 10 ++++++---- .../entities/uri/GraphInventoryResourceUri.java | 6 ++++++ .../graphinventory/entities/uri/GraphInventoryUri.java | 3 +++ .../client/graphinventory/entities/uri/SimpleUri.java | 17 +++++++++++++++++ 6 files changed, 53 insertions(+), 4 deletions(-) (limited to 'common/src') diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIResourceUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIResourceUri.java index 42fa1ad02a..8775a6a687 100644 --- a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIResourceUri.java +++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIResourceUri.java @@ -42,5 +42,11 @@ public interface AAIResourceUri extends AAIUri, GraphInventoryResourceUri { @Override public AAIResourceUri replaceQueryParam(String name, String... values); @Override + public AAIResourceUri resultIndex(int index); + @Override + public AAIResourceUri resultSize(int size); + @Override + public AAIResourceUri limit(int size); + @Override public AAIResourceUri clone(); } diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java index 14671b2f85..8731ae719a 100644 --- a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java +++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java @@ -81,6 +81,21 @@ public class AAISimpleUri extends SimpleUri implements AAIResourceUri { return (AAISimpleUri) super.replaceQueryParam(name, values); } + @Override + public AAISimpleUri resultIndex(int index) { + return (AAISimpleUri) super.resultIndex(index); + } + + @Override + public AAISimpleUri resultSize(int size) { + return (AAISimpleUri) super.resultSize(size); + } + + @Override + public AAISimpleUri limit(int size) { + return (AAISimpleUri) super.limit(size); + } + @Override public AAISimpleUri clone() { if (this.type != null) { diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUri.java index eb336d9219..fb43cda7a4 100644 --- a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUri.java +++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUri.java @@ -20,11 +20,7 @@ package org.onap.so.client.aai.entities.uri; -import java.net.URI; -import java.util.Map; - import org.onap.so.client.aai.AAIObjectType; -import org.onap.so.client.graphinventory.GraphInventoryObjectType; import org.onap.so.client.graphinventory.entities.uri.Depth; import org.onap.so.client.graphinventory.entities.uri.GraphInventoryUri; @@ -53,6 +49,12 @@ public interface AAIUri extends GraphInventoryUri { @Override public AAIUri replaceQueryParam(String name, String... values); @Override + public AAIUri resultIndex(int index); + @Override + public AAIUri resultSize(int size); + @Override + public AAIUri limit(int size); + @Override public AAIUri clone(); @Override diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryResourceUri.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryResourceUri.java index 08e7304978..2357d07fd4 100644 --- a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryResourceUri.java +++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryResourceUri.java @@ -40,5 +40,11 @@ public interface GraphInventoryResourceUri extends GraphInventoryUri { @Override public GraphInventoryResourceUri replaceQueryParam(String name, String... values); @Override + public GraphInventoryResourceUri resultIndex(int index); + @Override + public GraphInventoryResourceUri resultSize(int size); + @Override + public GraphInventoryResourceUri limit(int size); + @Override public GraphInventoryResourceUri clone(); } diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java index 8a25c23895..42c478eff7 100644 --- a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java +++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java @@ -47,6 +47,9 @@ public interface GraphInventoryUri { public GraphInventoryUri nodesOnly(boolean nodesOnly); public GraphInventoryUri queryParam(String name, String... values); public GraphInventoryUri replaceQueryParam(String name, String... values); + public GraphInventoryUri resultIndex(int index); + public GraphInventoryUri resultSize(int size); + public GraphInventoryUri limit(int size); public GraphInventoryUri clone(); /** diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java index 9c86ec6348..975fa318e8 100644 --- a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java +++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java @@ -119,6 +119,23 @@ public class SimpleUri implements GraphInventoryResourceUri { return this; } + @Override + public SimpleUri resultIndex(int index) { + this.internalURI = internalURI.replaceQueryParam("resultIndex", index); + return this; + } + + @Override + public SimpleUri resultSize(int size) { + this.internalURI = internalURI.replaceQueryParam("resultSize", size); + return this; + } + + @Override + public SimpleUri limit(int size) { + return this.resultIndex(0).resultSize(size); + } + @Override public URI build() { return build(this.values); -- cgit 1.2.3-korg