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 7fb439d..2de849d 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientImpl.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientImpl.java @@ -36,6 +36,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.Cont import org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException; +import org.gcube.informationsystem.resourceregistry.api.request.BaseRequestInfo; import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath; import org.gcube.informationsystem.resourceregistry.api.rest.ContextPath; import org.gcube.informationsystem.resourceregistry.api.rest.InstancePath; @@ -52,7 +53,7 @@ import org.slf4j.LoggerFactory; /** * @author Luca Frosini (ISTI - CNR) */ -public class ResourceRegistryClientImpl implements ResourceRegistryClient { +public class ResourceRegistryClientImpl extends BaseRequestInfo implements ResourceRegistryClient { private static final Logger logger = LoggerFactory.getLogger(ResourceRegistryClientImpl.class); @@ -63,39 +64,8 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient { protected Map headers; - /** - * Track if the client must request the hierarchicalMode - */ - protected boolean hierarchicalMode; - - /** - * Track if the client must request to include contexts - */ - protected boolean includeContexts; - - /** - * Track if the client must request to include {@link Metadata} - */ - protected boolean includeMeta; - - /** - * Track if the client must request to include {@link Metadata} in all - * {@link IdentifiableElement} or just in the root instance - */ - protected boolean allMeta; - protected ContextCache contextCache; - @Override - public boolean isHierarchicalMode() { - return hierarchicalMode; - } - - @Override - public void setHierarchicalMode(boolean hierarchicalMode) { - this.hierarchicalMode = hierarchicalMode; - } - @Deprecated @Override public boolean isIncludeContextsInHeader() { @@ -108,33 +78,6 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient { setIncludeContexts(includeContexts); } - @Override - public boolean includeContexts() { - return includeContexts; - } - - @Override - public void setIncludeContexts(boolean includeContexts) { - this.includeContexts = includeContexts; - } - - public boolean includeMeta() { - return includeMeta; - } - - public void setIncludeMeta(boolean includeMeta) { - this.includeMeta = includeMeta; - } - - public boolean allMeta() { - return allMeta; - } - - public void setAllMeta(boolean allMeta) { - this.allMeta = allMeta; - } - - private void addOptionalQueryParameters(Map queryParams) throws UnsupportedEncodingException { addHierarchicalMode(queryParams); addIncludeContexts(queryParams); @@ -207,11 +150,8 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient { } public ResourceRegistryClientImpl(String address, boolean sharedContextCache) { + super(); this.address = address; - this.hierarchicalMode = false; - this.includeContexts = false; - this.includeMeta = false; - this.allMeta = false; this.headers = new HashMap<>(); if(sharedContextCache) { contextCache = ContextCache.getInstance();