Fixed code to comply with uuid property rename to id
This commit is contained in:
parent
af2ef0ccb5
commit
b8c80b122d
|
@ -235,7 +235,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
context = getContextFromServer(uuid.toString());
|
context = getContextFromServer(uuid.toString());
|
||||||
contextCache.cleanCache();
|
contextCache.cleanCache();
|
||||||
contextCache.refreshContextsIfNeeded();
|
contextCache.refreshContextsIfNeeded();
|
||||||
Context c = contextCache.getContextByUUID(context.getUUID());
|
Context c = contextCache.getContextByUUID(context.getID());
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
context = c;
|
context = c;
|
||||||
} else {
|
} else {
|
||||||
|
@ -255,7 +255,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
}
|
}
|
||||||
|
|
||||||
private UUID getCurrentContextUUID() throws ResourceRegistryException {
|
private UUID getCurrentContextUUID() throws ResourceRegistryException {
|
||||||
return getCurrentContext().getUUID();
|
return getCurrentContext().getID();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -330,10 +330,10 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
try {
|
try {
|
||||||
String type = er.getTypeName();
|
String type = er.getTypeName();
|
||||||
String json = ElementMapper.marshal(er);
|
String json = ElementMapper.marshal(er);
|
||||||
UUID uuid = er.getUUID();
|
UUID uuid = er.getID();
|
||||||
if (uuid == null) {
|
if (uuid == null) {
|
||||||
uuid = UUIDManager.getInstance().generateValidUUID();
|
uuid = UUIDManager.getInstance().generateValidUUID();
|
||||||
er.setUUID(uuid);
|
er.setID(uuid);
|
||||||
}
|
}
|
||||||
return create(type, json, uuid);
|
return create(type, json, uuid);
|
||||||
} catch (ResourceRegistryException e) {
|
} catch (ResourceRegistryException e) {
|
||||||
|
@ -380,7 +380,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
public <ERElem extends ERElement> boolean exist(ERElem er)
|
public <ERElem extends ERElement> boolean exist(ERElem er)
|
||||||
throws AvailableInAnotherContextException, ResourceRegistryException {
|
throws AvailableInAnotherContextException, ResourceRegistryException {
|
||||||
String type = er.getTypeName();
|
String type = er.getTypeName();
|
||||||
UUID uuid = er.getUUID();
|
UUID uuid = er.getID();
|
||||||
return exist(type, uuid);
|
return exist(type, uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,7 +429,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException {
|
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException {
|
||||||
try {
|
try {
|
||||||
String type = er.getTypeName();
|
String type = er.getTypeName();
|
||||||
UUID uuid = er.getUUID();
|
UUID uuid = er.getID();
|
||||||
String ret = read(type, uuid);
|
String ret = read(type, uuid);
|
||||||
return (ERElem) ElementMapper.unmarshal(ERElement.class, ret);
|
return (ERElem) ElementMapper.unmarshal(ERElement.class, ret);
|
||||||
} catch (ResourceRegistryException e) {
|
} catch (ResourceRegistryException e) {
|
||||||
|
@ -490,7 +490,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
try {
|
try {
|
||||||
String type = er.getTypeName();
|
String type = er.getTypeName();
|
||||||
String json = ElementMapper.marshal(er);
|
String json = ElementMapper.marshal(er);
|
||||||
UUID uuid = er.getUUID();
|
UUID uuid = er.getID();
|
||||||
String ret = update(type, json, uuid);
|
String ret = update(type, json, uuid);
|
||||||
return (ERElem) ElementMapper.unmarshal(ERElement.class, ret);
|
return (ERElem) ElementMapper.unmarshal(ERElement.class, ret);
|
||||||
} catch (ResourceRegistryException e) {
|
} catch (ResourceRegistryException e) {
|
||||||
|
@ -565,7 +565,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
||||||
try {
|
try {
|
||||||
String type = er.getTypeName();
|
String type = er.getTypeName();
|
||||||
UUID uuid = er.getUUID();
|
UUID uuid = er.getID();
|
||||||
return delete(type, uuid);
|
return delete(type, uuid);
|
||||||
} catch (ResourceRegistryException e) {
|
} catch (ResourceRegistryException e) {
|
||||||
// logger.trace("Error Creating {}", facet, e);
|
// logger.trace("Error Creating {}", facet, e);
|
||||||
|
@ -841,7 +841,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException {
|
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException {
|
||||||
try {
|
try {
|
||||||
String type = er.getTypeName();
|
String type = er.getTypeName();
|
||||||
UUID instanceUUID = er.getUUID();
|
UUID instanceUUID = er.getID();
|
||||||
return addToContext(type, instanceUUID, contextUUID, dryRun);
|
return addToContext(type, instanceUUID, contextUUID, dryRun);
|
||||||
} catch (ResourceRegistryException e) {
|
} catch (ResourceRegistryException e) {
|
||||||
// logger.trace("Error Creating {}", facet, e);
|
// logger.trace("Error Creating {}", facet, e);
|
||||||
|
@ -908,7 +908,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException {
|
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException {
|
||||||
try {
|
try {
|
||||||
String type = er.getTypeName();
|
String type = er.getTypeName();
|
||||||
UUID instanceUUID = er.getUUID();
|
UUID instanceUUID = er.getID();
|
||||||
return removeFromContext(type, instanceUUID, contextUUID, dryRun);
|
return removeFromContext(type, instanceUUID, contextUUID, dryRun);
|
||||||
} catch (ResourceRegistryException e) {
|
} catch (ResourceRegistryException e) {
|
||||||
// logger.trace("Error Creating {}", facet, 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)
|
public <ERElem extends ERElement> Map<UUID, String> getElementContexts(ERElem er)
|
||||||
throws NotFoundException, ResourceRegistryException {
|
throws NotFoundException, ResourceRegistryException {
|
||||||
String type = er.getTypeName();
|
String type = er.getTypeName();
|
||||||
UUID instanceUUID = er.getUUID();
|
UUID instanceUUID = er.getID();
|
||||||
return getElementContexts(type, instanceUUID);
|
return getElementContexts(type, instanceUUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue