From 71a9acae345ab66133d36360c26eed482677c99e Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 28 Apr 2023 11:46:13 +0200 Subject: [PATCH] Fixed code to comply with uuid property rename to id --- .../api/contexts/ContextCache.java | 14 +++++++------- .../api/contexts/ContextUtility.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) 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 19a2f1b..a0dcb35 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 @@ -110,23 +110,23 @@ public class ContextCache { this.contexts = new ArrayList<>(); for(Context c : contexts) { - UUID uuid = c.getUUID(); + UUID uuid = c.getID(); Context context = new ContextImpl(c.getName()); context.setMetadata(c.getMetadata()); - context.setUUID(uuid); + context.setID(uuid); this.contexts.add(context); this.uuidToContext.put(uuid, context); } for(Context c : contexts) { - UUID uuid = c.getUUID(); + UUID uuid = c.getID(); Context context = this.uuidToContext.get(uuid); if(c.getParent()!=null) { IsParentOf ipo = c.getParent(); - UUID parentUUID = ipo.getSource().getUUID(); + UUID parentUUID = ipo.getSource().getID(); Context parent = this.uuidToContext.get(parentUUID); IsParentOf isParentOf = new IsParentOfImpl(parent, context); - isParentOf.setUUID(parentUUID); + isParentOf.setID(parentUUID); isParentOf.setMetadata(ipo.getMetadata()); parent.addChild(isParentOf); context.setParent(isParentOf); @@ -136,7 +136,7 @@ public class ContextCache { for(Context context : contexts) { - UUID uuid = context.getUUID(); + UUID uuid = context.getID(); String fullName = getContextFullName(context); this.uuidToContextFullName.put(uuid, fullName); this.contextFullNameToUUID.put(fullName, uuid); @@ -149,7 +149,7 @@ public class ContextCache { IsParentOf ipo = context.getParent(); if(ipo!=null) { Context c = ipo.getSource(); - c = uuidToContext.get(c.getUUID()); + c = uuidToContext.get(c.getID()); String parentFullName = getContextFullName(c); stringBuilder.append(parentFullName); } diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/api/contexts/ContextUtility.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/contexts/ContextUtility.java index 5deec3e..f06a692 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/api/contexts/ContextUtility.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/api/contexts/ContextUtility.java @@ -55,7 +55,7 @@ public class ContextUtility { try { Map uuidToContextFullNameAssociation = contextCache.getUUIDToContextFullNameAssociation(); if(!uuidToContextFullNameAssociation.keySet().containsAll(uuids)) { - logger.debug("{} does not contain all the contexts identified by the following UUID list. Trying to invalidate the cache", ContextCache.class.getSimpleName(), uuids); + logger.debug("{} does not contain all the contexts identified by the following UUID list {}. Trying to invalidate the cache", ContextCache.class.getSimpleName(), uuids); contextCache.cleanCache(); uuidToContextFullNameAssociation = contextCache.getUUIDToContextFullNameAssociation(); }