Removed unneeded query parameter management
This commit is contained in:
parent
4a2c56c18d
commit
e75102d462
|
@ -13,7 +13,6 @@ import org.gcube.common.context.ContextUtility;
|
||||||
import org.gcube.common.gxhttp.reference.GXConnection;
|
import org.gcube.common.gxhttp.reference.GXConnection;
|
||||||
import org.gcube.common.gxhttp.request.GXHTTPStringRequest;
|
import org.gcube.common.gxhttp.request.GXHTTPStringRequest;
|
||||||
import org.gcube.common.http.GXHTTPUtility;
|
import org.gcube.common.http.GXHTTPUtility;
|
||||||
import org.gcube.informationsystem.base.reference.IdentifiableElement;
|
|
||||||
import org.gcube.informationsystem.contexts.reference.entities.Context;
|
import org.gcube.informationsystem.contexts.reference.entities.Context;
|
||||||
import org.gcube.informationsystem.model.reference.properties.Metadata;
|
import org.gcube.informationsystem.model.reference.properties.Metadata;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache;
|
import org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache;
|
||||||
|
@ -49,12 +48,6 @@ public class ResourceRegistryContextClientImpl implements ResourceRegistryContex
|
||||||
*/
|
*/
|
||||||
protected boolean includeMeta;
|
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;
|
protected ContextCache contextCache;
|
||||||
|
|
||||||
public boolean includeMeta() {
|
public boolean includeMeta() {
|
||||||
|
@ -65,17 +58,8 @@ public class ResourceRegistryContextClientImpl implements ResourceRegistryContex
|
||||||
this.includeMeta = includeMeta;
|
this.includeMeta = includeMeta;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean allMeta() {
|
|
||||||
return allMeta;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAllMeta(boolean allMeta) {
|
|
||||||
this.allMeta = allMeta;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addOptionalQueryParameters(Map<String,String> queryParams) throws UnsupportedEncodingException {
|
private void addOptionalQueryParameters(Map<String,String> queryParams) throws UnsupportedEncodingException {
|
||||||
addIncludeMeta(queryParams);
|
addIncludeMeta(queryParams);
|
||||||
addIncludeAllMeta(queryParams);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private GXHTTPStringRequest includeAdditionalQueryParameters(GXHTTPStringRequest gxHTTPStringRequest) throws UnsupportedEncodingException{
|
private GXHTTPStringRequest includeAdditionalQueryParameters(GXHTTPStringRequest gxHTTPStringRequest) throws UnsupportedEncodingException{
|
||||||
|
@ -97,12 +81,6 @@ public class ResourceRegistryContextClientImpl implements ResourceRegistryContex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addIncludeAllMeta(Map<String,String> queryParams) throws UnsupportedEncodingException{
|
|
||||||
if(allMeta) {
|
|
||||||
queryParams.put(AccessPath.INCLUDE_META_IN_ALL_INSTANCES_QUERY_PARAMETER, Boolean.toString(allMeta));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected ContextCacheRenewal contextCacheRenewal = new ContextCacheRenewal() {
|
protected ContextCacheRenewal contextCacheRenewal = new ContextCacheRenewal() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -134,7 +112,6 @@ public class ResourceRegistryContextClientImpl implements ResourceRegistryContex
|
||||||
this.address = address;
|
this.address = address;
|
||||||
this.headers = new HashMap<>();
|
this.headers = new HashMap<>();
|
||||||
this.includeMeta = false;
|
this.includeMeta = false;
|
||||||
this.allMeta = false;
|
|
||||||
if(sharedContextCache) {
|
if(sharedContextCache) {
|
||||||
contextCache = ContextCache.getInstance();
|
contextCache = ContextCache.getInstance();
|
||||||
}else {
|
}else {
|
||||||
|
|
Loading…
Reference in New Issue