Example #1
0
        public PotentialOutageReportingProvider(IReliableStateManager stateManager, OutageLifecycleHelper outageLifecycleHelper)
        {
            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";

            this.outageMessageMapper = new OutageMessageMapper();
            this.lifecycleHelper     = outageLifecycleHelper;

            this.ignorableCommandOriginTypes = new HashSet <CommandOriginType>()
            {
                CommandOriginType.USER_COMMAND,
                CommandOriginType.ISOLATING_ALGORITHM_COMMAND,
                CommandOriginType.LOCATION_AND_ISOLATING_ALGORITHM_COMMAND,
                CommandOriginType.UNKNOWN_ORIGIN,
            };

            this.isStartedIsolationAlgorithmsInitialized = false;
            this.isRecloserOutageMapInitialized          = false;
            this.isOutageTopologyModelInitialized        = false;
            this.isPotentialOutagesQueueInitialized      = false;
            this.isCommandedElementsInitialized          = false;
            this.isOptimumIsolationPointsInitialized     = false;
            this.isElementsToBeIgnoredInReportPotentialOutageInitialized = false;

            this.stateManager = stateManager;
            this.stateManager.StateManagerChanged += this.OnStateManagerChangedHandler;
        }
Example #2
0
        public OutageLifecycleService(StatefulServiceContext context)
            : base(context)
        {
            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            try
            {
                var modelResourcesDesc = new ModelResourcesDesc();
                var lifecycleHelper    = new OutageLifecycleHelper(modelResourcesDesc);

                this.potentialOutageReportingProvider = new PotentialOutageReportingProvider(StateManager, lifecycleHelper);
                this.outageIsolationProvider          = new OutageIsolationProvider(StateManager, lifecycleHelper, modelResourcesDesc);
                this.crewSendingProvider      = new CrewSendingProvider(StateManager, lifecycleHelper);
                this.outageResolutionProvider = new OutageResolutionProvider(StateManager, lifecycleHelper);
                this.notifySubscriberProvider = new NotifySubscriberProvider(StateManager);

                this.isolationAlgorithmCycle = new IsolationAlgorithmCycle(StateManager, lifecycleHelper, isolationAlgorithmCycleInterval, isolationAlgorithmUpperLimit);

                string infoMessage = $"{baseLogString} Ctor => Contract providers initialized.";
                Logger.LogInformation(infoMessage);
                ServiceEventSource.Current.ServiceMessage(this.Context, $"[OMS.OutageLifecycleService | Information] {infoMessage}");
            }
            catch (Exception e)
            {
                string errorMessage = $"{baseLogString} Ctor => Exception caught: {e.Message}.";
                Logger.LogError(errorMessage, e);
                ServiceEventSource.Current.ServiceMessage(this.Context, $"[OMS.OutageLifecycleService | Error] {errorMessage}");
            }
        }
        public OutageResolutionProvider(IReliableStateManager stateManager, OutageLifecycleHelper lifecycleHelper)
        {
            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";

            this.lifecycleHelper     = lifecycleHelper;
            this.outageMessageMapper = new OutageMessageMapper();

            this.isOutageTopologyModelInitialized = false;

            this.stateManager = stateManager;
            this.stateManager.StateManagerChanged += this.OnStateManagerChangedHandler;
        }
        public OutageIsolationProvider(IReliableStateManager stateManager, OutageLifecycleHelper lifecycleHelper, ModelResourcesDesc modelResourcesDesc)
        {
            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";

            this.lifecycleHelper     = lifecycleHelper;
            this.modelResourcesDesc  = modelResourcesDesc;
            this.outageMessageMapper = new OutageMessageMapper();

            this.isMonitoredHeadBreakerMeasurementsInitialized = false;
            this.isStartedIsolationAlgorithmsInitialized       = false;

            this.stateManager = stateManager;
            this.stateManager.StateManagerChanged += this.OnStateManagerChangedHandler;
        }
        public CrewSendingProvider(IReliableStateManager stateManager, OutageLifecycleHelper lifecycleHelper)
        {
            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";

            this.lifecycleHelper     = lifecycleHelper;
            this.outageMessageMapper = new OutageMessageMapper();

            this.isOutageTopologyModelInitialized = false;
            this.isCommandedElementsInitialized   = false;
            this.isElementsToBeIgnoredInReportPotentialOutageInitialized = false;

            this.stateManager = stateManager;
            this.stateManager.StateManagerChanged += this.OnStateManagerChangedHandler;
        }
        public IsolationAlgorithmCycle(IReliableStateManager stateManager, OutageLifecycleHelper lifecycleHelper, int cycleInterval, int cycleUpperLimit)
        {
            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";

            this.lifecycleHelper     = lifecycleHelper;
            this.outageMessageMapper = new OutageMessageMapper();
            this.cycleInterval       = cycleInterval;
            this.cycleUpperLimit     = cycleUpperLimit;

            this.isStartedIsolationAlgorithmsInitialized       = false;
            this.isMonitoredHeadBreakerMeasurementsInitialized = false;
            this.isOutageTopologyModelInitialized    = false;
            this.isOptimumIsolationPointsInitialized = false;
            this.isCommandedElementsInitialized      = false;

            this.stateManager = stateManager;
            this.stateManager.StateManagerChanged += this.OnStateManagerChangedHandler;
        }