From ba01253865a31a228d9037651e71f9fdb96a3179 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 17 Sep 2021 11:42:42 +0200 Subject: [PATCH] Added useful overloaded method --- .../resourceregistry/api/contexts/ContextCache.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/api/contexts/ContextCache.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/contexts/ContextCache.java index e17011a..8b997da 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/api/contexts/ContextCache.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/api/contexts/ContextCache.java @@ -159,6 +159,11 @@ public class ContextCache { return uuidToContextFullName.get(uuid); } + public synchronized String getContextFullNameByUUID(String uuid) throws ResourceRegistryException { + refreshContextsIfNeeded(); + return uuidToContextFullName.get(UUID.fromString(uuid)); + } + public synchronized UUID getUUIDByFullName(String contextFullName) throws ResourceRegistryException { refreshContextsIfNeeded(); return contextFullNameToUUID.get(contextFullName); @@ -169,6 +174,11 @@ public class ContextCache { return uuidToContext.get(uuid); } + public synchronized Context getContextByUUID(String uuid) throws ResourceRegistryException { + refreshContextsIfNeeded(); + return uuidToContext.get(UUID.fromString(uuid)); + } + public synchronized Context getContextByFullName(String contextFullName) throws ResourceRegistryException { UUID uuid = getUUIDByFullName(contextFullName); return uuidToContext.get(uuid);