Fixed code to comply with uuid property rename to id

This commit is contained in:
Luca Frosini 2023-04-28 11:47:50 +02:00
parent af2ef0ccb5
commit b8c80b122d
1 changed files with 11 additions and 11 deletions

View File

@ -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 <ERElem extends ERElement> 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 <ERElem extends ERElement> Map<UUID, String> getElementContexts(ERElem er)
throws NotFoundException, ResourceRegistryException {
String type = er.getTypeName();
UUID instanceUUID = er.getUUID();
UUID instanceUUID = er.getID();
return getElementContexts(type, instanceUUID);
}