From 69ca8d374d56d8a9c2de69da962b5bf995853116 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Wed, 23 Oct 2019 18:44:03 +0200 Subject: [PATCH] if the resource type is a RunningInstance or a GHN, the more recent resource check is bypassed --- .../informationsystem/publisher/RegistryPublisherImpl.java | 3 +++ .../org/gcube/informationsystem/publisher/utils/Utils.java | 1 + 2 files changed, 4 insertions(+) diff --git a/src/main/java/org/gcube/informationsystem/publisher/RegistryPublisherImpl.java b/src/main/java/org/gcube/informationsystem/publisher/RegistryPublisherImpl.java index 08f8aa7..45495ac 100644 --- a/src/main/java/org/gcube/informationsystem/publisher/RegistryPublisherImpl.java +++ b/src/main/java/org/gcube/informationsystem/publisher/RegistryPublisherImpl.java @@ -446,6 +446,9 @@ public class RegistryPublisherImpl implements RegistryPublisher { private HashSet updateResourceScopes(T resource) { HashSet vosScopes = Utils.getInternalVOScopes(resource); +// if the resource type is a RunningInstance or a HostingNode the check on the most recent resource is bypassed + if((resource.type().toString().equalsIgnoreCase("RunningInstance")) || (resource.type().toString().equalsIgnoreCase("GHN"))) + return vosScopes; //extract the scopes from the more recent resource found at vo level List latestScopesFound= Utils.setLatestInternalScopes(resource, vosScopes); log.debug("latest scope found are "+latestScopesFound); diff --git a/src/main/java/org/gcube/informationsystem/publisher/utils/Utils.java b/src/main/java/org/gcube/informationsystem/publisher/utils/Utils.java index a3128b1..27aa96b 100644 --- a/src/main/java/org/gcube/informationsystem/publisher/utils/Utils.java +++ b/src/main/java/org/gcube/informationsystem/publisher/utils/Utils.java @@ -154,6 +154,7 @@ public class Utils { private static List extractInternalScopes(T resource, String latestVO) { T extractedResource=null; + log.debug("checking resource "+resource.id()+" type: "+resource.type()); if(resource.type().toString().equalsIgnoreCase("RuntimeResource")){ extractedResource= (T)getServiceEndpointByID(resource.id(), latestVO); }else if(resource.type().toString().equalsIgnoreCase("GenericResource")){