From b8c80b122da04405e6e173eb57e8223a12e0c3f2 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 28 Apr 2023 11:47:50 +0200 Subject: [PATCH] Fixed code to comply with uuid property rename to id --- .../ResourceRegistryPublisherImpl.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/publisher/ResourceRegistryPublisherImpl.java b/src/main/java/org/gcube/informationsystem/resourceregistry/publisher/ResourceRegistryPublisherImpl.java index 2cbb04c..04a3066 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/publisher/ResourceRegistryPublisherImpl.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/publisher/ResourceRegistryPublisherImpl.java @@ -235,7 +235,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher context = getContextFromServer(uuid.toString()); contextCache.cleanCache(); contextCache.refreshContextsIfNeeded(); - Context c = contextCache.getContextByUUID(context.getUUID()); + Context c = contextCache.getContextByUUID(context.getID()); if (c != null) { context = c; } else { @@ -255,7 +255,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher } private UUID getCurrentContextUUID() throws ResourceRegistryException { - return getCurrentContext().getUUID(); + return getCurrentContext().getID(); } @SuppressWarnings("unchecked") @@ -330,10 +330,10 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher try { String type = er.getTypeName(); String json = ElementMapper.marshal(er); - UUID uuid = er.getUUID(); + UUID uuid = er.getID(); if (uuid == null) { uuid = UUIDManager.getInstance().generateValidUUID(); - er.setUUID(uuid); + er.setID(uuid); } return create(type, json, uuid); } catch (ResourceRegistryException e) { @@ -380,7 +380,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher public boolean exist(ERElem er) throws AvailableInAnotherContextException, ResourceRegistryException { String type = er.getTypeName(); - UUID uuid = er.getUUID(); + UUID uuid = er.getID(); return exist(type, uuid); } @@ -429,7 +429,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException { try { String type = er.getTypeName(); - UUID uuid = er.getUUID(); + UUID uuid = er.getID(); String ret = read(type, uuid); return (ERElem) ElementMapper.unmarshal(ERElement.class, ret); } catch (ResourceRegistryException e) { @@ -490,7 +490,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher try { String type = er.getTypeName(); String json = ElementMapper.marshal(er); - UUID uuid = er.getUUID(); + UUID uuid = er.getID(); String ret = update(type, json, uuid); return (ERElem) ElementMapper.unmarshal(ERElement.class, ret); } catch (ResourceRegistryException e) { @@ -565,7 +565,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher throws SchemaViolationException, NotFoundException, ResourceRegistryException { try { String type = er.getTypeName(); - UUID uuid = er.getUUID(); + UUID uuid = er.getID(); return delete(type, uuid); } catch (ResourceRegistryException e) { // logger.trace("Error Creating {}", facet, e); @@ -841,7 +841,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException { try { String type = er.getTypeName(); - UUID instanceUUID = er.getUUID(); + UUID instanceUUID = er.getID(); return addToContext(type, instanceUUID, contextUUID, dryRun); } catch (ResourceRegistryException e) { // logger.trace("Error Creating {}", facet, e); @@ -908,7 +908,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException { try { String type = er.getTypeName(); - UUID instanceUUID = er.getUUID(); + UUID instanceUUID = er.getID(); return removeFromContext(type, instanceUUID, contextUUID, dryRun); } catch (ResourceRegistryException e) { // logger.trace("Error Creating {}", facet, e); @@ -967,7 +967,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher public Map getElementContexts(ERElem er) throws NotFoundException, ResourceRegistryException { String type = er.getTypeName(); - UUID instanceUUID = er.getUUID(); + UUID instanceUUID = er.getID(); return getElementContexts(type, instanceUUID); }