Esempio n. 1
0
        public MasterModule(CrossStitchCore core, NodeConfiguration configuration)
        {
            _configuration = configuration;
            _messageBus    = core.MessageBus;
            _log           = new ModuleLog(core.MessageBus, Name);
            var data = new DataHelperClient(core.MessageBus);

            _data = new MasterDataRepository(core.NodeId, data);
            var stitches = new StitchRequestHandler(core.MessageBus);
            var sender   = new ClusterMessageSender(core.MessageBus);

            _service = new MasterService(core, _log, _data, stitches, sender);
        }
Esempio n. 2
0
        public MasterService(CrossStitchCore core, IModuleLog log, MasterDataRepository data, IStitchRequestHandler stitches, IClusterMessageSender clusterSender)
        {
            _core          = core;
            _log           = log;
            _data          = data;
            _stitches      = stitches;
            _clusterSender = clusterSender;
            _clusterZones  = new string[0];
            _jobManager    = new JobManager(_core.MessageBus, _data, _log);

            _commandHandlers = new Dictionary <CommandType, ICommandHandler>
            {
                { CommandType.Ping, new PingCommandHandler(_core.NodeId, data, _jobManager, _clusterSender) },
                { CommandType.StartStitchInstance, new StartStitchCommandHandler(data, _jobManager, stitches, _clusterSender) },
                { CommandType.StopStitchInstance, new StopStitchCommandHandler(data, _jobManager, stitches, _clusterSender) },
                { CommandType.RemoveStitchInstance, new RemoveStitchCommandHandler(data, _jobManager, stitches, _clusterSender) },
                { CommandType.StartStitchGroup, new StartAllStitchGroupCommandHandler(core.NodeId, data, _jobManager, stitches, _clusterSender) },
                { CommandType.StopStitchGroup, new StopAllStitchGroupCommandHandler(core.NodeId, data, _jobManager, stitches, _clusterSender) }
            };
        }
Esempio n. 3
0
 public JobManager(IMessageBus messageBus, MasterDataRepository data, IModuleLog log)
 {
     _messageBus = messageBus;
     _data       = data;
     _log        = log;
 }