示例#1
0
        public OutageLifecycleService(StatefulServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, 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);
            }
            catch (Exception e)
            {
                string errorMessage = $"{baseLogString} Ctor => Exception caught: {e.Message}.";
                Logger.LogError(errorMessage, e);
            }
        }
        public GdaService(StatelessServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            try
            {
                //LOGIC
                _ = Config.GetInstance(this.Context);

                string debugMessage = $"{baseLogString} Ctor => Configuration initialized.";
                Logger.LogDebug(debugMessage);

                //LOGIC
                this.networkModel = new NetworkModel();

                string infoMessage = $"{baseLogString} Ctor => NetworkModel created.";
                Logger.LogInformation(infoMessage);

                //LOGIC
                this.genericDataAccess   = new GenericDataAccess(networkModel);
                this.nmsTransactionActor = new NmsTransactionActor(networkModel);

                infoMessage = $"{baseLogString} Ctor => Contract providers initialized.";
                Logger.LogInformation(infoMessage);
            }
            catch (Exception e)
            {
                string errMessage = $"{baseLogString} Ctor => Exception caught: {e.Message}.";
                Logger.LogError(errMessage, e);
            }
        }
示例#3
0
        public HistoryDBManagerService(StatefulServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            try
            {
                this.historyDBManagerProvider         = new HistoryDBManager(this.StateManager);
                this.reportServiceProvider            = new ReportService();
                this.outageModelAccessProvider        = new OutageModelAccess();
                this.consumerAccessProvider           = new ConsumerAccess();
                this.equipmentAccessProvider          = new EquipmentAccess();
                this.notifyNetworkModelUpdateProvider = new OmsHistoryNotifyNetworkModelUpdate(this.StateManager);
                this.transactionActorProvider         = new OmsHistoryTransactionActor(this.StateManager);
                this.historySubscriber = new HistorySubscriber(this.StateManager, this.historyDBManagerProvider);


                string infoMessage = $"{baseLogString} Ctor => Contract providers initialized.";
                Logger.LogInformation(infoMessage);
            }
            catch (Exception e)
            {
                string errorMessage = $"{baseLogString} Ctor => Exception caught: {e.Message}.";
                Logger.LogError(errorMessage, e);
            }
        }
示例#4
0
        public ModelProviderService(StatefulServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            try
            {
                //DONE THIS WAY (in this order) BECAUSE: there is a mechanism that tracks the initialization process of reliable collections, which is set in constructors of these classes
                var modelResourceDesc = new ModelResourcesDesc();
                var enumDescs         = new EnumDescs();

                this.modelReadAccessProvider        = new ModelReadAccessProvider(this.StateManager);
                this.modelUpdateAccessProvider      = new ModelUpdateAccessProvider(this.StateManager);
                this.integrityUpdateProvider        = new IntegrityUpdateProvider(this.StateManager);
                this.scadaNotifyNetworkModelUpdate  = new ScadaNotifyNetworkModelUpdate(this.StateManager);
                this.scadaTransactionActorProviders = new ScadaTransactionActor(this.StateManager, modelResourceDesc, enumDescs);

                string infoMessage = $"{baseLogString} Ctor => Contract providers initialized.";
                Logger.LogInformation(infoMessage);
            }
            catch (Exception e)
            {
                string errorMessage = $"{baseLogString} Ctor => Exception caught: {e.Message}.";
                Logger.LogError(errorMessage, e);
            }
        }
        public WebAPI(StatelessServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");
        }
 public NMSGdaService(StatefulServiceContext context)
     : base(context)
 {
     this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);
     Logger.LogInformation("GdaService Constructor started.");
     this.networkModel      = new NetworkModel(this.StateManager);
     this.genericDataAccess = new GenericDataAccess(networkModel);
     Logger.LogInformation("GdaService finished");
 }
示例#7
0
        public EmailService(StatelessServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            string verboseMessage = $"{baseLogString} entering Ctor.";

            Logger.LogVerbose(verboseMessage);
        }
