From 30eac775f6fc86962c64ef866d9383ee6ad5d69d Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Tue, 31 Oct 2023 15:51:06 +0100 Subject: [PATCH] Added renew for TypesKnowledge --- .../client/ResourceRegistryClientImpl.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientImpl.java b/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientImpl.java index 4a22e78..5bd3c59 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientImpl.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientImpl.java @@ -127,6 +127,18 @@ public class ResourceRegistryClientImpl extends BaseRequestInfo implements Resou } } + private void addOffset(Map queryParams) throws UnsupportedEncodingException{ + if(offset!=null) { + queryParams.put(AccessPath.OFFSET_QUERY_PARAMETER, offset.toString()); + } + } + + private void addLimit(Map queryParams) throws UnsupportedEncodingException{ + if(limit!=null) { + queryParams.put(AccessPath.LIMIT_QUERY_PARAMETER, limit.toString()); + } + } + protected ContextCacheRenewal contextCacheRenewal = new ContextCacheRenewal() { @Override @@ -191,6 +203,8 @@ public class ResourceRegistryClientImpl extends BaseRequestInfo implements Resou Map parameters = new HashMap<>(); addIncludeMeta(parameters); + addOffset(parameters); + addLimit(parameters); gxHTTPStringRequest.queryParams(parameters); HttpURLConnection httpURLConnection = gxHTTPStringRequest.get(); @@ -225,6 +239,10 @@ public class ResourceRegistryClientImpl extends BaseRequestInfo implements Resou public ModelKnowledge getModelKnowledge() { return typesKnowledge.getModelKnowledge(); } + + public void renewModelKnowledge() { + typesKnowledge.renew(); + } /** * It reads the context from server.