public EventBroadcaster(Channel <KubeEvent> channel, IKubernetes client, IControllerConfiguration configuration, ILogger <EventBroadcaster> logger)
 {
     _channel       = channel ?? throw new ArgumentNullException(nameof(channel));
     _client        = client ?? throw new ArgumentNullException(nameof(client));
     _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _logger        = logger ?? throw new ArgumentNullException(nameof(logger));
 }
示例#2
0
 public StatusReporterService(IKubeResourceStore store, IKubernetes client, IControllerConfiguration configuration, ILogger <StatusReporterService> logger)
 {
     _store         = store ?? throw new ArgumentNullException(nameof(store));
     _client        = client ?? throw new ArgumentNullException(nameof(client));
     _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _logger        = logger ?? throw new ArgumentNullException(nameof(logger));
 }
示例#3
0
        public void Configuration(IAppBuilder builder)
        {
            builder.WhenServiceResolverReady(x =>
            {
                var controllerService = x.Resolve <IJewelExplorerControllerService>();
                IControllerConfiguration standardConfiguration = controllerService.StandardConfiguration;
                standardConfiguration.RegisterController <ICustomDomainObjectContainer, CustomDomainObjectController>();

                Assembly assembly = GetType().Assembly;
                var imageService  = x.Resolve <IImageService>();
                imageService.Register(new CustomObjectIcons());
                imageService.Add(@"CustomObjectContainer", ResourceManager.GetImage(assembly, @"CustomDomainObjectContainer.png"));
                imageService.Add(@"CustomObject", ResourceManager.GetImage(assembly, @"CustomDomainObject.png"));
            });
        }
示例#4
0
        protected override void OnStart(string[] args)
        {
            try
            {
                //Instantiate the configuration implementation to be used
                _configuration = ConfigurationFile.Load();

                //Instantiate the repository implementation to be used
                _repository = MsSqlRepository.Load("MsSql"); //TODO: Implement dependency injection

                //Instantiate and start the controller
                _controller = new UsageSyncController();
                _controller.Start(_configuration, _repository);
            }
            catch (Exception ex)
            {
                _log.Fatal("Error starting service.", ex);
            }
        }
        protected override void OnStart(string[] args)
        {
            try
              {
            //Instantiate the configuration implementation to be used
            _configuration = ConfigurationFile.Load();

            //Instantiate the repository implementation to be used
            _repository = MsSqlRepository.Load("MsSql");

            //Instantiate and start the controller
            _controller = new LibrarySyncController<ImageFileRepository>();
            _controller.Start(_configuration, _repository);
              }
              catch (Exception ex)
              {
            _log.Fatal("Error starting service.", ex);
              }
        }
        /// <summary>
        /// Starts the controller.
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="repository"></param>
        public void Start(IControllerConfiguration configuration, ILibraryRepository repository)
        {
            try
            {
                _log.Debug("Starting controller...");

                //Store objects internally
                _configuration = configuration;
                _repository    = repository;

                //Initialize the controller and get things moving
                Initialize();

                _log.Info("Controller started.");
            }
            catch (Exception ex)
            {
                _log.Fatal("Error starting controller.", ex);
                throw ex;
            }
        }
        /// <summary>
        /// Starts the controller.
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="repository"></param>
        public void Start(IControllerConfiguration configuration, ILibraryRepository repository)
        {
            try
              {
            _log.Debug("Starting controller...");

            //Store objects internally
            _configuration = configuration;
            _repository = repository;

            //Initialize the controller and get things moving
            Initialize();

            _log.Info("Controller started.");
              }
              catch (Exception ex)
              {
            _log.Fatal("Error starting controller.", ex);
            throw ex;
              }
        }
示例#8
0
 public ChecklistController(IChecklistRepository repository, IControllerConfiguration config)
 {
     _repository = repository;
     PageSizeLimit = config.PageSizeLimit;
 }
示例#9
0
        static void Main(string[] args)
        {
            try
            {
                //Prompt for the type of controller to start
                ConsoleAction actionToPerform = ConsoleAction.None;
                do
                {
                    Console.WriteLine("Select controller to start. Press <Esc> to exit:");
                    Console.WriteLine();
                    Console.WriteLine("1) Library Sync Controller");
                    Console.WriteLine("2) Usage Sync Controller");
                    Console.WriteLine();
                    ConsoleKeyInfo userInput = Console.ReadKey(true);

                    switch (userInput.Key)
                    {
                    case ConsoleKey.D1:
                    case ConsoleKey.NumPad1:
                    {
                        actionToPerform = ConsoleAction.StartLibraryController;
                        break;
                    }

                    case ConsoleKey.D2:
                    case ConsoleKey.NumPad2:
                    {
                        actionToPerform = ConsoleAction.StartUsageController;
                        break;
                    }

                    case ConsoleKey.Escape:
                    {
                        actionToPerform = ConsoleAction.Exit;
                        break;
                    }

                    default:
                    {
                        //Clear the console. We'll prompt the user again.
                        Console.Clear();
                        break;
                    }
                    }
                }while (actionToPerform == ConsoleAction.None);

                //Create the configuration implementation to be used for the synchronization.
                IControllerConfiguration config = ConfigurationFile.Load();

                //Create the repository implementation to be used for the synchronization.
                ILibraryRepository repository = MsSqlRepository.Load("MsSql");

                BaseController controller = null;
                switch (actionToPerform)
                {
                case ConsoleAction.Exit:
                {
                    Console.WriteLine("Exiting application...");
                    return;
                }

                case ConsoleAction.StartLibraryController:
                {
                    Console.WriteLine("Starting library sync controller...");

                    controller = new LibrarySyncController <ImageFileRepository>();
                    break;
                }

                case ConsoleAction.StartUsageController:
                {
                    Console.WriteLine("Starting usage sync controller...");

                    controller = new UsageSyncController();
                    break;
                }
                }

                //Start the controller
                controller.Start(config, repository);

                //Wait for the user to stop the controller.
                Console.WriteLine("Controller started. Press any key to stop and exit.");
                Console.ReadKey();
                Console.WriteLine("Stopping controller...");

                //Kill it
                controller.Stop();
            }
            catch (Exception ex)
            {
                Console.WriteLine("**ERROR** - {0}", ex);
                Console.ReadKey();
            }
        }