Fixing code
This commit is contained in:
parent
44631557da
commit
d98303c28d
|
@ -74,7 +74,7 @@ public class ERManagementUtility {
|
||||||
* Without following the propagation constraint no instances are enforced to be added
|
* Without following the propagation constraint no instances are enforced to be added
|
||||||
* to the context. The sanity check ensure that the graph is consistent otherwise a
|
* to the context. The sanity check ensure that the graph is consistent otherwise a
|
||||||
* an exception is raised.
|
* an exception is raised.
|
||||||
* So no need to collect affected isntance and expected instance can be returned.
|
* So no need to collect affected instances and expected instance can be returned.
|
||||||
*/
|
*/
|
||||||
return expectedInstances;
|
return expectedInstances;
|
||||||
} catch(ResourceRegistryException e) {
|
} catch(ResourceRegistryException e) {
|
||||||
|
@ -113,8 +113,7 @@ public class ERManagementUtility {
|
||||||
|
|
||||||
SecurityContext targetSecurityContext = ContextUtility.getInstance().getSecurityContextByUUID(contextUUID);
|
SecurityContext targetSecurityContext = ContextUtility.getInstance().getSecurityContextByUUID(contextUUID);
|
||||||
|
|
||||||
Map<UUID,JsonNode> affectedInstances = new HashMap<>();
|
Map<UUID, ElementManagement<?>> instancesManagement = new HashMap<>();
|
||||||
|
|
||||||
for(UUID uuid : expectedInstances.keySet()) {
|
for(UUID uuid : expectedInstances.keySet()) {
|
||||||
String type = expectedInstances.get(uuid).get(Element.CLASS_PROPERTY).asText();
|
String type = expectedInstances.get(uuid).get(Element.CLASS_PROPERTY).asText();
|
||||||
ElementManagement<?> elementManagement = ElementManagementUtility.getERManagement(type);
|
ElementManagement<?> elementManagement = ElementManagementUtility.getERManagement(type);
|
||||||
|
@ -123,10 +122,14 @@ public class ERManagementUtility {
|
||||||
elementManagement.setUUID(uuid);
|
elementManagement.setUUID(uuid);
|
||||||
((ERManagement) elementManagement).setHonourPropagationConstraintsInContextSharing(false);
|
((ERManagement) elementManagement).setHonourPropagationConstraintsInContextSharing(false);
|
||||||
((ERManagement) elementManagement).setDryRunContextSharing(dryRun);
|
((ERManagement) elementManagement).setDryRunContextSharing(dryRun);
|
||||||
|
((ERManagement) elementManagement).internalRemoveFromContext(targetSecurityContext);
|
||||||
|
instancesManagement.put(uuid, elementManagement);
|
||||||
|
}
|
||||||
|
|
||||||
affectedInstances.putAll(((ERManagement) elementManagement).internalRemoveFromContext(targetSecurityContext));
|
for(UUID uuid : expectedInstances.keySet()) {
|
||||||
|
ElementManagement<?> elementManagement = instancesManagement.get(uuid);
|
||||||
((ERManagement) elementManagement).sanityCheck();
|
// TODO
|
||||||
|
elementManagement.sanityCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -139,7 +142,13 @@ public class ERManagementUtility {
|
||||||
|
|
||||||
staticLogger.info("{} successfully removed from Context with UUID {} not following Propagation Constraints", instances, contextUUID);
|
staticLogger.info("{} successfully removed from Context with UUID {} not following Propagation Constraints", instances, contextUUID);
|
||||||
|
|
||||||
return affectedInstances;
|
/*
|
||||||
|
* Without following the propagation constraint no instances are enforced to be added
|
||||||
|
* to the context. The sanity check ensure that the graph is consistent otherwise a
|
||||||
|
* an exception is raised.
|
||||||
|
* So no need to collect affected instances and expected instance can be returned.
|
||||||
|
*/
|
||||||
|
return expectedInstances;
|
||||||
} catch(ResourceRegistryException e) {
|
} catch(ResourceRegistryException e) {
|
||||||
staticLogger.error("Unable to remove {} from Context with UUID {} not following Propagation Constraints - Reason is {}", instances, contextUUID, e.getMessage());
|
staticLogger.error("Unable to remove {} from Context with UUID {} not following Propagation Constraints - Reason is {}", instances, contextUUID, e.getMessage());
|
||||||
if(oDatabaseDocument != null) {
|
if(oDatabaseDocument != null) {
|
||||||
|
|
Loading…
Reference in New Issue