Porting code to redesigned E/R format

This commit is contained in:
Luca Frosini 2023-04-19 11:37:12 +02:00
parent fdf9e71068
commit ac164abb46
2 changed files with 12 additions and 12 deletions

View File

@ -32,9 +32,9 @@ public interface ResourceRegistryClient {
public void setHierarchicalMode(boolean hierarchicalMode); public void setHierarchicalMode(boolean hierarchicalMode);
public boolean isIncludeContextsInHeader(); public boolean isIncludeContexts();
public void setIncludeContextsInHeader(boolean includeContextsInHeader); public void setIncludeContexts(boolean includeContexts);
public void addHeader(String name, String value); public void addHeader(String name, String value);

View File

@ -62,7 +62,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
protected Map<String, String> headers; protected Map<String, String> headers;
protected boolean hierarchicalMode; protected boolean hierarchicalMode;
protected boolean includeContextsInHeader; protected boolean includeContexts;
protected ContextCache contextCache; protected ContextCache contextCache;
@ -77,13 +77,13 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
} }
@Override @Override
public boolean isIncludeContextsInHeader() { public boolean isIncludeContexts() {
return includeContextsInHeader; return includeContexts;
} }
@Override @Override
public void setIncludeContextsInHeader(boolean includeContextsInHeader) { public void setIncludeContexts(boolean includeContexts) {
this.includeContextsInHeader = includeContextsInHeader; this.includeContexts = includeContexts;
} }
private GXHTTPStringRequest includeAdditionalQueryParameters(GXHTTPStringRequest gxHTTPStringRequest) throws UnsupportedEncodingException{ private GXHTTPStringRequest includeAdditionalQueryParameters(GXHTTPStringRequest gxHTTPStringRequest) throws UnsupportedEncodingException{
@ -92,7 +92,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
private GXHTTPStringRequest includeAdditionalQueryParameters(GXHTTPStringRequest gxHTTPStringRequest, Map<String,String> queryParams) throws UnsupportedEncodingException{ private GXHTTPStringRequest includeAdditionalQueryParameters(GXHTTPStringRequest gxHTTPStringRequest, Map<String,String> queryParams) throws UnsupportedEncodingException{
gxHTTPStringRequest = checkHierarchicalMode(gxHTTPStringRequest, queryParams); gxHTTPStringRequest = checkHierarchicalMode(gxHTTPStringRequest, queryParams);
return checkIncludeContextsInInstanceHeader(gxHTTPStringRequest, queryParams); return checkIncludeContextsInInstance(gxHTTPStringRequest, queryParams);
} }
private GXHTTPStringRequest checkHierarchicalMode(GXHTTPStringRequest gxHTTPStringRequest, Map<String,String> queryParams) throws UnsupportedEncodingException{ private GXHTTPStringRequest checkHierarchicalMode(GXHTTPStringRequest gxHTTPStringRequest, Map<String,String> queryParams) throws UnsupportedEncodingException{
@ -105,12 +105,12 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
return gxHTTPStringRequest.queryParams(queryParams); return gxHTTPStringRequest.queryParams(queryParams);
} }
private GXHTTPStringRequest checkIncludeContextsInInstanceHeader(GXHTTPStringRequest gxHTTPStringRequest, Map<String,String> queryParams) throws UnsupportedEncodingException{ private GXHTTPStringRequest checkIncludeContextsInInstance(GXHTTPStringRequest gxHTTPStringRequest, Map<String,String> queryParams) throws UnsupportedEncodingException{
if(includeContextsInHeader) { if(includeContexts) {
if(queryParams==null) { if(queryParams==null) {
queryParams = new HashMap<>(); queryParams = new HashMap<>();
} }
queryParams.put(AccessPath.INCLUDE_CONTEXTS_IN_HEADER_QUERY_PARAMETER, Boolean.toString(includeContextsInHeader)); queryParams.put(AccessPath.INCLUDE_CONTEXTS_QUERY_PARAMETER, Boolean.toString(includeContexts));
} }
return gxHTTPStringRequest.queryParams(queryParams); return gxHTTPStringRequest.queryParams(queryParams);
} }
@ -145,7 +145,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
public ResourceRegistryClientImpl(String address, boolean sharedContextCache) { public ResourceRegistryClientImpl(String address, boolean sharedContextCache) {
this.address = address; this.address = address;
this.hierarchicalMode = false; this.hierarchicalMode = false;
this.includeContextsInHeader = false; this.includeContexts = false;
this.headers = new HashMap<>(); this.headers = new HashMap<>();
if(sharedContextCache) { if(sharedContextCache) {
contextCache = ContextCache.getInstance(); contextCache = ContextCache.getInstance();