Example #1
0
 public ReminderService(MonkeyDBContext dbContext, DiscordClient discordClient, ISchedulingService schedulingService, ILogger <ReminderService> logger)
 {
     _dbContext         = dbContext;
     _discordClient     = discordClient;
     _schedulingService = schedulingService;
     _logger            = logger;
 }
 public BattlefieldNewsService(DiscordSocketClient discordClient, IGuildService guildService, ISchedulingService schedulingService, ILogger <BattlefieldNewsService> logger)
 {
     this.discordClient     = discordClient;
     this.guildService      = guildService;
     this.schedulingService = schedulingService;
     this.logger            = logger;
 }
        public CreateNewEventViewModel(
            IValidationObjectFactory validationObjectFactory,
            ITeamActionsManagmentDataItems teamActionsManagmentDataItems,
            ISchedulingService schedulingService)
            : base(
                validationObjectFactory,
                teamActionsManagmentDataItems,
                schedulingService)
        {
            GameManagingHeader = CREATE_NEW_EVENT_HEADER;
            IsSaveAndCreateAnotherCommandAvalilable = true;

            SaveCommand = new Command(async() => {
                Guid busyKey = Guid.NewGuid();
                SetBusy(busyKey, true);

                ResetCancellationTokenSource(ref _createEventCancellationTokenSource);
                CancellationTokenSource cancellationTokenSource = _createEventCancellationTokenSource;

                EventDTO eventAction = await CreateNewEventAsync(cancellationTokenSource);

                if (eventAction != null)
                {
                    await NavigationService.GoBackAsync();
                }

                SetBusy(busyKey, false);
            });
        }
Example #4
0
 /// <param name="SchedulingService"></param>
 /// <param name="loggingInstance"></param>
 /// <param name="loghandler"></param>
 public SchedulingController(ISchedulingService SchedulingService, ILog loggingInstance,
                             LoggingCommandHandlerDecorator <LogCommand> loghandler)
 {
     _SchedulingService = SchedulingService;
     _loggingInstance   = loggingInstance;
     _logHandler        = loghandler;
 }
Example #5
0
        public CalendarPartDriver(ICalendarService calendarService, ISchedulingService eventService)
        {
            _calendarService = calendarService;
            _eventService    = eventService;

            T = NullLocalizer.Instance;
        }
Example #6
0
 public FeedService(MonkeyDBContext dbContext, DiscordSocketClient discordClient, ISchedulingService schedulingService, ILogger <FeedService> logger)
 {
     this.dbContext         = dbContext;
     this.discordClient     = discordClient;
     this.schedulingService = schedulingService;
     this.logger            = logger;
 }
Example #7
0
 public void Initialize()
 {
     _mockRepository = new Mock <ISchedulingRepository>();
     _service        = new SchedulingService(_mockRepository.Object);
     _mockEmployee   = new Mock <Employee>();
     _mockRoom       = new Mock <Room>();
 }
Example #8
0
 public BattlefieldNewsService(DiscordClient discordClient, IGuildService guildService, ISchedulingService schedulingService, ILogger <BattlefieldNewsService> logger)
 {
     _discordClient     = discordClient;
     _guildService      = guildService;
     _schedulingService = schedulingService;
     _logger            = logger;
 }
Example #9
0
        public EditGameViewModel(
            IValidationObjectFactory validationObjectFactory,
            ITeamActionsManagmentDataItems teamActionsManagmentDataItems,
            ISchedulingService schedulingService)
            : base(
                validationObjectFactory,
                teamActionsManagmentDataItems,
                schedulingService)
        {
            GameManagingHeader = EDIT_GAME_HEADER;

            SaveCommand = new Command(async() => {
                Guid busyKey = Guid.NewGuid();
                SetBusy(busyKey, true);

                ResetCancellationTokenSource(ref _updateGameCancellationTokenSource);
                CancellationTokenSource cancellationTokenSource = _updateGameCancellationTokenSource;

                GameDTO createdGame = await UpdateGameAsync(cancellationTokenSource);

                if (createdGame != null)
                {
                    await NavigationService.GoBackAsync();
                }

                SetBusy(busyKey, false);
            });
        }
