Ejemplo n.º 1
0
        public HttpStatusCodeCheckResultProvider(IAgentControlDefinitionProvider agentControlDefinitionProvider, IHttpStatusCodeFetcher httpStatusCodeFetcher)
        {
            if (agentControlDefinitionProvider == null)
            {
                throw new ArgumentNullException("agentControlDefinitionProvider");
            }

            if (httpStatusCodeFetcher == null)
            {
                throw new ArgumentNullException("httpStatusCodeFetcher");
            }

            this.agentControlDefinitionProvider = agentControlDefinitionProvider;
            this.httpStatusCodeFetcher          = httpStatusCodeFetcher;

            // get initial check interval
            var agentControlDefinition = this.agentControlDefinitionProvider.GetControlDefinition();
            int checkIntervalInSeconds = DefaultCheckIntervalInSeconds;

            if (agentControlDefinition != null && agentControlDefinition.HttpStatusCodeCheck != null && agentControlDefinition.HttpStatusCodeCheck.CheckIntervalInSeconds > 0)
            {
                checkIntervalInSeconds = agentControlDefinition.HttpStatusCodeCheck.CheckIntervalInSeconds;
            }

            var timerStartTime = new TimeSpan(0, 0, 0);
            var timerInterval  = new TimeSpan(0, 0, 0, checkIntervalInSeconds);

            this.timer = new Timer(state => this.UpdateHttpStatusCodeResult(), null, timerStartTime, timerInterval);
        }
        public HttpStatusCodeCheckResultProvider(IAgentControlDefinitionProvider agentControlDefinitionProvider, IHttpStatusCodeFetcher httpStatusCodeFetcher)
        {
            if (agentControlDefinitionProvider == null)
            {
                throw new ArgumentNullException("agentControlDefinitionProvider");
            }

            if (httpStatusCodeFetcher == null)
            {
                throw new ArgumentNullException("httpStatusCodeFetcher");
            }

            this.agentControlDefinitionProvider = agentControlDefinitionProvider;
            this.httpStatusCodeFetcher = httpStatusCodeFetcher;

            // get initial check interval
            var agentControlDefinition = this.agentControlDefinitionProvider.GetControlDefinition();
            int checkIntervalInSeconds = DefaultCheckIntervalInSeconds;
            if (agentControlDefinition != null && agentControlDefinition.HttpStatusCodeCheck != null && agentControlDefinition.HttpStatusCodeCheck.CheckIntervalInSeconds > 0)
            {
                checkIntervalInSeconds = agentControlDefinition.HttpStatusCodeCheck.CheckIntervalInSeconds;
            }

            var timerStartTime = new TimeSpan(0, 0, 0);
            var timerInterval = new TimeSpan(0, 0, 0, checkIntervalInSeconds);
            this.timer = new Timer(state => this.UpdateHttpStatusCodeResult(), null, timerStartTime, timerInterval);
        }
