示例#1
0
 internal RioCompletionWorker(int workerId, IWorkerConfiguration configuration, ICompletionHandler completionHandler)
 {
     _workerId              = workerId;
     _configuration         = configuration;
     _completionHandler     = completionHandler;
     SendingCompletionQueue = new RioCompletionQueue(configuration.CompletionQueueSize);
 }
示例#2
0
        public DiffProcessor(IWorkerConfiguration workerConfig, ISynchronization sync, ISvc source, ISvc target, IBlackMirrorHttpClient httpClient, ISyncLogger syncLogger, IUser defaultPushUser)
        {
            //this.mirror = mirror;
            this.sync            = sync;
            this.source          = source;
            this.target          = target;
            this.httpClient      = httpClient;
            this.syncLogger      = syncLogger;
            this.defaultPushUser = defaultPushUser;
            this.ignoredFiles    = sync.Mirror.IgnoredFiles?.ToList() ?? new List <string>();
            this.ignoredFiles.AddRange(new[]
            {
                @"^\.svn\\?.*$",
                @"(^\.git\\.*$)|(^\.git$)",
                @"^.*\\node_modules\\.*$",
                @"^.*\\bower_components\\.*$",
                @"^packages\\?.*$",
                @"^.*\.dll$",
                @"^.*\.pdb",
                @"^.*\.nupkg",
                @"^.*\.tar",
                @"^.*\.tgz",
                @"^.*\.jar",
                @"^.*\.exe",
            });

            this.retriever            = new UserRetriever(workerConfig);
            this.timeoutMaxRetryCount = workerConfig.TimeoutMaxRetryCount;
        }
示例#3
0
 public WorkerScheduler(IWorkerConfiguration configuration)
 {
     if (configuration == null)
     {
         throw new ArgumentNullException(nameof(configuration));
     }
     _configuration = configuration;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AbortWorkerThread" /> class.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 /// <param name="messageMode">The message mode.</param>
 public AbortWorkerThread(IWorkerConfiguration configuration, 
     MessageProcessingMode messageMode)
 {
     Guard.NotNull(() => configuration, configuration);
     Guard.NotNull(() => messageMode, messageMode);
    
     _configuration = configuration;
     _messageMode = messageMode;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="AbortWorkerThread" /> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="messageMode">The message mode.</param>
        public AbortWorkerThread(IWorkerConfiguration configuration,
                                 MessageProcessingMode messageMode)
        {
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => messageMode, messageMode);

            _configuration = configuration;
            _messageMode   = messageMode;
        }
示例#6
0
        public SyncClient(IWorkerConfiguration workerConfig)
            : base(workerConfig)
        {
            this.syncUri = new Uri(new Uri(workerConfig.ApiUrl), "/sync/");
            WebRequestHandler handler     = new WebRequestHandler();
            X509Certificate   certificate = base.ClientCertificateProvider.ClientCertificate;

            handler.ClientCertificates.Add(certificate);
            this.httpClient = new HttpClient(handler);
        }
示例#7
0
        public ApiHttpClientSyncQueue(IWorkerConfiguration workerConfig)
        {
            this.syncUri = new Uri(new Uri(workerConfig.ApiUrl), "/sync/");
            var clientCertificateProvider = new X509StoreCertificateProvider(X509FindType.FindBySubjectName, workerConfig.ClientCertificate, false, StoreName.My, StoreLocation.LocalMachine);
            WebRequestHandler handler     = new WebRequestHandler();
            X509Certificate   certificate = clientCertificateProvider.ClientCertificate;

            handler.ClientCertificates.Add(certificate);
            this.httpClient = new HttpClient(handler);
        }
示例#8
0
        public UserRetriever(IWorkerConfiguration workerConfig)
        {
            this.workerConfig = workerConfig;
            WebRequestHandler handler = new WebRequestHandler();
            var certProvider          = new X509StoreCertificateProvider(
                X509FindType.FindBySubjectName,
                workerConfig.ClientCertificate,
                false);
            var cert = certProvider.ClientCertificate;

            handler.ClientCertificates.Add(cert);
            this.httpClient = new HttpClient(handler);
        }
示例#9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AbortWorkerThreadDecorator" /> class.
        /// </summary>
        /// <param name="log">The log.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="messageMode">The message mode.</param>
        /// <param name="handler">The handler.</param>
        public AbortWorkerThreadDecorator(ILogFactory log,
                                          IWorkerConfiguration configuration,
                                          MessageProcessingMode messageMode,
                                          IAbortWorkerThread handler)
        {
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => handler, handler);
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => messageMode, messageMode);

            _log           = log.Create();
            _handler       = handler;
            _configuration = configuration;
            _messageMode   = messageMode;
        }
