Reorganized query and path parameters constants

This commit is contained in:
Luca Frosini 2022-07-20 12:09:39 +02:00
parent 9721a504b4
commit 621f1abaaa
1 changed files with 7 additions and 6 deletions

View File

@ -39,6 +39,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.relations.isr
import org.gcube.informationsystem.resourceregistry.api.exceptions.relations.isrelatedto.IsRelatedToNotFoundException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException;
import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath;
import org.gcube.informationsystem.resourceregistry.api.rest.ContextPath;
import org.gcube.informationsystem.resourceregistry.api.rest.InstancePath;
import org.gcube.informationsystem.resourceregistry.api.rest.SharingPath;
import org.gcube.informationsystem.resourceregistry.api.rest.SharingPath.SharingOperation;
@ -72,7 +73,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
if (queryParams == null) {
queryParams = new HashMap<>();
}
queryParams.put(AccessPath.HIERARCHICAL_MODE_PARAM, Boolean.toString(true));
queryParams.put(AccessPath.HIERARCHICAL_MODE_QUERY_PARAMETER, Boolean.toString(true));
}
return gxHTTPStringRequest.queryParams(queryParams);
}
@ -83,7 +84,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
if (queryParams == null) {
queryParams = new HashMap<>();
}
queryParams.put(AccessPath.INCLUDE_CONTEXTS_IN_HEADER_PARAM, Boolean.toString(true));
queryParams.put(AccessPath.INCLUDE_CONTEXTS_IN_HEADER_QUERY_PARAMETER, Boolean.toString(true));
}
return gxHTTPStringRequest.queryParams(queryParams);
}
@ -192,7 +193,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
UUID uuid = contextCache.getUUIDByFullName(contextFullName);
Context context = null;
if (uuid == null) {
context = getContextFromServer(AccessPath.CURRENT_CONTEXT);
context = getContextFromServer(ContextPath.CURRENT_CONTEXT_PATH_PART);
contextCache.cleanCache();
contextCache.refreshContextsIfNeeded();
Context c = contextCache.getContextByUUID(context.getHeader().getUUID());
@ -237,7 +238,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
gxHTTPStringRequest.path(type);
Map<String,String> parameters = new HashMap<>();
parameters.put(InstancePath.POLYMORPHIC_PARAM, polymorphic.toString());
parameters.put(InstancePath.POLYMORPHIC_QUERY_PARAMETER, polymorphic.toString());
includeAdditionalQueryParameters(gxHTTPStringRequest, parameters);
HttpURLConnection httpURLConnection = gxHTTPStringRequest.get();
@ -781,7 +782,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
Map<String, String> queryParams = new HashMap<>();
queryParams.put(SharingPath.OPERATION_QUERY_PARAMETER, SharingOperation.ADD.name());
queryParams.put(SharingPath.DRY_RUN_QUERY_PARAMETER, dryRun.toString());
queryParams.put(SharingPath.DRY_RUN_QUERY_QUERY_PARAMETER, dryRun.toString());
Boolean forceAddToContext = getCurrentContextUUID().compareTo(contextUUID)==0;
queryParams.put(SharingPath.FORCE_ADD_TO_CONTEXT_QUERY_PARAMETER, forceAddToContext.toString());
@ -851,7 +852,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
Map<String, String> queryParams = new HashMap<>();
queryParams.put(SharingPath.OPERATION_QUERY_PARAMETER, SharingOperation.REMOVE.name());
queryParams.put(SharingPath.DRY_RUN_QUERY_PARAMETER, dryRun.toString());
queryParams.put(SharingPath.DRY_RUN_QUERY_QUERY_PARAMETER, dryRun.toString());
includeAdditionalQueryParameters(gxHTTPStringRequest, queryParams);