Refactored to use Element getTypeName() function
This commit is contained in:
parent
83deeb649b
commit
af2ef0ccb5
|
@ -328,7 +328,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
protected <ERElem extends ERElement> String internalCreate(ERElem er)
|
protected <ERElem extends ERElement> String internalCreate(ERElem er)
|
||||||
throws SchemaViolationException, AlreadyPresentException, ResourceRegistryException {
|
throws SchemaViolationException, AlreadyPresentException, ResourceRegistryException {
|
||||||
try {
|
try {
|
||||||
String type = TypeUtility.getTypeName(er);
|
String type = er.getTypeName();
|
||||||
String json = ElementMapper.marshal(er);
|
String json = ElementMapper.marshal(er);
|
||||||
UUID uuid = er.getUUID();
|
UUID uuid = er.getUUID();
|
||||||
if (uuid == null) {
|
if (uuid == null) {
|
||||||
|
@ -379,7 +379,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
@Override
|
@Override
|
||||||
public <ERElem extends ERElement> boolean exist(ERElem er)
|
public <ERElem extends ERElement> boolean exist(ERElem er)
|
||||||
throws AvailableInAnotherContextException, ResourceRegistryException {
|
throws AvailableInAnotherContextException, ResourceRegistryException {
|
||||||
String type = TypeUtility.getTypeName(er);
|
String type = er.getTypeName();
|
||||||
UUID uuid = er.getUUID();
|
UUID uuid = er.getUUID();
|
||||||
return exist(type, uuid);
|
return exist(type, uuid);
|
||||||
}
|
}
|
||||||
|
@ -428,7 +428,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
public <ERElem extends ERElement> ERElem read(ERElem er)
|
public <ERElem extends ERElement> ERElem read(ERElem er)
|
||||||
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException {
|
throws NotFoundException, AvailableInAnotherContextException, ResourceRegistryException {
|
||||||
try {
|
try {
|
||||||
String type = TypeUtility.getTypeName(er);
|
String type = er.getTypeName();
|
||||||
UUID uuid = er.getUUID();
|
UUID uuid = er.getUUID();
|
||||||
String ret = read(type, uuid);
|
String ret = read(type, uuid);
|
||||||
return (ERElem) ElementMapper.unmarshal(ERElement.class, ret);
|
return (ERElem) ElementMapper.unmarshal(ERElement.class, ret);
|
||||||
|
@ -488,7 +488,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
public <ERElem extends ERElement> ERElem update(ERElem er)
|
public <ERElem extends ERElement> ERElem update(ERElem er)
|
||||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
||||||
try {
|
try {
|
||||||
String type = TypeUtility.getTypeName(er);
|
String type = er.getTypeName();
|
||||||
String json = ElementMapper.marshal(er);
|
String json = ElementMapper.marshal(er);
|
||||||
UUID uuid = er.getUUID();
|
UUID uuid = er.getUUID();
|
||||||
String ret = update(type, json, uuid);
|
String ret = update(type, json, uuid);
|
||||||
|
@ -564,7 +564,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
public <ERElem extends ERElement> boolean delete(ERElem er)
|
public <ERElem extends ERElement> boolean delete(ERElem er)
|
||||||
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
throws SchemaViolationException, NotFoundException, ResourceRegistryException {
|
||||||
try {
|
try {
|
||||||
String type = TypeUtility.getTypeName(er);
|
String type = er.getTypeName();
|
||||||
UUID uuid = er.getUUID();
|
UUID uuid = er.getUUID();
|
||||||
return delete(type, uuid);
|
return delete(type, uuid);
|
||||||
} catch (ResourceRegistryException e) {
|
} catch (ResourceRegistryException e) {
|
||||||
|
@ -840,7 +840,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
public List<ERElement> addToContext(ERElement er, UUID contextUUID, Boolean dryRun)
|
public List<ERElement> addToContext(ERElement er, UUID contextUUID, Boolean dryRun)
|
||||||
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException {
|
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException {
|
||||||
try {
|
try {
|
||||||
String type = TypeUtility.getTypeName(er);
|
String type = er.getTypeName();
|
||||||
UUID instanceUUID = er.getUUID();
|
UUID instanceUUID = er.getUUID();
|
||||||
return addToContext(type, instanceUUID, contextUUID, dryRun);
|
return addToContext(type, instanceUUID, contextUUID, dryRun);
|
||||||
} catch (ResourceRegistryException e) {
|
} catch (ResourceRegistryException e) {
|
||||||
|
@ -907,7 +907,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
public List<ERElement> removeFromContext(ERElement er, UUID contextUUID, Boolean dryRun)
|
public List<ERElement> removeFromContext(ERElement er, UUID contextUUID, Boolean dryRun)
|
||||||
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException {
|
throws SchemaViolationException, NotFoundException, ContextNotFoundException, ResourceRegistryException {
|
||||||
try {
|
try {
|
||||||
String type = TypeUtility.getTypeName(er);
|
String type = er.getTypeName();
|
||||||
UUID instanceUUID = er.getUUID();
|
UUID instanceUUID = er.getUUID();
|
||||||
return removeFromContext(type, instanceUUID, contextUUID, dryRun);
|
return removeFromContext(type, instanceUUID, contextUUID, dryRun);
|
||||||
} catch (ResourceRegistryException e) {
|
} catch (ResourceRegistryException e) {
|
||||||
|
@ -966,7 +966,7 @@ public class ResourceRegistryPublisherImpl implements ResourceRegistryPublisher
|
||||||
@Override
|
@Override
|
||||||
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 = TypeUtility.getTypeName(er);
|
String type = er.getTypeName();
|
||||||
UUID instanceUUID = er.getUUID();
|
UUID instanceUUID = er.getUUID();
|
||||||
return getElementContexts(type, instanceUUID);
|
return getElementContexts(type, instanceUUID);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue