Removed unneeded query parameter management
This commit is contained in:
parent
9933344e63
commit
ef7d845903
|
@ -10,9 +10,7 @@ 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.Element;
|
import org.gcube.informationsystem.base.reference.Element;
|
||||||
import org.gcube.informationsystem.base.reference.IdentifiableElement;
|
|
||||||
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.exceptions.NotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentException;
|
||||||
|
@ -47,12 +45,6 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
|
||||||
*/
|
*/
|
||||||
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;
|
|
||||||
|
|
||||||
public boolean includeMeta() {
|
public boolean includeMeta() {
|
||||||
return includeMeta;
|
return includeMeta;
|
||||||
}
|
}
|
||||||
|
@ -61,17 +53,8 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
|
||||||
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{
|
||||||
|
@ -93,12 +76,6 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addIncludeAllMeta(Map<String,String> queryParams) throws UnsupportedEncodingException{
|
|
||||||
if(allMeta) {
|
|
||||||
queryParams.put(AccessPath.INCLUDE_META_IN_ALL_INSTANCES_QUERY_PARAMETER, Boolean.toString(allMeta));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addHeader(String name, String value) {
|
public void addHeader(String name, String value) {
|
||||||
headers.put(name, value);
|
headers.put(name, value);
|
||||||
|
@ -117,7 +94,6 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
|
||||||
this.address = address;
|
this.address = address;
|
||||||
this.headers = new HashMap<>();
|
this.headers = new HashMap<>();
|
||||||
this.includeMeta = false;
|
this.includeMeta = false;
|
||||||
this.allMeta = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue