Ejemplo n.º 1
0
        public OrchestratorService()
        {
            Int32.TryParse(ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.DashboardCleanupTime], out _dashboardCleanupTime);
            Int32.TryParse(ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.CronSchedule], out _cronSchedule);
            // Set up
            _allConfigs                  = new ThreadSafeWorkStack();
            _extractors                  = new ThreadSafeExtractorList();
            _workStack                   = new ThreadSafeWorkStack();
            _activeExtractions           = new ThreadSafeWorkStack();
            _completedExtractions        = new ThreadSafeWorkStack();
            _erroredExtractions          = new ThreadSafeWorkStack();
            _myHostName                  = ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.OrchestratorHostName];
            _report.OrchestratorHostName = _myHostName;
            _listeningPort               = Convert.ToInt32(ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.OrchestratorListeningPort]);
            _myIp = IPv4Helper.getIPv4Address();

            // Determine what type of SQL database we are using
            String sqlProvider      = ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.SqlProvider];
            String connectionString = ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.SqlConnectionString];

            _sqlDao = new SqlDaoFactory().getSqlDao(new SqlConnectionFactory().getConnection(sqlProvider, connectionString));

            // make own unique list of sitecodes
            VistaDao vistaDao = new VistaDao();

            string[] sitecode = new string[vistaDao.SiteCodes.Count];
            vistaDao.SiteCodes.CopyTo(sitecode, 0);
            _vhaSites = new List <string>(sitecode);

            if (_vhaSites == null || _vhaSites.Count == 0)
            {
                _report.addException(new ApplicationException("Failed to open the VHA site file!"));
                throw new ApplicationException("Failed to open the VHA site file!");
            }
        }
Ejemplo n.º 2
0
        internal void initializePool()
        {
            logging.Log.LOG("Initializing connection pools...");
            if (ConnectionPools.getInstance().PoolSource != null)
            {
                logging.Log.LOG("Connection pools already initialized");
                return; // already set up the pools!
            }

            SiteTable sites = new SiteTable(ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.VhaSitesFilePath]);
            IList <AbstractPoolSource> sources     = new List <AbstractPoolSource>();
            ConnectionPoolsSource      poolsSource = new ConnectionPoolsSource();

            poolsSource.CxnSources = new Dictionary <string, ConnectionPoolSource>();
            VistaDao            trash = new VistaDao();
            AbstractCredentials creds = getDownstreamCredentialsFromConfig(getDownstreamUserFromConfig());

            foreach (DataSource source in sites.Sources)
            {
                if (!String.Equals(source.Protocol, "VISTA", StringComparison.CurrentCultureIgnoreCase))
                {
                    continue;
                }
                ConnectionPoolSource newSource = new ConnectionPoolSource()
                {
                    Timeout           = TimeSpan.Parse(ConfigurationManager.AppSettings["PoolConnectionTimeout"]),
                    WaitTime          = TimeSpan.Parse(ConfigurationManager.AppSettings["PoolWaitTimeout"]),
                    MaxPoolSize       = Convert.ToInt32(ConfigurationManager.AppSettings["PoolMaxSize"]),
                    MinPoolSize       = Convert.ToInt32(ConfigurationManager.AppSettings["PoolMinSize"]),
                    PoolExpansionSize = Convert.ToInt32(ConfigurationManager.AppSettings["PoolExpansionSize"]),
                    CxnSource         = source,
                    Credentials       = creds,
                    Permission        = new MenuOption(ConfigurationManager.AppSettings["PoolUserPermission"])
                };
                Int32 recycleCount = 0;
                if (!String.IsNullOrEmpty(ConfigurationManager.AppSettings["PoolRecycleCount"]) && Int32.TryParse(ConfigurationManager.AppSettings["PoolRecycleCount"], out recycleCount))
                {
                    newSource.RecycleCount = recycleCount;
                }
                newSource.CxnSource.Protocol = "PVISTA";
                poolsSource.CxnSources.Add(source.SiteId.Id, newSource);
            }

            ConnectionPools pools = (ConnectionPools)AbstractResourcePoolFactory.getResourcePool(poolsSource);

            logging.Log.LOG("Successfully completed connection pools initialization");
        }
Ejemplo n.º 3
0
        void refreshConfigFileSettings()
        {
            ConfigurationManager.RefreshSection("appSettings"); // refresh this on every iteration so we don't have to bring down process to update config file
            Int32.TryParse(ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.CronSchedule], out _cronSchedule);

            // Determine what type of SQL database we are using
            String sqlProvider      = ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.SqlProvider];
            String connectionString = ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.SqlConnectionString];

            _sqlDao = new SqlDaoFactory().getSqlDao(new SqlConnectionFactory().getConnection(sqlProvider, connectionString));

            // make own unique list of sitecodes
            VistaDao vistaDao = new VistaDao();

            string[] sitecode = new string[vistaDao.SiteCodes.Count];
            vistaDao.SiteCodes.CopyTo(sitecode, 0);
            _vhaSites = new List <string>(sitecode);

            if (_vhaSites == null || _vhaSites.Count == 0)
            {
                _report.addException(new ApplicationException("Failed to open the VHA site file!"));
                throw new ApplicationException("Failed to open the VHA site file!");
            }
        }
Ejemplo n.º 4
0
 public DataTable GetCuentasNumero()
 {
     return(VistaDao.VW_GetCuentasNumero());
 }
Ejemplo n.º 5
0
 public DataTable GetCuentasTipoVab()
 {
     return(VistaDao.VW_GetCuentasTipoVab());
 }
Ejemplo n.º 6
0
 public DataTable DiferenciasPorFecha(DateTime desde, DateTime hasta)
 {
     return(VistaDao.VW_DiferenciasPorFecha(desde, hasta));
 }
Ejemplo n.º 7
0
 public void SetUp()
 {
     _vistaDao = new VistaDao();
 }