diff --git a/src/main/java/org/gcube/smartgears/handler/resourceregistry/EServiceManager.java b/src/main/java/org/gcube/smartgears/handler/resourceregistry/EServiceManager.java index 86ed1de..80c73af 100644 --- a/src/main/java/org/gcube/smartgears/handler/resourceregistry/EServiceManager.java +++ b/src/main/java/org/gcube/smartgears/handler/resourceregistry/EServiceManager.java @@ -304,7 +304,6 @@ public class EServiceManager extends ApplicationLifecycleHandler { } - @SuppressWarnings("unchecked") private Hosts createHostsRelation(EService eService, ResourceRegistryPublisher resourceRegistryPublisher) throws ResourceRegistryException{ @@ -318,7 +317,7 @@ public class EServiceManager extends ApplicationLifecycleHandler { Hosts hosts = new HostsImpl<>(hostingNode, eService, propagationConstraint); try { - hosts = resourceRegistryPublisher.createIsRelatedTo(Hosts.class, hosts); + hosts = resourceRegistryPublisher.createIsRelatedTo(hosts); } catch (ResourceNotFoundException e) { logger.error("THIS IS REALLY STRANGE. YOU SHOULD NE BE HERE. Error while creating {}.", hosts, e); throw e; @@ -394,7 +393,6 @@ public class EServiceManager extends ApplicationLifecycleHandler { - @SuppressWarnings("unchecked") private void createOrUpdateServiceStateFacet(String state) throws ResourceRegistryException { ResourceRegistryClient resourceRegistryClient= ResourceRegistryClientFactory @@ -411,7 +409,7 @@ public class EServiceManager extends ApplicationLifecycleHandler { if(serviceStateFacets !=null && serviceStateFacets.size()>=1){ serviceStateFacet = serviceStateFacets.get(0); serviceStateFacet.setValue(state); - serviceStateFacet = resourceRegistryPublisher.updateFacet(ServiceStateFacet.class, serviceStateFacet); + serviceStateFacet = resourceRegistryPublisher.updateFacet(serviceStateFacet); for(int i=1; i consistsOf = new ConsistsOfImpl( eService, serviceStateFacet, null); - consistsOf = resourceRegistryPublisher.createConsistsOf(ConsistsOf.class, consistsOf); + consistsOf = resourceRegistryPublisher.createConsistsOf(consistsOf); // Newly created ServiceStateFacet must be added to all context diff --git a/src/main/java/org/gcube/smartgears/handler/resourceregistry/HostingNodeManager.java b/src/main/java/org/gcube/smartgears/handler/resourceregistry/HostingNodeManager.java index 1c642e2..62805af 100644 --- a/src/main/java/org/gcube/smartgears/handler/resourceregistry/HostingNodeManager.java +++ b/src/main/java/org/gcube/smartgears/handler/resourceregistry/HostingNodeManager.java @@ -270,8 +270,7 @@ public class HostingNodeManager extends ContainerHandler { try { hostingNode = resourceRegistryPublisher - .createResource(HostingNode.class, - hostingNode); + .createResource(hostingNode); share(hostingNode); // TODO Add a Reference to Site @@ -478,14 +477,12 @@ public class HostingNodeManager extends ContainerHandler { consistsOfList.removeAll(consistsOfToRemove); try { - hostingNode = resourceRegistryPublisher.updateResource( - HostingNode.class, hostingNode); + hostingNode = resourceRegistryPublisher.updateResource(hostingNode); } catch (ResourceNotFoundException e) { /* Update failed trying to recreate it */ // ReAdding the removed relations to recreate all consistsOfList.addAll(consistsOfToRemove); - hostingNode = resourceRegistryPublisher.createResource( - HostingNode.class, hostingNode); + hostingNode = resourceRegistryPublisher.createResource(hostingNode); } return hostingNode;