Ejemplo n.º 1
0
        public IEtlRunner Get(IEtl etl)
        {
            var factory = new SsisEtlRunnerFactory();
            var runner  = factory.Get(etl);

            return(runner);
        }
Ejemplo n.º 2
0
        public EtlCatalogRunner(IEtl etl)
            : base(etl)
        {
            var argumentNullExceptionSentence = "You must specify a value for parameter '{0}' when using an EtlCatalogRunner";

            if (string.IsNullOrEmpty(Etl.Server))
            {
                throw new ArgumentNullException("Server", string.Format(argumentNullExceptionSentence, "Server"));
            }

            if (string.IsNullOrEmpty(Etl.Catalog))
            {
                throw new ArgumentNullException("Catalog", string.Format(argumentNullExceptionSentence, "Catalog"));
            }

            if (string.IsNullOrEmpty(Etl.Folder))
            {
                throw new ArgumentNullException("Folder", string.Format(argumentNullExceptionSentence, "Folder"));
            }

            if (string.IsNullOrEmpty(Etl.Project))
            {
                throw new ArgumentNullException("Project", string.Format(argumentNullExceptionSentence, "Project"));
            }

            if (string.IsNullOrEmpty(Etl.Name))
            {
                throw new ArgumentNullException("Name", string.Format(argumentNullExceptionSentence, "Name"));
            }
        }
Ejemplo n.º 3
0
        public IEtlRunner Get(IEtl etl)
        {
            var directory = AssemblyDirectory;
            var filename  = string.Format("NBi.Core.{0}.dll", etl.Version);
            var filepath  = string.Format("{0}\\{1}", directory, filename);

            if (!File.Exists(filepath))
            {
                throw new InvalidOperationException(string.Format("Can't find the dll for version '{0}' in '{1}'. NBi was expecting to find a dll named '{2}'.", etl.Version, directory, filename));
            }

            var assembly = Assembly.LoadFrom(filepath);
            var types    = assembly.GetTypes()
                           .Where(m => m.IsClass && m.GetInterface("IEtlRunnerFactory") != null);

            if (types.Count() == 0)
            {
                throw new InvalidOperationException(string.Format("Can't find a class implementing 'IEtlRunnerFactory' in '{0}'.", assembly.FullName));
            }
            if (types.Count() > 1)
            {
                throw new InvalidOperationException(string.Format("Found more than one class implementing 'IEtlRunnerFactory' in '{0}'.", assembly.FullName));
            }

            var etlRunnerFactory = Activator.CreateInstance(types.ElementAt(0)) as IEtlRunnerFactory;

            var etlRunner = etlRunnerFactory.Get(etl);

            return(etlRunner);
        }
Ejemplo n.º 4
0
 public EtlDtsWindowsRunner(IEtl etl)
     : base(etl)
 {
     var argumentNullExceptionSentence = "You must specify a value for parameter '{0}' when using an EtlDtsWindowsRunner";
     if (string.IsNullOrEmpty(Etl.Server))
         throw new ArgumentNullException("Server", string.Format(argumentNullExceptionSentence, "Server"));
 }
Ejemplo n.º 5
0
        public EtlDtsWindowsRunner(IEtl etl)
            : base(etl)
        {
            var argumentNullExceptionSentence = "You must specify a value for parameter '{0}' when using an EtlDtsWindowsRunner";

            if (string.IsNullOrEmpty(Etl.Server))
            {
                throw new ArgumentNullException("Server", string.Format(argumentNullExceptionSentence, "Server"));
            }
        }
Ejemplo n.º 6
0
        protected override Package Load(IEtl etl, Application app)
        {
            var packageName = etl.Path + etl.Name;
            if (!packageName.ToLower().EndsWith(".dtsx"))
                packageName += ".dtsx";

            var events = new PackageEvents();
            var package = app.LoadPackage(packageName, events);
            return package;
        }
Ejemplo n.º 7
0
        public EtlDtsRunner(IEtl etl)
            : base(etl)
        {
            var argumentNullExceptionSentence = "You must specify a value for parameter '{0}' when using an EtlDtsRunner";

            if (string.IsNullOrEmpty(Etl.Path))
                throw new ArgumentNullException("Path", string.Format(argumentNullExceptionSentence, "Path"));

            if (string.IsNullOrEmpty(Etl.Name))
                throw new ArgumentNullException("Name", string.Format(argumentNullExceptionSentence, "Name"));
        }
Ejemplo n.º 8
0
 public IEtlRunner Get(IEtl etl)
 {
     if (string.IsNullOrEmpty(etl.Server))
         return new EtlFileRunner(etl);
     else if (!string.IsNullOrEmpty(etl.Catalog) || !string.IsNullOrEmpty(etl.Folder) || !string.IsNullOrEmpty(etl.Project))
         return new EtlCatalogRunner(etl);
     else if (string.IsNullOrEmpty(etl.UserName))
         return new EtlDtsWindowsRunner(etl);
     else
         return new EtlDtsSqlServerRunner(etl);
 }