Example #10
0
        public static void Start()
        {
            logger.Info("Conectandose a las bases de datos...");

            CreateRepositories();

            var cronExpression = ConfigurationManager.AppSettings["scheduleConfig"];

            logger.InfoFormat("Configurando servicio con la expresión '{0}'...", cronExpression);

            _schedulingService            = new SchedulingService();
            _schedulingService.LogFactory = new LogFactory();

            _schedulingService.At(cronExpression).Run(() =>
            {
                if (!_isRunning)
                {
                    _isRunning = true;

                    return(new ClientJob(
                               _clientRepository,
                               () =>
                    {
                        _isRunning = false;
                    }));
                }
                return(new DumClientJob());
            });
            _schedulingService.Start();

            logger.Info("Servicio corriendo...");
        }
Example #11
0
        /// <summary>
        /// Starts the server-side stream.
        /// </summary>
        public override void Start()
        {
            if (_state != State.UNINIT)
            {
                throw new NotSupportedException("State " + _state + " not valid to start");
            }
            if (_items.Count == 0)
            {
                throw new NotSupportedException("At least one item should be specified to start");
            }
            if (_publishedName == null)
            {
                throw new NotSupportedException("A published name is needed to start");
            }
            // publish this server-side stream

            IProviderService providerService = this.Scope.GetService(typeof(IProviderService)) as IProviderService;

            providerService.RegisterBroadcastStream(this.Scope, _publishedName, this);
            _recordPipe = new InMemoryPushPushPipe();
#if !(NET_1_1)
            Dictionary <string, object> recordParamMap = new Dictionary <string, object>();
#else
            Hashtable recordParamMap = new Hashtable();
#endif
            recordParamMap.Add("record", null);
            _recordPipe.Subscribe((IProvider)this, recordParamMap);
            _recordingFilename = null;
            _schedulingService = this.Scope.GetService(typeof(ISchedulingService)) as ISchedulingService;
            _state             = State.STOPPED;
            _currentItemIndex  = -1;
            NextItem();
        }
 public DoctorController(IDoctorBasicService doctorBasicService, UserManager <MyUser> userManager, RoleManager <IdentityRole> roleManager, ISpecialityDoctorService specialityDoctorService, ISchedulingService schedulingService)
 {
     _doctorBasicService      = doctorBasicService;
     _userManager             = userManager;
     _roleManager             = roleManager;
     _specialityDoctorService = specialityDoctorService;
     _schedulingService       = schedulingService;
 }
 public BlockController(IBlockService blockService, IDoctorBasicService doctorService, ISchedulingService schedulingService, ICustomerService customerService, ITicketService ticketService)
 {
     _blockService      = blockService;
     _doctorService     = doctorService;
     _schedulingService = schedulingService;
     _customerService   = customerService;
     _ticketService     = ticketService;
 }
Example #14
0
 protected BaseGameServerService(GameServerType gameServerType, MonkeyDBContext dbContext, DiscordClient discordClient, ISchedulingService schedulingService, ILogger <IGameServerService> logger)
 {
     _gameServerType    = gameServerType;
     _dbContext         = dbContext;
     _discordClient     = discordClient;
     _schedulingService = schedulingService;
     _logger            = logger;
 }
Example #15
0
 private static void ServiceSetup(ISchedulingService service)
 {
     var crontab = ConfigurationManager.AppSettings["crontab"];
     service
         .At(crontab)
         .Run<Job>()
         .Named("mongo");
 }
