public void activate()

in collector/openstack/src/main/java/org/apache/karaf/decanter/collector/openstack/OpenstackCollector.java [83:129]


    public void activate(Dictionary<String, Object> config) throws Exception {
        this.config = config;
        topic = (config.get(EventConstants.EVENT_TOPIC) != null) ? (String) config.get(EventConstants.EVENT_TOPIC) : "decanter/collect/openstack";
        if (config.get("openstack.identity") == null) {
            throw new IllegalStateException("openstack.identity is not configured");
        }
        identity = new URL(config.get("openstack.identity") + "/v3/auth/tokens");
        if (config.get("openstack.username") == null) {
            throw new IllegalStateException("openstack.username is not configured");
        }
        username = (String) config.get("openstack.username");
        if (config.get("openstack.password") == null) {
            throw new IllegalStateException("openstack.password is not configured");
        }
        password = (String) config.get("openstack.password");
        if (config.get("openstack.domain") == null) {
            throw new IllegalStateException("openstack.domain is not configured");
        }
        domain = (String) config.get("openstack.domain");
        if (config.get("openstack.project") == null) {
            throw new IllegalStateException("openstack.project is not configured");
        }
        project = (String) config.get("openstack.project");

        if (config.get("openstack.compute.enabled") != null) {
            computeEnabled = Boolean.parseBoolean((String) config.get("openstack.compute.enabled"));
        }
        compute = (String) config.get("openstack.compute");
        if (config.get("openstack.compute.usage.flatten") != null) {
            computeUsageFlatten = Boolean.parseBoolean((String) config.get("openstack.compute.usage.flatten"));
        }

        if (config.get("openstack.block.storage.enabled") != null) {
            blockStorageEnabled = Boolean.parseBoolean((String) config.get("openstack.block.storage.enabled"));
        }
        blockStorage = (String) config.get("openstack.block.storage");

        if (config.get("openstack.image.enabled") != null) {
            imageEnabled = Boolean.parseBoolean((String) config.get("openstack.image.enabled"));
        }
        image = (String) config.get("openstack.image");

        if (config.get("openstack.metric.enabled") != null) {
            metricEnabled = Boolean.parseBoolean((String) config.get("openstack.metric.enabled"));
        }
        metric = (String) config.get("openstack.metric");
    }