@@ -0,0 +1,1463 @@
+package org.alien4cloud.alm.deployment.configuration.flow;%0A%0Aimport java.util.List;%0A%0Aimport javax.annotation.Resource;%0A%0Aimport org.springframework.stereotype.Component;%0A%0Aimport com.google.common.collect.Lists;%0A%0Aimport alien4cloud.dao.IGenericSearchDAO;%0Aimport alien4cloud.dao.model.GetMultipleDataResult;%0Aimport alien4cloud.model.orchestrators.locations.Location;%0Aimport alien4cloud.model.orchestrators.locations.LocationModifierReference;%0Aimport alien4cloud.plugin.AbstractPluginLinker;%0Aimport alien4cloud.plugin.model.PluginUsage;%0A%0A@Component%0Apublic class TopologyModifierPluginLinker extends AbstractPluginLinker%3CITopologyModifier%3E %7B%0A    @Resource(name = %22alien-es-dao%22)%0A    private IGenericSearchDAO alienDAO;%0A%0A    @Override%0A    public List%3CPluginUsage%3E usage(String pluginId) %7B%0A        // Get all modifiers associated with a location%0A        GetMultipleDataResult%3CLocation%3E locationData = alienDAO.buildQuery(Location.class).prepareSearch().search(0, Integer.MAX_VALUE);%0A%0A        List%3CPluginUsage%3E usages = Lists.newArrayList();%0A        for (Location location : locationData.getData()) %7B%0A            for (LocationModifierReference locationModifierReference : location.getModifiers()) %7B%0A                if (pluginId.equals(locationModifierReference.getPluginId())) %7B%0A                    usages.add(new PluginUsage(location.getId(), location.getName(), Location.class.getSimpleName()));%0A                %7D%0A            %7D%0A        %7D%0A%0A        return usages;%0A    %7D%0A%7D%0A

Check usage of location modifiers to prevent disabling a plugin that is actually in use.