package com.bonus.core.data.dataset.rule.loader;

import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
@Component
public interface DataSourceLoader {
   DataSet load(String name);

   List<DataSet> load();

   public static class DataSet {
      private String name;
      private Config master;
      private Map<String, Long> schemaRefUID;
      private List<Config> slave;

      public String getName() {
         return this.name;
      }

      public Config getMaster() {
         return this.master;
      }

      public Map<String, Long> getSchemaRefUID() {
         return this.schemaRefUID;
      }

      public List<Config> getSlave() {
         return this.slave;
      }

      public void setName(final String name) {
         this.name = name;
      }

      public void setMaster(final Config master) {
         this.master = master;
      }

      public void setSchemaRefUID(final Map<String, Long> schemaRefUID) {
         this.schemaRefUID = schemaRefUID;
      }

      public void setSlave(final List<Config> slave) {
         this.slave = slave;
      }

      public DataSet() {
      }

      public DataSet(final String name, final Config master, final Map<String, Long> schemaRefUID, final List<Config> slave) {
         this.name = name;
         this.master = master;
         this.schemaRefUID = schemaRefUID;
         this.slave = slave;
      }

      public static class Config {
         private String url;
         private String username;
         private String password;

         public String getUrl() {
            return this.url;
         }

         public String getUsername() {
            return this.username;
         }

         public String getPassword() {
            return this.password;
         }

         public void setUrl(final String url) {
            this.url = url;
         }

         public void setUsername(final String username) {
            this.username = username;
         }

         public void setPassword(final String password) {
            this.password = password;
         }

         public Config(final String url, final String username, final String password) {
            this.url = url;
            this.username = username;
            this.password = password;
         }

         public Config() {
         }
      }
   }
}