示例#10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StopWorker"/> class.
        /// </summary>
        /// <param name="cancelWorkSource">The cancel work source.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="log">The log.</param>
        /// <param name="waitForEventOrCancel">The wait for event or cancel.</param>
        public StopWorker(IQueueCancelWork cancelWorkSource,
                          IWorkerConfiguration configuration,
                          ILogFactory log,
                          IWorkerWaitForEventOrCancel waitForEventOrCancel)
        {
            Guard.NotNull(() => cancelWorkSource, cancelWorkSource);
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => waitForEventOrCancel, waitForEventOrCancel);

            _cancelWorkSource = cancelWorkSource;
            _configuration    = configuration;
            _log = log.Create();
            _waitForEventOrCancel = waitForEventOrCancel;
        }
示例#11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StopWorker"/> class.
        /// </summary>
        /// <param name="cancelWorkSource">The cancel work source.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="log">The log.</param>
        /// <param name="waitForEventOrCancel">The wait for event or cancel.</param>
        public StopWorker(IQueueCancelWork cancelWorkSource,
            IWorkerConfiguration configuration,
            ILogFactory log,
            IWorkerWaitForEventOrCancel waitForEventOrCancel)
        {
            Guard.NotNull(() => cancelWorkSource, cancelWorkSource);
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => waitForEventOrCancel, waitForEventOrCancel);

            _cancelWorkSource = cancelWorkSource;
            _configuration = configuration;
            _log = log.Create();
            _waitForEventOrCancel = waitForEventOrCancel;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="AbortWorkerThreadDecorator" /> class.
        /// </summary>
        /// <param name="log">The log.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="messageMode">The message mode.</param>
        /// <param name="handler">The handler.</param>
        public AbortWorkerThreadDecorator(ILogFactory log,
            IWorkerConfiguration configuration,
            MessageProcessingMode messageMode,
            IAbortWorkerThread handler)
        {
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => handler, handler);
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => messageMode, messageMode);

            _log = log.Create();
            _handler = handler;
            _configuration = configuration;
            _messageMode = messageMode;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueConsumerConfiguration" /> class.
        /// </summary>
        /// <param name="transportConfiguration">The transport configuration.</param>
        /// <param name="workerConfiguration">The worker configuration.</param>
        /// <param name="heartBeatConfiguration">The heart beat configuration.</param>
        /// <param name="messageExpirationConfiguration">The message expiration configuration.</param>
        /// <param name="headers">The headers.</param>
        /// <param name="additionalConfiguration">The additional configuration.</param>
        /// <param name="timeConfiguration">The time configuration.</param>
        public QueueConsumerConfiguration(TransportConfigurationReceive transportConfiguration,
                                          IWorkerConfiguration workerConfiguration,
                                          IHeartBeatConfiguration heartBeatConfiguration,
                                          IMessageExpirationConfiguration messageExpirationConfiguration,
                                          IHeaders headers,
                                          IConfiguration additionalConfiguration,
                                          BaseTimeConfiguration timeConfiguration)
            : base(transportConfiguration, headers, additionalConfiguration, timeConfiguration)
        {
            Guard.NotNull(() => workerConfiguration, workerConfiguration);
            Guard.NotNull(() => heartBeatConfiguration, heartBeatConfiguration);
            Guard.NotNull(() => messageExpirationConfiguration, messageExpirationConfiguration);

            Worker            = workerConfiguration;
            HeartBeat         = heartBeatConfiguration;
            MessageExpiration = messageExpirationConfiguration;
            Routes            = new List <string>();
        }
示例#14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorkerCollection"/> class.
        /// </summary>
        /// <param name="workerConfiguration">The worker configuration.</param>
        /// <param name="workerFactory">The worker factory.</param>
        /// <param name="stopWorker">The stop worker.</param>
        /// <param name="log">The log.</param>
        /// <param name="workerPause">The worker pause.</param>
        public WorkerCollection(IWorkerConfiguration workerConfiguration,
            IWorkerFactory workerFactory,
            StopWorker stopWorker,
            ILogFactory log,
            IWorkerWaitForEventOrCancel workerPause)
        {
            Guard.NotNull(() => workerConfiguration, workerConfiguration);
            Guard.NotNull(() => workerFactory, workerFactory);
            Guard.NotNull(() => stopWorker, stopWorker);
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => workerPause, workerPause);

            _workerConfiguration = workerConfiguration;
            _workerFactory = workerFactory;
            _stopWorker = stopWorker;
            _log = log.Create();
            _workerPause = workerPause;
        }
