diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/publisher/proxy/ResourceRegistryPublisherImpl.java b/src/main/java/org/gcube/informationsystem/resourceregistry/publisher/proxy/ResourceRegistryPublisherImpl.java index ad9c838..e55aab5 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/publisher/proxy/ResourceRegistryPublisherImpl.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/publisher/proxy/ResourceRegistryPublisherImpl.java @@ -25,7 +25,7 @@ import org.gcube.common.clients.delegates.AsyncProxyDelegate; import org.gcube.common.clients.delegates.ProxyDelegate; import org.gcube.common.clients.exceptions.ServiceException; import org.gcube.common.scope.api.ScopeProvider; -import org.gcube.informationsystem.impl.utils.Entities; +import org.gcube.informationsystem.impl.utils.ISMapper; import org.gcube.informationsystem.model.ISManageable; import org.gcube.informationsystem.model.entity.Context; import org.gcube.informationsystem.model.entity.Facet; @@ -279,7 +279,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher String res = result.toString(); logger.trace("Server returned content : {}", res); - return (C) Entities.unmarshal((Class) clazz, res); + return (C) ISMapper.unmarshal((Class) clazz, res); } } @@ -297,7 +297,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher stringWriter.append(PATH_SEPARATOR); stringWriter.append(facetClass.getSimpleName()); - String body = Entities.marshal(facet); + String body = ISMapper.marshal(facet); HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(), HTTPMETHOD.PUT, null, body); @@ -326,7 +326,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher stringWriter.append(PATH_SEPARATOR); stringWriter.append(facet.getHeader().getUUID().toString()); - String body = Entities.marshal(facet); + String body = ISMapper.marshal(facet); HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(), HTTPMETHOD.POST, null, body); @@ -383,7 +383,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher stringWriter.append(PATH_SEPARATOR); stringWriter.append(resourceClass.getSimpleName()); - String body = Entities.marshal(resource); + String body = ISMapper.marshal(resource); HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(), HTTPMETHOD.PUT, null, body); @@ -413,7 +413,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher stringWriter.append(PATH_SEPARATOR); stringWriter.append(resource.getHeader().getUUID().toString()); - String body = Entities.marshal(resource); + String body = ISMapper.marshal(resource); HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(), HTTPMETHOD.POST, null, body); @@ -481,7 +481,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher stringWriter.append(PATH_SEPARATOR); stringWriter.append(consistsOfClass.getSimpleName()); - String body = Entities.marshal(consistsOf); + String body = ISMapper.marshal(consistsOf); HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(), HTTPMETHOD.PUT, null, body); @@ -551,7 +551,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher stringWriter.append(PATH_SEPARATOR); stringWriter.append(isRelatedToClass.getSimpleName()); - String body = Entities.marshal(isRelatedTo); + String body = ISMapper.marshal(isRelatedTo); HTTPInputs httpInputs = new HTTPInputs(stringWriter.toString(), HTTPMETHOD.PUT, null, body); diff --git a/src/test/java/org/gcube/informationsystem/resourceregistry/publisher/SmartgearResourcesTest.java b/src/test/java/org/gcube/informationsystem/resourceregistry/publisher/SmartgearResourcesTest.java index 9206b28..e09baa6 100644 --- a/src/test/java/org/gcube/informationsystem/resourceregistry/publisher/SmartgearResourcesTest.java +++ b/src/test/java/org/gcube/informationsystem/resourceregistry/publisher/SmartgearResourcesTest.java @@ -33,7 +33,7 @@ import org.gcube.informationsystem.impl.entity.resource.HostingNodeImpl; import org.gcube.informationsystem.impl.relation.IsIdentifiedByImpl; import org.gcube.informationsystem.impl.relation.consistsof.HasPersistentMemoryImpl; import org.gcube.informationsystem.impl.relation.consistsof.HasVolatileMemoryImpl; -import org.gcube.informationsystem.impl.utils.Entities; +import org.gcube.informationsystem.impl.utils.ISMapper; import org.gcube.informationsystem.model.embedded.Header; import org.gcube.informationsystem.model.entity.Facet; import org.gcube.informationsystem.model.entity.Resource; @@ -80,7 +80,7 @@ public class SmartgearResourcesTest extends ScopedTest { @Test public void testHostingNode() throws JsonParseException, JsonMappingException, IOException, ResourceRegistryException{ - HostingNode hostingNode = Entities.unmarshal(HostingNode.class, HOSTING_NODE); + HostingNode hostingNode = ISMapper.unmarshal(HostingNode.class, HOSTING_NODE); logger.debug("Going to create {}", hostingNode); hostingNode = resourceRegistryPublisher.createResource(HostingNode.class, hostingNode); @@ -96,7 +96,7 @@ public class SmartgearResourcesTest extends ScopedTest { @Test public void testEService() throws JsonParseException, JsonMappingException, IOException, ResourceRegistryException{ - EService eService = Entities.unmarshal(EService.class, ESERVICE); + EService eService = ISMapper.unmarshal(EService.class, ESERVICE); logger.debug("Going to create {}", eService); eService = resourceRegistryPublisher.createResource(EService.class, eService);