package alien4cloud.paas.cloudify3.location;

import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.stereotype.Component;

import com.google.common.collect.Sets;

import alien4cloud.model.deployment.matching.MatchingConfiguration;
import alien4cloud.model.orchestrators.locations.LocationResourceTemplate;
import alien4cloud.orchestrators.plugin.ILocationResourceAccessor;

@Component
public class ByonLocationConfigurator extends AbstractLocationConfigurator {
    @Override
    protected String[] getLocationArchivePaths() {
        return new String[] { "provider/byon/configuration" };
    }

    @Override
    public List<String> getResourcesTypes() {
        return getAllResourcesTypes();
    }

    @Override
    public List<LocationResourceTemplate> instances(ILocationResourceAccessor resourceAccessor) {
        return null;
    }

    @Override
    public Set<String> getManagedLocationTypes() {
        return Sets.newHashSet("byon");
    }

    @Override
    public Map<String, MatchingConfiguration> getMatchingConfigurations() {
        return getMatchingConfigurations("provider/openstack/matching/config.yml");
    }
}

@@ -851,29 +851,145 @@
 or) 
-%7B%0A        return null
+throws UnsupportedOperationException %7B%0A        throw new UnsupportedOperationException(%22Auto-config is not supported for this location.%22)
 ;%0A  

throw an exception when a user try an auto-config on location who don't support this operation