示例#15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorkerCollection"/> class.
        /// </summary>
        /// <param name="workerConfiguration">The worker configuration.</param>
        /// <param name="workerFactory">The worker factory.</param>
        /// <param name="stopWorker">The stop worker.</param>
        /// <param name="log">The log.</param>
        /// <param name="workerPause">The worker pause.</param>
        public WorkerCollection(IWorkerConfiguration workerConfiguration,
                                IWorkerFactory workerFactory,
                                StopWorker stopWorker,
                                ILogFactory log,
                                IWorkerWaitForEventOrCancel workerPause)
        {
            Guard.NotNull(() => workerConfiguration, workerConfiguration);
            Guard.NotNull(() => workerFactory, workerFactory);
            Guard.NotNull(() => stopWorker, stopWorker);
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => workerPause, workerPause);

            _workerConfiguration = workerConfiguration;
            _workerFactory       = workerFactory;
            _stopWorker          = stopWorker;
            _log         = log.Create();
            _workerPause = workerPause;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueConsumerConfiguration" /> class.
        /// </summary>
        /// <param name="transportConfiguration">The transport configuration.</param>
        /// <param name="workerConfiguration">The worker configuration.</param>
        /// <param name="heartBeatConfiguration">The heart beat configuration.</param>
        /// <param name="messageExpirationConfiguration">The message expiration configuration.</param>
        /// <param name="headers">The headers.</param>
        /// <param name="additionalConfiguration">The additional configuration.</param>
        /// <param name="timeConfiguration">The time configuration.</param>
        public QueueConsumerConfiguration(TransportConfigurationReceive transportConfiguration, 
            IWorkerConfiguration workerConfiguration, 
            IHeartBeatConfiguration heartBeatConfiguration, 
            IMessageExpirationConfiguration messageExpirationConfiguration, 
            IHeaders headers,
            IConfiguration additionalConfiguration,
            BaseTimeConfiguration timeConfiguration)
            : base(transportConfiguration, headers, additionalConfiguration, timeConfiguration)
        {
            Guard.NotNull(() => workerConfiguration, workerConfiguration);
            Guard.NotNull(() => heartBeatConfiguration, heartBeatConfiguration);
            Guard.NotNull(() => messageExpirationConfiguration, messageExpirationConfiguration);

            Worker = workerConfiguration;
            HeartBeat = heartBeatConfiguration;
            MessageExpiration = messageExpirationConfiguration;
            _routes = new List<string>();
        }
示例#17
0
 protected WorkerController(IWorkerConfiguration workerConfiguration, IWorkerScheduler workerScheduler)
 {
     WorkerConfiguration = workerConfiguration;
     WorkerScheduler     = workerScheduler;
 }
示例#18
0
 protected WorkerController(IWorkerConfiguration workerConfiguration, IWorkerScheduler workerScheduler)
 {
     WorkerConfiguration = workerConfiguration;
     WorkerScheduler = workerScheduler;
 }
示例#19
0
 public WorkerStartController(IWorkerConfiguration workerConfiguration, IWorkerScheduler workerScheduler) : base(workerConfiguration, workerScheduler)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WorkerWaitForEventOrCancel"/> class.
 /// </summary>
 /// <param name="waitForEventOrCancel">The wait for event or cancel.</param>
 /// <param name="workerConfiguration">The worker configuration.</param>
 public WorkerWaitForEventOrCancel(IWaitForEventOrCancelWorker waitForEventOrCancel,
                                   IWorkerConfiguration workerConfiguration)
 {
     _waitForEventOrCancel = waitForEventOrCancel;
     _workerConfiguration  = workerConfiguration;
 }
 public BlackMirrorHttpClient(IWorkerConfiguration workerConfig)
 {
     this.Reflection = new ReflectionClient(workerConfig);
     this.Mirror     = new MirrorClient(workerConfig);
 }
示例#22
0
 protected HttpClientBase(IWorkerConfiguration workerConfig)
 {
     this.WorkerConfig = workerConfig;
     this.ClientCertificateProvider = new X509StoreCertificateProvider(X509FindType.FindBySubjectName, workerConfig.ClientCertificate, false, StoreName.My, StoreLocation.LocalMachine);
 }
示例#23
0
 public WorkerScheduler(IWorkerConfiguration configuration)
 {
     if (configuration == null)
         throw new ArgumentNullException(nameof(configuration));
     _configuration = configuration;
 }
 public WorkerRegistrationController(IWorkerConfiguration workerConfiguration, IWorkerScheduler workerScheduler) : base(workerConfiguration, workerScheduler)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WorkerWaitForEventOrCancel"/> class.
 /// </summary>
 /// <param name="waitForEventOrCancel">The wait for event or cancel.</param>
 /// <param name="workerConfiguration">The worker configuration.</param>
 public WorkerWaitForEventOrCancel(IWaitForEventOrCancelWorker waitForEventOrCancel,
     IWorkerConfiguration workerConfiguration)
 {
     _waitForEventOrCancel = waitForEventOrCancel;
     _workerConfiguration = workerConfiguration;
 }
示例#26
0
 public ServiceApp(IWorkerConfiguration workerConfig)
 {
     this.workerConfig = workerConfig;
 }
 public WorkerRegistrationController(IWorkerConfiguration workerConfiguration, IWorkerScheduler workerScheduler) : base(workerConfiguration, workerScheduler)
 {
 }
示例#28
0
 public ApiHttpSyncLogger(IWorkerConfiguration workerConfig)
 {
     this.httpClient = new SyncClient(workerConfig);
 }
示例#29
0
 public SyncHandler(IWorkerConfiguration workerConfig, IBlackMirrorHttpClient httpClient, ISyncLogger syncLogger)
 {
     this.workerConfig = workerConfig;
     this.httpClient   = httpClient;
     this.syncLogger   = syncLogger;
 }