Example #16
0
        static void ServiceSetup(ISchedulingService service)
        {
            service.LogFactory = new NCron.Integration.log4net.LogFactory();

            string cron = ConfigurationManager.AppSettings["cron"].ToString();

            service.At(cron).Run <MyJob>();
        }
 public SpecialityController(ISpecialityService specialityService, IRoomService roomService, IDoctorBasicService doctorService, ISchedulingService schedulingService, ISpecialityDoctorService specialityDoctorService, UserManager <MyUser> userManager)
 {
     _specialityService       = specialityService;
     _roomService             = roomService;
     _doctorService           = doctorService;
     _schedulingService       = schedulingService;
     _specialityDoctorService = specialityDoctorService;
     _userManager             = userManager;
 }
        public AddOpponentPopupViewModel(
            IValidationObjectFactory validationObjectFactory,
            ISchedulingService schedulingService)
        {
            _validationObjectFactory = validationObjectFactory;
            _schedulingService       = schedulingService;

            ResetValidationObjects();
        }
 public SchedulingController(UserManager <MyUser> userManager, ISchedulingService schedulingService, IBlockService blockService, ITicketService ticketService, IRoomService roomService, IDoctorBasicService doctorService, IMailService emailService)
 {
     _userManager       = userManager;
     _schedulingService = schedulingService;
     _blockService      = blockService;
     _ticketService     = ticketService;
     _roomService       = roomService;
     _doctorService     = doctorService;
     _emailService      = emailService;
 }
Example #20
0
 public void Initialize()
 {
     BaseSqlTest.SeedDatabase();
     _repository  = new SchedulingSqlRepository();
     _service     = new SchedulingService(_repository);
     _employee    = ObjectMother.GetEmployee();
     _employee.Id = 1;
     _room        = ObjectMother.GetRoom();
     _room.Id     = 1;
 }
 public SteamGameServerService(
     MonkeyDBContext dbContext,
     DiscordClient discordClient,
     ISchedulingService schedulingService,
     ILogger <SteamGameServerService> logger)
     : base(GameServerType.Steam, dbContext, discordClient, schedulingService, logger)
 {
     _dbContext     = dbContext;
     _discordClient = discordClient;
     _logger        = logger;
 }
Example #22
0
 public MineCraftGameServerService(
     MonkeyDBContext dbContext,
     DiscordClient discordClient,
     ISchedulingService schedulingService,
     ILogger <MineCraftGameServerService> logger)
     : base(GameServerType.Minecraft, dbContext, discordClient, schedulingService, logger)
 {
     _dbContext     = dbContext;
     _discordClient = discordClient;
     _logger        = logger;
 }
Example #23
0
        /// <summary>
        /// Kicks off the running of the schedule monitor.
        /// </summary>
        /// <param name="service">The schedulign service to use.</param>
        public void AddToScheduler(ISchedulingService service)
        {
            var jobName = typeof(SystemMonitor).Name;

            if (!service.HasJob(jobName))
            {
                service.AddJob(
                    typeof(SystemMonitor).Name,
                    ConfigurationManager.AppSettings[Constants.MonitorSchedule],
                    () => { RecordPerformance(); });
            }
        }
Example #24
0
 public SchedulingController(INotifier notifier,
                             ISchedulingService schedulingService,
                             IDentistService dentistService,
                             IPatientService patientService,
                             UserManager <IdentityUser> userManager)
     : base(notifier)
 {
     _schedulingService = schedulingService;
     _dentistService    = dentistService;
     _patientService    = patientService;
     _userManager       = userManager;
 }
Example #25
0
 /// <summary>
 /// Start waiting for a valid handshake.
 /// </summary>
 internal override void StartWaitForHandshake()
 {
     _lock.AcquireWriterLock();
     try {
         if (FluorineConfiguration.Instance.FluorineSettings.RtmpServer.RtmpConnectionSettings.MaxHandshakeTimeout > 0)
         {
             ISchedulingService schedulingService = _endpoint.GetMessageBroker().GlobalScope.GetService(typeof(ISchedulingService)) as ISchedulingService;
             _waitForHandshakeJob = schedulingService.AddScheduledOnceJob(FluorineConfiguration.Instance.FluorineSettings.RtmpServer.RtmpConnectionSettings.MaxHandshakeTimeout, new WaitForHandshakeJob(this));
         }
     } finally {
         _lock.ReleaseWriterLock();
     }
 }
Example #26
0
        public InfluxDbUpload(ILogger logger,
                              InfluxDBClient client,
                              IThreadManager threadManager,
                              ISchedulingService schedulingService)
        {
            _logger            = logger;
            _client            = client;
            _threadManager     = threadManager;
            _schedulingService = schedulingService;

            _jobQueue      = new BlockingCollection <InfluxDbUploadQueueElement>();
            _retryJobQueue = new List <InfluxDbUploadRetryQueueElement>();
        }
Example #27
0
 public PatientController(IIdentityProvider identityProvider,
                          IPatientRepository patientRepository,
                          IAppointmentRepository appointmentRepository,
                          IPatientManagementService patientManagementService,
                          IVisitationManagementService visitationManagementService,
                          ISchedulingService schedulingService)
 {
     _identityProvider            = identityProvider;
     _patientRepository           = patientRepository;
     _appointmentRepository       = appointmentRepository;
     _patientManagementService    = patientManagementService;
     _visitationManagementService = visitationManagementService;
     _schedulingService           = schedulingService;
 }
Example #28
0
 public SceneViewUpdateScheduleTask(ISchedulingService scheduleManager, bool early)
 {
     this.workItems = new Dictionary <SceneViewModel, SceneUpdatePhaseEventArgs>();
     if (early)
     {
         this.priority = SceneViewUpdateScheduleTask.earlyPriority;
         this.task     = scheduleManager.RegisterTask("EarlySceneUpdatePhase", this.priority, new ScheduleTask.NoArgumentsReturningVoid(this.UpdateEarly), (string[])null);
     }
     else
     {
         this.priority = SceneViewUpdateScheduleTask.latePriority;
         this.task     = scheduleManager.RegisterTask("LateSceneUpdatePhase", this.priority, new ScheduleTask.NoArgumentsReturningVoid(this.UpdateLate), (string[])null);
     }
 }
Example #29
0
 public DoctorController(IIdentityProvider identityProvider,
                         IDoctorRepository doctorRepository,
                         IAppointmentRepository appointmentRepository,
                         IPatientRepository patientRepository,
                         IPatientManagementService patientManagementService,
                         IVisitationManagementService visitationManagementService,
                         ISchedulingService schedulingService,
                         IReferralRepository referralRepository,
                         INotificationManagementService notificationManagementService)
 {
     _identityProvider              = identityProvider;
     _doctorRepository              = doctorRepository;
     _appointmentRepository         = appointmentRepository;
     _patientRepository             = patientRepository;
     _patientManagementService      = patientManagementService;
     _visitationManagementService   = visitationManagementService;
     _schedulingService             = schedulingService;
     _referralRepository            = referralRepository;
     _notificationManagementService = notificationManagementService;
 }
Example #30
0
 public LegalController(IPatientRepository patientRepository,
                        IIdentityProvider identityProvider,
                        ISchedulingService schedulingService,
                        IAppointmentRepository appointmentRepository,
                        IDoctorRepository doctorRepository,
                        IPatientManagementService patientManagementService,
                        IVisitationManagementService visitationManagementService,
                        IAccountRepository accountRepository,
                        IAccountManagementService accountManagementService)
 {
     _patientRepository           = patientRepository;
     _identityProvider            = identityProvider;
     _schedulingService           = schedulingService;
     _appointmentRepository       = appointmentRepository;
     _doctorRepository            = doctorRepository;
     _patientManagementService    = patientManagementService;
     _accountManagementService    = accountManagementService;
     _accountRepository           = accountRepository;
     _visitationManagementService = visitationManagementService;
 }
        public static string GetSummary(this ISchedulingService schedulingService)
        {
            Argument.IsNotNull(() => schedulingService);

#pragma warning disable IDISP001 // Dispose created
            var serviceLocator = schedulingService.GetServiceLocator();
#pragma warning restore IDISP001 // Dispose created
            var languageService = serviceLocator.ResolveType <ILanguageService>();

            var scheduledTasks = (from task in schedulingService.GetScheduledTasks()
                                  orderby task.Start
                                  select task).ToList();

            var runningTasks = (from task in schedulingService.GetRunningTasks()
                                orderby task.Started
                                select task).ToList();

            var stringBuilder = new StringBuilder();

            stringBuilder.AppendLine(languageService.GetString("Scheduling_RunningTasks"));
            stringBuilder.AppendLine("=============================");
            stringBuilder.AppendLine();

            foreach (var runningTask in runningTasks)
            {
                stringBuilder.AppendLine("* {0}", runningTask);
            }

            stringBuilder.AppendLine();

            stringBuilder.AppendLine(languageService.GetString("Scheduling_ScheduledTasks"));
            stringBuilder.AppendLine("=============================");
            stringBuilder.AppendLine();

            foreach (var scheduledTask in scheduledTasks)
            {
                stringBuilder.AppendLine("* {0}", scheduledTask);
            }

            return(stringBuilder.ToString());
        }
Example #32
0
 private static void ServiceSetup(ISchedulingService schedulingService)
 {
     var taskCreator = IoC.Resolve<ITaskCreator>();
     schedulingService.At("10 * * * *").Run(() => new CreateTaskJob(taskCreator));
 }
Example #33
0
 internal JobPart(ISchedulingService service, ScheduledJob queueEntry)
 {
     _service = service;
     _queueEntry = queueEntry;
 }
Example #34
0
        /// <summary>
        /// Starts the server-side stream.
        /// </summary>
        public override void Start()
        {
            if (_state != State.UNINIT)
                throw new NotSupportedException("State " + _state + " not valid to start");
            if (_items.Count == 0)
                throw new NotSupportedException("At least one item should be specified to start");
            if (_publishedName == null)
                throw new NotSupportedException("A published name is needed to start");
            // publish this server-side stream

            IProviderService providerService = this.Scope.GetService(typeof(IProviderService)) as IProviderService;
            providerService.RegisterBroadcastStream(this.Scope, _publishedName, this);
            _recordPipe = new InMemoryPushPushPipe();
#if !(NET_1_1)
            Dictionary<string, object> recordParamMap = new Dictionary<string, object>();
#else
            Hashtable recordParamMap = new Hashtable();
#endif
            recordParamMap.Add("record", null);
            _recordPipe.Subscribe((IProvider)this, recordParamMap);
            _recordingFilename = null;
            _schedulingService = this.Scope.GetService(typeof(ISchedulingService)) as ISchedulingService;
            _state = State.STOPPED;
            _currentItemIndex = -1;
            NextItem();
        }
Example #35
0
 public Builder(PlaylistSubscriberStream playlistSubscriberStream, ISchedulingService schedulingService, IConsumerService consumerService, IProviderService providerService)
 {
     _playlistSubscriberStream = playlistSubscriberStream;
     _schedulingService = schedulingService;
     _consumerService = consumerService;
     _providerService = providerService;
 }
Example #36
0
 private PlayEngine(Builder builder)
 {
     _playlistSubscriberStream = builder.PlaylistSubscriberStream;
     _schedulingService = builder.SchedulingService;
     _consumerService = builder.ConsumerService;
     _providerService = builder.ProviderService;
     //_playlistSubscriberStream = stream;
     //_schedulingService = _playlistSubscriberStream.Scope.GetService(typeof(ISchedulingService)) as ISchedulingService;
 }
Example #37
0
 static void ServiceSetup(ISchedulingService service)
 {
     service.At("*/5 * * * *").Run(() => new ReceiverJob());
     service.At("*/5 * * * *").Run(() => new PublisherJob());
 }
		/// <summary>
		/// Creates a play engine based on current services (scheduling service, consumer service, and provider service).
		/// </summary>
		/// <param name="schedulingService">The scheduling service.</param>
		/// <param name="consumerService">The consumer service.</param>
		/// <param name="providerService">The provider service.</param>
		/// <returns>Play engine.</returns>
		PlayEngine CreateEngine(ISchedulingService schedulingService, IConsumerService consumerService, IProviderService providerService) {
			_engine = new PlayEngine.Builder(this, schedulingService, consumerService, providerService).Build();
			return _engine;
		}