From 8a1c8170cb8f43e2613c00f7186a8d9eaa80cbf0 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 25 Oct 2019 17:45:39 +0200 Subject: [PATCH] Fixing imports and code to be aligned with model reorganization --- .classpath | 2 +- .settings/org.eclipse.core.resources.prefs | 6 ++++++ .settings/org.eclipse.jdt.core.prefs | 5 +++++ .../client/ResourceRegistryClient.java | 10 +++++----- .../client/ResourceRegistryClientImpl.java | 10 +++++----- .../client/ResourceRegistryClientTest.java | 10 +++++----- 6 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.jdt.core.prefs diff --git a/.classpath b/.classpath index 8e795b1..fae1a2b 100644 --- a/.classpath +++ b/.classpath @@ -22,7 +22,7 @@ - + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..29abf99 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..714351a --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClient.java b/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClient.java index bdaec4e..a236ff8 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClient.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClient.java @@ -4,9 +4,9 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import org.gcube.informationsystem.model.reference.ER; -import org.gcube.informationsystem.model.reference.ISManageable; -import org.gcube.informationsystem.model.reference.entities.Context; +import org.gcube.informationsystem.base.reference.ER; +import org.gcube.informationsystem.base.reference.ISManageable; +import org.gcube.informationsystem.context.reference.entities.Context; import org.gcube.informationsystem.model.reference.entities.Facet; import org.gcube.informationsystem.model.reference.entities.Resource; import org.gcube.informationsystem.model.reference.relations.ConsistsOf; @@ -17,7 +17,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegis import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.query.InvalidQueryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException; -import org.gcube.informationsystem.types.TypeBinder.TypeDefinition; +import org.gcube.informationsystem.types.reference.TypeDefinition; /** * @author Luca Frosini (ISTI - CNR) @@ -109,7 +109,7 @@ public interface ResourceRegistryClient { public String query(final String query, final int limit, final String fetchPlan, boolean raw) throws InvalidQueryException, ResourceRegistryException; - public List getSchema(Class clazz, Boolean polymorphic) + public List> getSchema(Class clazz, Boolean polymorphic) throws SchemaNotFoundException, ResourceRegistryException; public Context getContext(UUID uuid) throws ContextNotFoundException, ResourceRegistryException; diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientImpl.java b/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientImpl.java index b6fcc99..42e601e 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientImpl.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientImpl.java @@ -8,9 +8,9 @@ import java.util.UUID; import org.gcube.common.gxhttp.reference.GXConnection; import org.gcube.common.gxhttp.request.GXHTTPStringRequest; -import org.gcube.informationsystem.model.reference.ER; -import org.gcube.informationsystem.model.reference.ISManageable; -import org.gcube.informationsystem.model.reference.entities.Context; +import org.gcube.informationsystem.base.reference.ER; +import org.gcube.informationsystem.base.reference.ISManageable; +import org.gcube.informationsystem.context.reference.entities.Context; import org.gcube.informationsystem.model.reference.entities.Entity; import org.gcube.informationsystem.model.reference.entities.Facet; import org.gcube.informationsystem.model.reference.entities.Resource; @@ -27,7 +27,7 @@ import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath; import org.gcube.informationsystem.resourceregistry.api.rest.httputils.HTTPUtility; import org.gcube.informationsystem.resourceregistry.api.utils.Utility; import org.gcube.informationsystem.types.TypeBinder; -import org.gcube.informationsystem.types.TypeBinder.TypeDefinition; +import org.gcube.informationsystem.types.reference.TypeDefinition; import org.gcube.informationsystem.utils.ISMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -134,7 +134,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient { } @Override - public List getSchema(Class clazz, Boolean polymorphic) + public List> getSchema(Class clazz, Boolean polymorphic) throws SchemaNotFoundException, ResourceRegistryException { String type = Utility.getType(clazz); try { diff --git a/src/test/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientTest.java b/src/test/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientTest.java index ddda662..199f8b1 100644 --- a/src/test/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientTest.java +++ b/src/test/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientTest.java @@ -8,14 +8,14 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import org.gcube.informationsystem.model.impl.properties.HeaderImpl; +import org.gcube.informationsystem.base.impl.properties.HeaderImpl; +import org.gcube.informationsystem.base.reference.properties.Header; import org.gcube.informationsystem.model.reference.entities.Resource; -import org.gcube.informationsystem.model.reference.properties.Header; import org.gcube.informationsystem.model.reference.relations.IsIdentifiedBy; import org.gcube.informationsystem.model.reference.relations.IsRelatedTo; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException; -import org.gcube.informationsystem.types.TypeBinder.TypeDefinition; +import org.gcube.informationsystem.types.reference.TypeDefinition; import org.gcube.informationsystem.utils.ISMapper; import org.gcube.resourcemanagement.model.impl.entities.facets.SoftwareFacetImpl; import org.gcube.resourcemanagement.model.impl.entities.resources.HostingNodeImpl; @@ -51,13 +51,13 @@ public class ResourceRegistryClientTest extends ContextTest { @Test public void testGetFacetSchema() throws SchemaNotFoundException, ResourceRegistryException { - List typeDefinitions = resourceRegistryClient.getSchema(ContactFacet.class, true); + List> typeDefinitions = resourceRegistryClient.getSchema(ContactFacet.class, true); logger.trace("{}", typeDefinitions); } @Test public void testGetResourceSchema() throws SchemaNotFoundException, ResourceRegistryException { - List typeDefinitions = resourceRegistryClient.getSchema(HostingNode.class, true); + List> typeDefinitions = resourceRegistryClient.getSchema(HostingNode.class, true); logger.trace("{}", typeDefinitions); }