package cz.muni.fi.jboss.migration;

import cz.muni.fi.jboss.migration.spi.IMigrator;
import java.util.List;
import org.apache.commons.collections.map.MultiValueMap;

/**
 *  Holds global configuration and plugin-specific configuration.
 * 
 *  @author Roman Jakubco
 */
public class Configuration {

    private GlobalConfiguration globalConfig;

    private List<ModuleSpecificProperty> moduleConfigs;

    
    public GlobalConfiguration getGlobal() {
        return globalConfig;
    }

    public void setGlobalConfig(GlobalConfiguration options) {
        this.globalConfig = options;
    }

    public List<ModuleSpecificProperty> getModuleConfigs() {
        return moduleConfigs;
    }

    public void setModuleConfigs(List<ModuleSpecificProperty> moduleConfigs) {
        this.moduleConfigs = moduleConfigs;
    }


    private MultiValueMap getForMigrator(Class<? extends IMigrator> migrator) {
        //return moduleOtions.get(migrator);
        throw new UnsupportedOperationException();
    }
    
    
    /**
     *  Triplet for module specific property, e.g --conf.logging.merge=true .
     */
    public static class ModuleSpecificProperty{
        
        private String moduleId;
        private String propName;
        private String value;

        public ModuleSpecificProperty(String moduleId, String propName, String value) {
            this.moduleId = moduleId;
            this.propName = propName;
            this.value = value;
        }

        public String getModuleId() { return moduleId; }
        public void setModuleId(String moduleId) { this.moduleId = moduleId; }
        public String getPropName() { return propName; }
        public void setPropName(String propName) { this.propName = propName; }
        public String getValue() { return value; }
        public void setValue(String value) { this.value = value; }        
    }
    
}// class

@@ -402,429 +402,100 @@
 s;%0A%0A
-    
 %0A    
-public GlobalConfiguration getGlobal() %7B%0A 
+/**%0A
      
+*
   
-r
+R
 eturn
- globalConfig;%0A    %7D%0A%0A    public void setGlobalConfig(GlobalConf
+s all config m
 ig
-u
 rat
-ion options) %7B%0A        this.globalConfig = options;%0A    %7D%0A%0A    public List%3CModuleSpecificProperty%3E getModuleConfigs() %7B%0A        return moduleConfigs;%0A    %7D%0A%0A    public void setModuleConfigs(List%3CModuleSpecificProperty%3E moduleConfigs) %7B%0A        this.moduleConfigs = moduleConfigs;%0A
+or-specific values for the given migrator.%0A 
     
-%7D%0A%0A
+*/
 %0A   
@@ -598,13 +598,14 @@
 dule
-Otion
+Config
 s.ge
@@ -1548,16 +1548,475 @@
  %7D%0A    %0A
+    %0A    //%3Ceditor-fold defaultstate=%22collapsed%22 desc=%22get/set%22%3E%0A    public GlobalConfiguration getGlobal() %7B return globalConfig; %7D%0A    public void setGlobalConfig(GlobalConfiguration options) %7B this.globalConfig = options; %7D%0A    public List%3CModuleSpecificProperty%3E getModuleConfigs() %7B return moduleConfigs; %7D%0A    public void setModuleConfigs(List%3CModuleSpecificProperty%3E moduleConfigs) %7B this.moduleConfigs = moduleConfigs; %7D%0A    //%3C/editor-fold%3E    %0A    %0A
 %7D// clas

Format & comments