From fdf399fe21f62accf3e475bc5a4c43d1941e7822 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 6 Jun 2018 17:26:19 +0000 Subject: [PATCH] Refs #11288: Made resource-registry more RESTful Task-Url: https://support.d4science.org/issues/11288 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry-schema-client@167900 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../schema/ResourceRegistrySchemaClientImpl.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/schema/ResourceRegistrySchemaClientImpl.java b/src/main/java/org/gcube/informationsystem/resourceregistry/schema/ResourceRegistrySchemaClientImpl.java index 9426342..95e30d0 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/schema/ResourceRegistrySchemaClientImpl.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/schema/ResourceRegistrySchemaClientImpl.java @@ -13,7 +13,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.context.Conte import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException; import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException; -import org.gcube.informationsystem.resourceregistry.api.rest.SchemaPath; +import org.gcube.informationsystem.resourceregistry.api.rest.TypePath; import org.gcube.informationsystem.resourceregistry.api.rest.httputils.HTTPCall; import org.gcube.informationsystem.resourceregistry.api.rest.httputils.HTTPCall.HTTPMETHOD; import org.gcube.informationsystem.resourceregistry.api.utils.Utility; @@ -69,16 +69,12 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC StringWriter stringWriter = new StringWriter(); stringWriter.append(PATH_SEPARATOR); - stringWriter.append(SchemaPath.SCHEMAS_PATH_PART); + stringWriter.append(TypePath.TYPES_PATH_PART); stringWriter.append(PATH_SEPARATOR); stringWriter.append(typeDefinitionObj.getName()); - Map parameters = new HashMap<>(); - parameters.put(SchemaPath.BASE_TYPE_PATH_PARAM, baseType); - - HTTPCall httpCall = getHTTPCall(); - String c = httpCall.call(String.class, stringWriter.toString(), HTTPMETHOD.PUT, parameters, typeDefinitition); + String c = httpCall.call(String.class, stringWriter.toString(), HTTPMETHOD.PUT, typeDefinitition); logger.trace("{} successfully created", c); return c; @@ -112,13 +108,13 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC logger.info("Going to get {} schema", type); StringWriter stringWriter = new StringWriter(); stringWriter.append(PATH_SEPARATOR); - stringWriter.append(SchemaPath.SCHEMAS_PATH_PART); + stringWriter.append(TypePath.TYPES_PATH_PART); stringWriter.append(PATH_SEPARATOR); stringWriter.append(type); Map parameters = new HashMap<>(); if(polymorphic != null) { - parameters.put(SchemaPath.POLYMORPHIC_PARAM, polymorphic.toString()); + parameters.put(TypePath.POLYMORPHIC_PARAM, polymorphic.toString()); } HTTPCall httpCall = getHTTPCall();