improving code
This commit is contained in:
parent
dc481fbba6
commit
42bb1a217a
|
@ -35,7 +35,7 @@ public interface ERManagement {
|
|||
public Map<UUID, JsonNode> removeFromContext(UUID contextUUID)
|
||||
throws SchemaViolationException, NotFoundException, ContextException, ResourceRegistryException;
|
||||
|
||||
public void sanityCheck() throws SchemaViolationException, ResourceRegistryException;
|
||||
// public void sanityCheck() throws SchemaViolationException, ResourceRegistryException;
|
||||
|
||||
public AvailableInAnotherContextException getSpecificERAvailableInAnotherContextException(String message);
|
||||
|
||||
|
|
|
@ -338,6 +338,7 @@ public abstract class EntityManagement<E extends Entity, ET extends EntityType>
|
|||
element.save();
|
||||
}
|
||||
affectedInstances.put(uuid, serializeSelfAsJsonNode());
|
||||
sanityCheck();
|
||||
return affectedInstances;
|
||||
} catch(ResourceRegistryException e) {
|
||||
throw e;
|
||||
|
@ -360,8 +361,6 @@ public abstract class EntityManagement<E extends Entity, ET extends EntityType>
|
|||
|
||||
Map<UUID,JsonNode> affectedInstances = internalAddToContext();
|
||||
|
||||
sanityCheck();
|
||||
|
||||
oDatabaseDocument.commit();
|
||||
logger.info("{} with UUID {} successfully added to Context with UUID {}", typeName, uuid, contextUUID);
|
||||
|
||||
|
@ -400,6 +399,7 @@ public abstract class EntityManagement<E extends Entity, ET extends EntityType>
|
|||
element.save();
|
||||
}
|
||||
affectedInstances.put(uuid, serializeSelfAsJsonNode());
|
||||
sanityCheck();
|
||||
return affectedInstances;
|
||||
} catch(ResourceRegistryException e) {
|
||||
throw e;
|
||||
|
@ -454,8 +454,6 @@ public abstract class EntityManagement<E extends Entity, ET extends EntityType>
|
|||
|
||||
Map<UUID,JsonNode> affectedInstances = internalRemoveFromContext();
|
||||
|
||||
sanityCheck();
|
||||
|
||||
oDatabaseDocument.commit();
|
||||
logger.info("{} with UUID {} successfully removed from Context with UUID {}", typeName, uuid, contextUUID);
|
||||
|
||||
|
|
Loading…
Reference in New Issue