diff --git a/pom.xml b/pom.xml index 1086eec..f070d2a 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,6 @@ UTF-8 ${project.basedir}/distro - Common @@ -81,18 +80,4 @@ test - - - - org.apache.maven.plugins - maven-assembly-plugin - - - make-uberjar - install - - - - - \ No newline at end of file diff --git a/src/main/java/org/gcube/smartgears/handler/resourceregistry/ContextUtility.java b/src/main/java/org/gcube/smartgears/handler/resourceregistry/ContextUtility.java index 500ea0d..2159c45 100644 --- a/src/main/java/org/gcube/smartgears/handler/resourceregistry/ContextUtility.java +++ b/src/main/java/org/gcube/smartgears/handler/resourceregistry/ContextUtility.java @@ -84,4 +84,9 @@ public class ContextUtility { return contextsUUID; } + public static String getContextNameFromUUID(UUID contextUUID) throws ResourceRegistryException { + ContextCache contextCache = ContextCache.getInstance(); + return contextCache.getContextFullNameByUUID(contextUUID); + } + } diff --git a/src/main/java/org/gcube/smartgears/handler/resourceregistry/resourcemanager/EServiceManager.java b/src/main/java/org/gcube/smartgears/handler/resourceregistry/resourcemanager/EServiceManager.java index 0e45143..66336d4 100644 --- a/src/main/java/org/gcube/smartgears/handler/resourceregistry/resourcemanager/EServiceManager.java +++ b/src/main/java/org/gcube/smartgears/handler/resourceregistry/resourcemanager/EServiceManager.java @@ -147,9 +147,9 @@ public class EServiceManager { UUID uuid = UUID.fromString(applicationContext.container().id()); try { resourceRegistryPublisher.addToContext(HostingNode.NAME, uuid, contextUUID, false); - logger.info("{} with UUID {} successfully added to context ({})", HostingNode.NAME, uuid, ContextUtility.getCurrentContextName()); + logger.info("{} with UUID {} successfully added to context ({})", HostingNode.NAME, uuid, ContextUtility.getContextNameFromUUID(contextUUID)); } catch (Exception e) { - logger.error("Unable to add {} with UUID {} to context ({})", HostingNode.NAME, uuid, ContextUtility.getCurrentContextName(), e); + logger.error("Unable to add {} with UUID {} to context ({})", HostingNode.NAME, uuid, ContextUtility.getContextNameFromUUID(contextUUID), e); } } @@ -167,7 +167,7 @@ public class EServiceManager { public void removeFromContext(UUID contextUUID) throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException { - String contextFullName = ContextCache.getInstance().getContextFullNameByUUID(contextUUID); + String contextFullName = ContextUtility.getContextNameFromUUID(contextUUID); UUID uuid = UUID.fromString(applicationContext.container().id()); try { resourceRegistryPublisher.removeResourceFromContext(HostingNode.NAME, uuid, contextUUID, false); diff --git a/src/main/java/org/gcube/smartgears/handler/resourceregistry/resourcemanager/HostingNodeManager.java b/src/main/java/org/gcube/smartgears/handler/resourceregistry/resourcemanager/HostingNodeManager.java index 59a60ae..9b768eb 100644 --- a/src/main/java/org/gcube/smartgears/handler/resourceregistry/resourcemanager/HostingNodeManager.java +++ b/src/main/java/org/gcube/smartgears/handler/resourceregistry/resourcemanager/HostingNodeManager.java @@ -145,9 +145,9 @@ public class HostingNodeManager { UUID uuid = UUID.fromString(containerContext.id()); try { resourceRegistryPublisher.addToContext(HostingNode.NAME, uuid, contextUUID, false); - logger.info("{} with UUID {} successfully added to context ({})", HostingNode.NAME, uuid, ContextUtility.getCurrentContextName()); + logger.info("{} with UUID {} successfully added to context ({})", HostingNode.NAME, uuid, ContextUtility.getContextNameFromUUID(contextUUID)); } catch (Exception e) { - logger.error("Unable to add {} with UUID {} to context ({})", HostingNode.NAME, uuid, ContextUtility.getCurrentContextName(), e); + logger.error("Unable to add {} with UUID {} to context ({})", HostingNode.NAME, uuid, ContextUtility.getContextNameFromUUID(contextUUID), e); } } @@ -165,7 +165,7 @@ public class HostingNodeManager { public void removeFromContext(UUID contextUUID) throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException { - String contextFullName = ContextCache.getInstance().getContextFullNameByUUID(contextUUID); + String contextFullName = ContextUtility.getContextNameFromUUID(contextUUID); UUID uuid = UUID.fromString(containerContext.id()); try { resourceRegistryPublisher.removeResourceFromContext(HostingNode.NAME, uuid, contextUUID, false);