Ejemplo n.º 9
0
        protected override Package Load(IEtl etl, Application app)
        {
            var server = etl.Server.Replace(" ", "");
            if(server.ToLower()=="(local)")
                server=".";

            var packageName = etl.Path + etl.Name;

            var events = new PackageEvents();
            var package = app.LoadFromDtsServer(packageName, server, events);
            return package;
        }
Ejemplo n.º 10
0
        public EtlDtsSqlServerRunner(IEtl etl)
            : base(etl)
        {
            var argumentNullExceptionSentence = "You must specify a value for parameter '{0}' when using an EtlDtsSqlServerRunner";
            if (string.IsNullOrEmpty(Etl.Server))
                throw new ArgumentNullException("Server", string.Format(argumentNullExceptionSentence, "Server"));

            if (string.IsNullOrEmpty(Etl.UserName))
                throw new ArgumentNullException("UserName", string.Format(argumentNullExceptionSentence, "UserName"));

            if (string.IsNullOrEmpty(Etl.Password))
                throw new ArgumentNullException("Password", string.Format(argumentNullExceptionSentence, "Password"));
        }
Ejemplo n.º 11
0
        public EtlDtsRunner(IEtl etl) : base(etl)
        {
            var argumentNullExceptionSentence = "You must specify a value for parameter '{0}' when using an EtlDtsRunner";

            if (string.IsNullOrEmpty(Etl.Path))
            {
                throw new ArgumentNullException("Path", string.Format(argumentNullExceptionSentence, "Path"));
            }

            if (string.IsNullOrEmpty(Etl.Name))
            {
                throw new ArgumentNullException("Name", string.Format(argumentNullExceptionSentence, "Name"));
            }
        }
Ejemplo n.º 12
0
        protected override Package Load(IEtl etl, Application app)
        {
            var packageName = etl.Path + etl.Name;

            if (!packageName.ToLower().EndsWith(".dtsx"))
            {
                packageName += ".dtsx";
            }

            var events  = new PackageEvents();
            var package = app.LoadPackage(packageName, events);

            return(package);
        }
Ejemplo n.º 13
0
        protected override Package Load(IEtl etl, Application app)
        {
            var server = etl.Server.Replace(" ", "");
            if(server.ToLower()=="(local)")
                server=".";

            var packageName = etl.Path + etl.Name;
            if (!packageName.ToLower().EndsWith(".dtsx"))
                packageName += ".dtsx";

            var events = new PackageEvents();
            var package = app.LoadFromSqlServer(packageName, server, etl.UserName, etl.Password, events);
            return package;
        }
Ejemplo n.º 14
0
        protected override Package Load(IEtl etl, Application app)
        {
            var server = etl.Server.Replace(" ", "");

            if (server.ToLower() == "(local)")
            {
                server = ".";
            }

            var packageName = etl.Path + etl.Name;

            var events  = new PackageEvents();
            var package = app.LoadFromDtsServer(packageName, server, events);

            return(package);
        }
Ejemplo n.º 15
0
        public EtlCatalogRunner(IEtl etl)
            : base(etl)
        {
            var argumentNullExceptionSentence = "You must specify a value for parameter '{0}' when using an EtlCatalogRunner";
            if (string.IsNullOrEmpty(Etl.Server))
                throw new ArgumentNullException("Server", string.Format(argumentNullExceptionSentence, "Server"));

            if (string.IsNullOrEmpty(Etl.Catalog))
                throw new ArgumentNullException("Catalog", string.Format(argumentNullExceptionSentence, "Catalog"));

            if (string.IsNullOrEmpty(Etl.Folder))
                throw new ArgumentNullException("Folder", string.Format(argumentNullExceptionSentence, "Folder"));

            if (string.IsNullOrEmpty(Etl.Project))
                throw new ArgumentNullException("Project", string.Format(argumentNullExceptionSentence, "Project"));

            if (string.IsNullOrEmpty(Etl.Name))
                throw new ArgumentNullException("Name", string.Format(argumentNullExceptionSentence, "Name"));
        }
Ejemplo n.º 16
0
 public IEtlRunner Get(IEtl etl)
 {
     if (string.IsNullOrEmpty(etl.Server))
     {
         return(new EtlFileRunner(etl));
     }
     else if (!string.IsNullOrEmpty(etl.Catalog) || !string.IsNullOrEmpty(etl.Folder) || !string.IsNullOrEmpty(etl.Project))
     {
         return(new EtlCatalogRunner(etl));
     }
     else if (string.IsNullOrEmpty(etl.UserName))
     {
         return(new EtlDtsWindowsRunner(etl));
     }
     else
     {
         return(new EtlDtsSqlServerRunner(etl));
     }
 }
