Search in sources :

Example 6 with DataPrivacyLvl

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);
}
Also used : AssemblyContext(org.palladiosimulator.pcm.core.composition.AssemblyContext) DataPrivacyLvl(org.palladiosimulator.pcm.compositionprivacy.DataPrivacyLvl)

Aggregations

DataPrivacyLvl (org.palladiosimulator.pcm.compositionprivacy.DataPrivacyLvl)6 AssemblyContext (org.palladiosimulator.pcm.core.composition.AssemblyContext)4 AssemblyConnectorPrivacy (org.palladiosimulator.pcm.compositionprivacy.AssemblyConnectorPrivacy)3 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 AllocationContext (org.palladiosimulator.pcm.allocation.AllocationContext)1 AssemblyConnector (org.palladiosimulator.pcm.core.composition.AssemblyConnector)1 ResourceContainerPrivacy (org.palladiosimulator.pcm.resourceenvironmentprivacy.ResourceContainerPrivacy)1