Ejemplo n.º 3
0
        public RESTBasedSystemInformationSenderConfigurationProvider(IAgentControlDefinitionProvider agentControlDefinitionProvider)
        {
            if (agentControlDefinitionProvider == null)
            {
                throw new ArgumentNullException("agentControlDefinitionProvider");
            }

            this.agentControlDefinitionProvider = agentControlDefinitionProvider;
        }
        public AgentCoordinationServiceFactory(IAgentControlDefinitionProvider agentControlDefinitionProvider)
        {
            if (agentControlDefinitionProvider == null)
            {
                throw new ArgumentNullException("agentControlDefinitionProvider");
            }

            this.agentControlDefinitionProvider = agentControlDefinitionProvider;
        }
        public RESTBasedSystemInformationSenderConfigurationProvider(IAgentControlDefinitionProvider agentControlDefinitionProvider)
        {
            if (agentControlDefinitionProvider == null)
            {
                throw new ArgumentNullException("agentControlDefinitionProvider");
            }

            this.agentControlDefinitionProvider = agentControlDefinitionProvider;
        }
        public AgentCoordinationServiceFactory(IAgentControlDefinitionProvider agentControlDefinitionProvider)
        {
            if (agentControlDefinitionProvider == null)
            {
                throw new ArgumentNullException("agentControlDefinitionProvider");
            }

            this.agentControlDefinitionProvider = agentControlDefinitionProvider;
        }
        public SystemPerformanceDataProvider(IAgentControlDefinitionProvider agentControlDefinitionProvider, IProcessorStatusProvider processorStatusProvider, ISystemMemoryStatusProvider systemMemoryStatusProvider, ISystemStorageStatusProvider systemStorageStatusProvider)
        {
            if (agentControlDefinitionProvider == null)
            {
                throw new ArgumentNullException("agentControlDefinitionProvider");
            }

            if (processorStatusProvider == null)
            {
                throw new ArgumentNullException("processorStatusProvider");
            }

            if (systemMemoryStatusProvider == null)
            {
                throw new ArgumentNullException("systemMemoryStatusProvider");
            }

            if (systemStorageStatusProvider == null)
            {
                throw new ArgumentNullException("systemStorageStatusProvider");
            }

            this.agentControlDefinitionProvider = agentControlDefinitionProvider;
            this.processorStatusProvider        = processorStatusProvider;
            this.systemMemoryStatusProvider     = systemMemoryStatusProvider;
            this.systemStorageStatusProvider    = systemStorageStatusProvider;

            // get initial check interval
            var agentControlDefinition = this.agentControlDefinitionProvider.GetControlDefinition();
            int checkIntervalInSeconds = DefaultCheckIntervalInSeconds;

            if (agentControlDefinition != null && agentControlDefinition.HttpStatusCodeCheck != null && agentControlDefinition.HttpStatusCodeCheck.CheckIntervalInSeconds > 0)
            {
                checkIntervalInSeconds = agentControlDefinition.HttpStatusCodeCheck.CheckIntervalInSeconds;
            }

            var timerStartTime = new TimeSpan(0, 0, 0);
            var timerInterval  = new TimeSpan(0, 0, 0, checkIntervalInSeconds);

            this.timer = new Timer(state => this.UpdateSystemPerformanceData(), null, timerStartTime, timerInterval);
        }
        public AgentCoordinationService(IAgentControlDefinitionProvider agentControlDefinitionProvider, Action pauseCallback, Action resumeCallback)
        {
            if (agentControlDefinitionProvider == null)
            {
                throw new ArgumentNullException("agentControlDefinitionProvider");
            }

            if (pauseCallback == null)
            {
                throw new ArgumentNullException("pauseCallback");
            }

            if (resumeCallback == null)
            {
                throw new ArgumentNullException("resumeCallback");
            }

            this.agentControlDefinitionProvider = agentControlDefinitionProvider;
            this.pauseCallback = pauseCallback;
            this.resumeCallback = resumeCallback;
        }
        public AgentCoordinationService(IAgentControlDefinitionProvider agentControlDefinitionProvider, Action pauseCallback, Action resumeCallback)
        {
            if (agentControlDefinitionProvider == null)
            {
                throw new ArgumentNullException("agentControlDefinitionProvider");
            }

            if (pauseCallback == null)
            {
                throw new ArgumentNullException("pauseCallback");
            }

            if (resumeCallback == null)
            {
                throw new ArgumentNullException("resumeCallback");
            }

            this.agentControlDefinitionProvider = agentControlDefinitionProvider;
            this.pauseCallback  = pauseCallback;
            this.resumeCallback = resumeCallback;
        }
        public SystemPerformanceDataProvider(IAgentControlDefinitionProvider agentControlDefinitionProvider, IProcessorStatusProvider processorStatusProvider, ISystemMemoryStatusProvider systemMemoryStatusProvider, ISystemStorageStatusProvider systemStorageStatusProvider)
        {
            if (agentControlDefinitionProvider == null)
            {
                throw new ArgumentNullException("agentControlDefinitionProvider");
            }

            if (processorStatusProvider == null)
            {
                throw new ArgumentNullException("processorStatusProvider");
            }

            if (systemMemoryStatusProvider == null)
            {
                throw new ArgumentNullException("systemMemoryStatusProvider");
            }

            if (systemStorageStatusProvider == null)
            {
                throw new ArgumentNullException("systemStorageStatusProvider");
            }

            this.agentControlDefinitionProvider = agentControlDefinitionProvider;
            this.processorStatusProvider = processorStatusProvider;
            this.systemMemoryStatusProvider = systemMemoryStatusProvider;
            this.systemStorageStatusProvider = systemStorageStatusProvider;

            // get initial check interval
            var agentControlDefinition = this.agentControlDefinitionProvider.GetControlDefinition();
            int checkIntervalInSeconds = DefaultCheckIntervalInSeconds;
            if (agentControlDefinition != null && agentControlDefinition.HttpStatusCodeCheck != null && agentControlDefinition.HttpStatusCodeCheck.CheckIntervalInSeconds > 0)
            {
                checkIntervalInSeconds = agentControlDefinition.HttpStatusCodeCheck.CheckIntervalInSeconds;
            }

            var timerStartTime = new TimeSpan(0, 0, 0);
            var timerInterval = new TimeSpan(0, 0, 0, checkIntervalInSeconds);
            this.timer = new Timer(state => this.UpdateSystemPerformanceData(), null, timerStartTime, timerInterval);
        }