Ejemplo n.º 17
0
        public EtlDtsSqlServerRunner(IEtl etl)
            : base(etl)
        {
            var argumentNullExceptionSentence = "You must specify a value for parameter '{0}' when using an EtlDtsSqlServerRunner";

            if (string.IsNullOrEmpty(Etl.Server))
            {
                throw new ArgumentNullException("Server", string.Format(argumentNullExceptionSentence, "Server"));
            }

            if (string.IsNullOrEmpty(Etl.UserName))
            {
                throw new ArgumentNullException("UserName", string.Format(argumentNullExceptionSentence, "UserName"));
            }

            if (string.IsNullOrEmpty(Etl.Password))
            {
                throw new ArgumentNullException("Password", string.Format(argumentNullExceptionSentence, "Password"));
            }
        }
Ejemplo n.º 18
0
        protected override Package Load(IEtl etl, Application app)
        {
            var server = etl.Server.Replace(" ", "");

            if (server.ToLower() == "(local)")
            {
                server = ".";
            }

            var packageName = etl.Path + etl.Name;

            if (!packageName.ToLower().EndsWith(".dtsx"))
            {
                packageName += ".dtsx";
            }

            var events  = new PackageEvents();
            var package = app.LoadFromSqlServer(packageName, server, etl.UserName, etl.Password, events);

            return(package);
        }
Ejemplo n.º 19
0
 public IEtlRunner Get(IEtl etl)
 {
     if (string.IsNullOrEmpty(etl.Server))
     {
         return(new EtlFileRunner(etl));
     }
     #if !SqlServer2008R2
     else if (!string.IsNullOrEmpty(etl.Catalog))
     {
         return(new EtlCatalogRunner(etl));
     }
     #endif
     else if (string.IsNullOrEmpty(etl.UserName))
     {
         return(new EtlDtsWindowsRunner(etl));
     }
     else
     {
         return(new EtlDtsSqlServerRunner(etl));
     }
 }
Ejemplo n.º 20
0
        public IEtlRunner Get(IEtl etl)
        {
            var directory = AssemblyDirectory;
            var filename = string.Format("NBi.Core.{0}.dll", etl.Version);
            var filepath = string.Format("{0}\\{1}", directory, filename);
            if (!File.Exists(filepath))
                throw new InvalidOperationException(string.Format("Can't find the dll for version '{0}' in '{1}'. NBi was expecting to find a dll named '{2}'.", etl.Version, directory, filename));

            var assembly = Assembly.LoadFrom(filepath);
            var types = assembly.GetTypes()
                            .Where(m => m.IsClass && m.GetInterface("IEtlRunnerFactory") != null);

            if (types.Count()==0)
                throw new InvalidOperationException(string.Format("Can't find a class implementing 'IEtlRunnerFactory' in '{0}'.", assembly.FullName));
            if (types.Count() > 1)
                throw new InvalidOperationException(string.Format("Found more than one class implementing 'IEtlRunnerFactory' in '{0}'.", assembly.FullName));

            var etlRunnerFactory = Activator.CreateInstance(types.ElementAt(0)) as IEtlRunnerFactory;

            var etlRunner = etlRunnerFactory.Get(etl);

            return etlRunner;
        }
Ejemplo n.º 21
0
 public EtlDtsWindowsRunner(IEtl etl)
     : base(etl)
 {
 }
Ejemplo n.º 22
0
 public EtlDtsRunner(IEtl etl) : base(etl)
 {
 }
Ejemplo n.º 23
0
 public EtlDtsSqlServerRunner(IEtl etl)
     : base(etl)
 {
 }
Ejemplo n.º 24
0
 public EtlCatalogRunner(IEtl etl)
     : base(etl)
 {
 }
Ejemplo n.º 25
0
 public EtlFileRunner(IEtl etl)
     : base(etl)
 {
 }
Ejemplo n.º 26
0
 public IEtlRunner Get(IEtl etl)
 {
     var factory = new SsisEtlRunnerFactory();
     var runner = factory.Get(etl);
     return runner;
 }
Ejemplo n.º 27
0
 protected abstract Package Load(IEtl etl, Application app);
Ejemplo n.º 28
0
 public EtlCatalogRunner(IEtl etl)
     : base(etl)
 {
 }
Ejemplo n.º 29
0
 public EtlRunner(IEtl etl)
 {
     Etl = etl;
 }
Ejemplo n.º 30
0
 public EtlRunner(IEtl etl)
 {
     Etl = etl;
 }
Ejemplo n.º 31
0
 public EtlDtsSqlServerRunner(IEtl etl)
     : base(etl)
 {
 }
Ejemplo n.º 32
0
 public EtlDtsRunner(IEtl etl)
     : base(etl)
 {
 }
Ejemplo n.º 33
0
 public EtlFileRunner(IEtl etl)
     : base(etl)
 {
 }
Ejemplo n.º 34
0
 protected abstract Package Load(IEtl etl, Application app);
Ejemplo n.º 35
0
 public EtlDtsWindowsRunner(IEtl etl)
     : base(etl)
 {
 }