use of org.palladiosimulator.pcm.compositionprivacy.DataPrivacyLvl in project iobserve-analysis by research-iobserve.
the class HostComponentAllocationGraphFactory method updatePrivacyLvl.
private void updatePrivacyLvl(final AssemblyConnectorPrivacy acp, final DataPrivacyLvl assemblyConnectorPrivacyLvl, final String assemblyContextID) {
// Check whether the AssemblyContext was found while extracting
final AssemblyContext assemblyContext = this.assemblyContexts.get(assemblyContextID);
if (assemblyContext == null) {
if (HostComponentAllocationGraphFactory.LOGGER.isErrorEnabled()) {
HostComponentAllocationGraphFactory.LOGGER.error("The provided AssemblyContext (ID: " + assemblyContextID + ") form the AssemblyConnectorPrivacy (ID:" + acp.getId() + ") " + "was not found during the AssemblyContextExtraction");
}
this.assemblyContexts.put(assemblyContextID, acp.getProvidingAssemblyContext_AssemblyConnector());
}
// Do the actual job and update the privacy lvl
DataPrivacyLvl currentDataLevelPrivacy = this.assemblyContextPrivacyLvl.get(assemblyContextID);
if (currentDataLevelPrivacy != null) {
currentDataLevelPrivacy = DataPrivacyLvl.get(Math.min(assemblyConnectorPrivacyLvl.getValue(), currentDataLevelPrivacy.getValue()));
} else {
currentDataLevelPrivacy = assemblyConnectorPrivacyLvl;
}
this.assemblyContextPrivacyLvl.put(assemblyContextID, currentDataLevelPrivacy);
}
Aggregations