コード例 #1
0
        public WindowsUpdateServiceCoordinator(IConfigStore configStore, string configSection, KeyValueStoreReplica kvsReplica, IStatefulServicePartition partition, IExceptionHandlingPolicy exceptionPolicy)
        {
            configStore.ThrowIfNull("configStore");
            configSection.ThrowIfNullOrWhiteSpace("configSectionName");
            kvsReplica.ThrowIfNull("kvsReplica");
            partition.ThrowIfNull("partition");
            exceptionPolicy.ThrowIfNull("exceptionPolicy");

            this.commandProcessor  = new FabricClientWrapper();
            this.store             = kvsReplica;
            this.partition         = partition;
            this.packageRetriever  = new UpdatePackageRetriever();
            this.serviceName       = new Uri(Constants.SystemServicePrefix + configSection);
            this.configStore       = configStore;
            this.configSectionName = configSection;
            this.exceptionPolicy   = exceptionPolicy;

            // Read all the configuration values
            string coordinatorType = configStore.ReadUnencryptedString(configSection, Constants.ConfigurationSection.CoordinatorType);

            this.testMode   = false;
            this.testSrcDir = string.Empty;
            if (coordinatorType.Equals(Constants.ConfigurationSection.WUTestCoordinator))
            {
                this.testSrcDir = configStore.ReadUnencryptedString(configSection, Constants.WUSCoordinator.TestCabFolderParam);
                this.testMode   = true;
            }

            this.waitTimeBeforePolling   = TimeSpan.FromMinutes(Constants.WUSCoordinator.PollingIntervalInMinutesDefault);
            this.windowsUpdateApiTimeout = TimeSpan.FromMinutes(Constants.WUSCoordinator.WuApiTimeoutInMinutesDefault);
        }
コード例 #2
0
        public StreamChannelCoordinator(
            WrpStreamChannel streamChannel,
            IExceptionHandlingPolicy policy)
        {
            streamChannel.ThrowIfNull(nameof(streamChannel));
            policy.ThrowIfNull(nameof(policy));

            this.streamChannel   = streamChannel;
            this.exceptionPolicy = policy;
        }
コード例 #3
0
        internal ResourceCoordinator(
            KeyValueStoreReplica kvsStore,
            IConfigStore configStore,
            string configSectionName,
            IDictionary <ResourceType, IResourceCommandProcessor> resourceCommandProcessors,
            IWrpPackageRetriever packageRetriever,
            IExceptionHandlingPolicy healthPolicy)
        {
            kvsStore.ThrowIfNull(nameof(kvsStore));
            configStore.ThrowIfNull(nameof(configStore));
            configSectionName.ThrowIfNullOrWhiteSpace(nameof(configSectionName));
            resourceCommandProcessors.ThrowIfNull(nameof(resourceCommandProcessors));
            packageRetriever.ThrowIfNull(nameof(packageRetriever));
            healthPolicy.ThrowIfNull(nameof(healthPolicy));

            this.kvsStore          = kvsStore;
            this.configStore       = configStore;
            this.configSectionName = configSectionName;
            this.commandProcessors = resourceCommandProcessors;
            this.packageRetriever  = packageRetriever;
            this.exceptionPolicy   = healthPolicy;
        }