From 8ea242e4fbc29c347a975894a849951058da30a6 Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Mon, 4 Jun 2018 10:31:09 +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-api@167856 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../schema/SchemaCreationException.java | 27 +++++++++++++++++++ .../resourceregistry/api/rest/AccessPath.java | 5 ++-- .../api/rest/ContextPath.java | 5 ++-- .../resourceregistry/api/rest/SchemaPath.java | 4 ++- .../api/rest/httputils/HTTPCall.java | 2 +- 5 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 src/main/java/org/gcube/informationsystem/resourceregistry/api/exceptions/schema/SchemaCreationException.java diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/api/exceptions/schema/SchemaCreationException.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/exceptions/schema/SchemaCreationException.java new file mode 100644 index 0000000..67e67a7 --- /dev/null +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/api/exceptions/schema/SchemaCreationException.java @@ -0,0 +1,27 @@ +/** + * + */ +package org.gcube.informationsystem.resourceregistry.api.exceptions.schema; + +/** + * @author Luca Frosini (ISTI - CNR) + */ +public class SchemaCreationException extends SchemaException { + + /** + * Generated Serial Version UID + */ + private static final long serialVersionUID = -7235498402448768270L; + + public SchemaCreationException(String message) { + super(message); + } + + public SchemaCreationException(Throwable cause) { + super(cause); + } + + public SchemaCreationException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/AccessPath.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/AccessPath.java index 5bc0281..1e995f3 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/AccessPath.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/AccessPath.java @@ -25,10 +25,9 @@ public class AccessPath { public static final String CONSISTS_OF_PATH_PART = ERPath.CONSISTS_OF_PATH_PART; public static final String IS_RELATED_TO_PATH_PART = ERPath.IS_RELATED_TO_PATH_PART; - public static final String CONTEXT_PATH_PART = ContextPath.CONTEXT_PATH_PART; - public static final String ALL_PATH_PART = ContextPath.ALL_PATH_PART; + public static final String CONTEXTS_PATH_PART = ContextPath.CONTEXTS_PATH_PART; - public static final String SCHEMA_PATH_PART = SchemaPath.SCHEMA_PATH_PART; + public static final String SCHEMA_PATH_PART = SchemaPath.SCHEMAS_PATH_PART; public static final String INSTANCE_PATH_PART = "instance"; public static final String INSTANCES_PATH_PART = "instances"; diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/ContextPath.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/ContextPath.java index 72c215c..c2a1f6e 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/ContextPath.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/ContextPath.java @@ -8,7 +8,6 @@ package org.gcube.informationsystem.resourceregistry.api.rest; */ public class ContextPath { - public static final String CONTEXT_PATH_PART = "context"; - - public static final String ALL_PATH_PART = "all"; + public static final String CONTEXTS_PATH_PART = "contexts"; + } diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/SchemaPath.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/SchemaPath.java index 381801b..84b91a5 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/SchemaPath.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/SchemaPath.java @@ -5,7 +5,9 @@ package org.gcube.informationsystem.resourceregistry.api.rest; */ public class SchemaPath { - public static final String SCHEMA_PATH_PART = "schema"; + public static final String SCHEMAS_PATH_PART = "schemas"; public static final String POLYMORPHIC_PARAM = AccessPath.POLYMORPHIC_PARAM; + public static final String BASE_TYPE_PATH_PARAM = "baseType"; + } \ No newline at end of file diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/httputils/HTTPCall.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/httputils/HTTPCall.java index 63285e2..e6c3167 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/httputils/HTTPCall.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/api/rest/httputils/HTTPCall.java @@ -220,7 +220,7 @@ public class HTTPCall { } @SuppressWarnings("unchecked") - protected C call(Class clz, String path, HTTPMETHOD method, Map parameters, + public C call(Class clz, String path, HTTPMETHOD method, Map parameters, String body) throws Exception { String urlParameters = getParametersDataString(parameters);