示例#8
0
        public CommandingService(StatelessServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            this.commandingProvider = new CommandingProvider();

            string infoMessage = $"{baseLogString} Ctor => Contract providers initialized.";

            Logger.LogInformation(infoMessage);
        }
        public LoadFlowSolver(StatefulServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            DSSObject = new DSS();

            if (!(DSSObject.Start(0)))
            {
                Logger.LogError("DSS failed to start.");
                return;
            }
            else
            {
                Logger.LogInformation($"DSS successfully started for partition {Context.PartitionId}.");
            }

            DSSCircuit  = DSSObject.ActiveCircuit;
            DSSSolution = DSSCircuit.Solution;
        }
        public LoadFlowService(StatelessServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            try
            {
                this.loadFlowEngine = new LoadFlow();

                string infoMessage = $"{baseLogString} Ctor => Contract providers initialized.";
                Logger.LogInformation(infoMessage);
            }
            catch (Exception e)
            {
                string errorMessage = $"{baseLogString} Ctor => exception {e.Message}";
                Logger.LogError(errorMessage, e);
            }
        }
        public CallTrackingService(StatefulServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            try
            {
                callTracker = new CallTracker(this.StateManager, MicroserviceNames.OmsCallTrackingService);

                string infoMessage = $"{baseLogString} Ctor => Contract providers initialized.";
                Logger.LogInformation(infoMessage);
            }
            catch (Exception e)
            {
                string errorMessage = $"{baseLogString} Ctor => Exception caught: {e.Message}.";
                Logger.LogError(errorMessage, e);
            }
        }
        public PubSubService(StatefulServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            try
            {
                this.publisherProvider          = new PublisherProvider(this.StateManager);
                this.registerSubscriberProvider = new RegisterSubscriberProvider(this.StateManager);

                string infoMessage = $"{baseLogString} Ctor => Contract providers initialized.";
                Logger.LogInformation(infoMessage);
            }
            catch (Exception e)
            {
                string errMessage = $"{baseLogString} Ctor => Exception caught: {e.Message}.";
                Logger.LogError(errMessage, e);
            }
        }
        public OutageSimulatorService(StatefulServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            try
            {
                this.controlCycle = new SimulationControlCycle(StateManager, commandedValueIntervalUpperLimit);

                this.outageSimulatorProvider   = new OutageSimulatorProvider(StateManager);
                this.outageSimulatorUIProvider = new OutageSimulatorUIProvider(StateManager);
                this.notifySubscriberProvider  = new NotifySubscriberProvider(StateManager, MicroserviceNames.OmsOutageSimulatorService);
            }
            catch (Exception e)
            {
                string errorMessage = $"{baseLogString} Ctor => Exception caught: {e.Message}.";
                Logger.LogError(errorMessage, e);
            }
        }
        public WebAdapterService(StatelessServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            try
            {
                this.webAdapterProvider       = new WebAdapterProvider();
                this.notifySubscriberProvider = new NotifySubscriberProvider(MicroserviceNames.WebAdapterService);

                this.registerSubscriberClient = RegisterSubscriberClient.CreateClient();
            }
            catch (Exception e)
            {
                string errorMessage = $"{baseLogString} Ctor => exception {e.Message}";
                Logger.LogError(errorMessage, e);
                ServiceEventSource.Current.ServiceMessage(this.Context, $"[WebAdapterService | Error] {errorMessage}");
            }
        }
示例#15
0
        public TransactionManagerService(StatefulServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            try
            {
                //DONE THIS WAY (in this order) BECAUSE: there is a mechanism that tracks the initialization process of reliable collections, which is set in constructors of these classes
                this.transactionCoordinatorProvider = new TransactionCoordinatorProvider(this.StateManager);
                this.transactionEnlistmentProvider  = new TransactionEnlistmentProvider(this.StateManager);

                string infoMessage = $"{baseLogString} Ctor => Contract providers initialized.";
                Logger.LogInformation(infoMessage);
            }
            catch (Exception e)
            {
                string errorMessage = $"{baseLogString} Ctor => Exception caught: {e.Message}.";
                Logger.LogError(errorMessage, e);
            }
        }
示例#16
0
        public FunctionExecutorService(StatefulServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            try
            {
                this.functionExecutorCycle      = new FunctionExecutorCycle(StateManager);
                this.readCommandEnqueuer        = new ReadCommandEnqueuer(StateManager);
                this.writeCommandEnqueuer       = new WriteCommandEnqueuer(StateManager);
                this.modelUpdateCommandEnqueuer = new ModelUpdateCommandEnqueuer(StateManager);

                string infoMessage = $"{baseLogString} Ctor => Contract providers initialized.";
                Logger.LogInformation(infoMessage);
            }
            catch (Exception e)
            {
                string errorMessage = $"{baseLogString} Ctor => exception {e.Message}";
                Logger.LogError(errorMessage, e);
            }
        }
        public ModelProviderService(StatefulServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            try
            {
                var modelManager = new ModelManager(this.StateManager);
                this.modelProvider              = new ModelProvider(this.StateManager, modelManager);
                this.ceTransactionActor         = new CeTransactionActor();
                this.ceNetworkNotifyModelUpdate = new CeNetworkNotifyModelUpdate();

                string infoMessage = $"{baseLogString} Ctor => Contract providers initialized.";
                Logger.LogInformation(infoMessage);
            }
            catch (Exception e)
            {
                string errorMessage = $"{baseLogString} Ctor => Exception caught: {e.Message}.";
                Logger.LogError(errorMessage, e);
            }
        }
示例#18
0
        public MeasurementProviderService(StatefulServiceContext context)
            : base(context)
        {
            this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);

            this.baseLogString = $"{this.GetType()} [{this.GetHashCode()}] =>{Environment.NewLine}";
            Logger.LogDebug($"{baseLogString} Ctor => Logger initialized");

            try
            {
                this.measurementProvider    = new MeasurementProvider(this.StateManager);
                this.measurementMap         = new MeasurementMap();
                this.switchStatusCommanding = new SwitchStatusCommanding();
                this.scadaSubscriber        = new ScadaSubscriber();

                string infoMessage = $"{baseLogString} Ctor => Contract providers initialized.";
                Logger.LogInformation(infoMessage);
            }
            catch (Exception e)
            {
                string errorMessage = $"{baseLogString} Ctor => Exception caught: {e.Message}.";
                Logger.LogError(errorMessage, e);
            }
        }
示例#19
0
 public TopologyAnalyzerService(StatefulServiceContext context)
     : base(context)
 {
     this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);
 }
 public ModelManagerService(StatefulServiceContext context)
     : base(context)
 {
     this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);
 }
示例#21
0
 public LoadFlowManagerService(StatelessServiceContext context)
     : base(context)
 {
     this.logger = CloudLoggerFactory.GetLogger(ServiceEventSource.Current, context);
 }