Exemplo n.º 1
0
 public Endpoint(IMessageSource messageSource, IIncomingPipeline pipeline, ILogger <Endpoint> logger, bool useConcurrentFetching, IBatchSizeProvider batchSizeProvider)
 {
     this.messageSource         = messageSource;
     this.pipeline              = pipeline;
     this.logger                = logger;
     this.useConcurrentFetching = useConcurrentFetching;
     this.batchSizeProvider     = batchSizeProvider;
 }
Exemplo n.º 2
0
        public UploadLauncher(IDictionary <String, String> connStrs, IBatchSizeProvider batchSizeProvider, RestartParameter restartDetails)
        {
            ConnectionStrings = new Dictionary <String, String>();
            IList <String> connectionNames = new List <String>()
            {
                Constants.ConnectionNames.Host.ToUpper(), Constants.ConnectionNames.POS.ToUpper(), Constants.ConnectionNames.Sql.ToUpper()
            };

            foreach (KeyValuePair <String, String> kvp in connStrs)
            {
                String key = kvp.Key.ToUpper();
                if (connectionNames.Contains(key))
                {
                    ConnectionStrings.Add(key, kvp.Value);
                }
            }

            IList <String> requiredConnectionNames = new List <String>()
            {
                Constants.ConnectionNames.Host.ToUpper(), Constants.ConnectionNames.Sql.ToUpper()
            };

            foreach (String connName in requiredConnectionNames)
            {
                if (!ConnectionStrings.ContainsKey(connName))
                {
                    throw new ApplicationException("No connection string found for connection name " + connName);
                }
            }

            foreach (KeyValuePair <String, String> kvp in ConnectionStrings)
            {
                if (kvp.Key.Equals(Constants.ConnectionNames.Sql, StringComparison.InvariantCultureIgnoreCase))
                {
                    SqlConnectionString = kvp.Value;
                }
                if (kvp.Key.Equals(Constants.ConnectionNames.Host, StringComparison.InvariantCultureIgnoreCase))
                {
                    HostConnectionString = kvp.Value;
                }
            }

            RestartParameter  = restartDetails;
            batchSizeProvider = batchSizeProvider ?? new DiTableOrDefaultBatchSizeProvider(HostConnectionString);
            TableProcessor    = new TableProcessor(batchSizeProvider);
        }
Exemplo n.º 3
0
        private void BuildAndInit(IBatchSizeProvider batchSizeProvider)
        {
            /*
             * Positioning the ConversionActionProcessor is tricky.  At 1st I put it at the
             * end because I didn't want it firing when we handle null dates etc.  But
             * I blew chow in my test because as part of the test setup I had deleted
             * the _currentVersions tables.  When NullDateProcessor issued the the
             * update on IN_SBPL the trigger that updates _currentVersions fired and
             * bombed because the table didn't exist
             */

            Init(new List <ITableProcessor>()
            {
                new TruncateTableProcessor(),
                new NumericScrubProcessor(),
                new TableUploader(batchSizeProvider),
                new ConversionActionProcessor(),
                new AsciiZeroMemoProcessor(),
                new NullCharacterScrubber(),
                new NullDateProcessor(),
                new SetDeletedProcessor()
            }
                 );
        }
Exemplo n.º 4
0
 public TableUploader(IBatchSizeProvider batchSizeProvider)
 {
     BatchSizeProvider = batchSizeProvider ?? new DefaultBatchSizeProvider();
 }
Exemplo n.º 5
0
 public NumericScrubProcessor(IBatchSizeProvider batchSizeProvider)
 {
     CommandStrings    = new List <String>();
     BatchSizeProvider = batchSizeProvider ?? new DefaultBatchSizeProvider();
 }
Exemplo n.º 6
0
 public UploadLauncher(IDictionary <String, String> connStrs, IBatchSizeProvider batchSizeProvider)
 {
 }
Exemplo n.º 7
0
 public TableProcessor(IBatchSizeProvider batchSizeProvider)
 {
     BuildAndInit(batchSizeProvider);
 }
Exemplo n.º 8
0
 public DiTableOrDefaultBatchSizeProvider(String hostConnectionString)
 {
     defaultBatchSizeProvider = new DefaultBatchSizeProvider();
     ditableBatchSizeProvider = new DiTableBatchSizeProvider(hostConnectionString);
 }