Ejemplo n.º 1
0
        /// <summary>
        /// The main entry point for the application. Starts a type of service
        /// </summary>
        static void Main(string[] args)
        {
            AbstractService svc = null;

            try
            {
                logging.Log.LOG("Starting orchestrator...");
                svc = new OrchestratorService(); // TODO  refactor further to detect additional extractor service types at runtime
                logging.Log.LOG("Starting orchestrator...");
                svc.execute();
            }
            catch (Exception exc)
            {
                logging.Log.LOG("Error when starting: " + exc.Message);
            }
            finally
            {
                logging.Log.LOG("Reached 'finally' block...");
                if (svc != null && ((OrchestratorService)svc).Report != null)
                {
                    try
                    {
                        logging.Log.LOG("Have a report!\r\n\r\n" + ((OrchestratorService)svc).Report.ToString());
                        new FileDao().saveToFile(((OrchestratorService)svc).Report.ToString(), "C:\\Downstream\\OrchestratorReport.txt");
                    }
                    catch (Exception exc)
                    {
                        System.Console.WriteLine(exc.ToString());
                    }
                }
                else
                {
                    logging.Log.LOG("No report!...");
                }
            }
            //try
            //{
            //    if (args != null && args.Length > 0)
            //    {
            //        svc = new ServiceFactory().getService(args[0]);
            //    }
            //    else
            //    {
            //        svc = new ServiceFactory().getService(ConfigurationManager.AppSettings["ServiceType"]);
            //    }

            //    if (svc is OrchestratorService)
            //    {
            //        svc.run();
            //        saveReport(((OrchestratorService)svc).Report);
            //    }
            //    else if (svc is VistaService)
            //    {
            //        DayOfWeek startDay = DateTime.Now.DayOfWeek;
            //        // if day of week has changed, return to launcher which should check for latest software version
            //        while (serverHasWork() && DateTime.Now.DayOfWeek == startDay)
            //        {
            //            svc.run();
            //            saveReportText(((VistaService)svc).Report);
            //        }
            //    }

            //}
            //catch (Exception exc)
            //{
            //    if (svc != null && svc is OrchestratorService)
            //    {
            //        ((OrchestratorService)svc).Report.addException(exc);
            //        ((OrchestratorService)svc).Report.EndTimestamp = DateTime.Now;
            //        saveReport(((OrchestratorService)svc).Report); // save the report if orchestrator errors for unknown reason
            //    }
            //    if (svc != null && svc is VistaService)
            //    {
            //        saveReportText(((VistaService)svc).Report);
            //    }
            //}

            //return;
        }
Ejemplo n.º 2
0
 public OrchestratorController(OrchestratorService orchestratorService)
 {
     OrchestratorService = orchestratorService;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Class constructor
 /// </summary>
 public GrpcOrchestratorServer(LoggingContext loggingContext, OrchestratorService orchestratorService, DistributedBuildId buildId) : this(loggingContext, (IOrchestratorService)orchestratorService, buildId)
 {
 }
Ejemplo n.º 4
0
 public static Task <IActionResult> InvokeAndReturnActionResultAsync <TData>(this OrchestratorService orchestrator, ICommand <TData> command, HttpRequest httpRequest)
     where TData : class, new()
 => InvokeAndReturnActionResultAsync(orchestrator, command, new HttpMethod(httpRequest?.Method ?? throw new ArgumentNullException(nameof(httpRequest))));
Ejemplo n.º 5
0
 /// <summary>
 /// Class constructor
 /// </summary>
 public GrpcOrchestratorServer(LoggingContext loggingContext, OrchestratorService orchestratorService, string buildId)
 {
     m_loggingContext      = loggingContext;
     m_orchestratorService = orchestratorService;
     m_buildId             = buildId;
 }