public ScheduleDisplayViewModel(IScheduleService service)
        {
            this.RefreshDatesCommand = new RelayCommand(RefreshDates);

            this.Mondays = new ObservableCollection<DateTime>();
            this.Service = service;
        }
 public DefaultCleanAggregateService(IMemoryCache memoryCache, IScheduleService scheduleService)
 {
     TimeoutSeconds = ENodeConfiguration.Instance.Setting.AggregateRootMaxInactiveSeconds;
     _memoryCache = memoryCache;
     _scheduleService = scheduleService;
     _scheduleService.StartTask("CleanAggregates", Clean, 1000, ENodeConfiguration.Instance.Setting.ScanExpiredAggregateIntervalMilliseconds);
 }
 public ActivityGridViewModel(IScheduleService service)
 {
     this.Service = service;
     this.Activities = new ObservableCollection<ActivityModel>();
     this.ActivitiesView = CollectionViewSource.GetDefaultView(Activities);
     this.ActivitiesView.GroupDescriptions.Add(new PropertyGroupDescription("DayOfWeek"));
 }
Beispiel #4
0
        public Consumer(string groupName, ConsumerSetting setting)
        {
            if (groupName == null)
            {
                throw new ArgumentNullException("groupName");
            }
            GroupName = groupName;
            Setting = setting ?? new ConsumerSetting();

            _lockObject = new object();
            _subscriptionTopics = new Dictionary<string, HashSet<string>>();
            _topicQueuesDict = new ConcurrentDictionary<string, IList<MessageQueue>>();
            _pullRequestQueue = new BlockingCollection<PullRequest>(new ConcurrentQueue<PullRequest>());
            _pullRequestDict = new ConcurrentDictionary<string, PullRequest>();
            _messageRetryQueue = new BlockingCollection<ConsumingMessage>(new ConcurrentQueue<ConsumingMessage>());
            _taskFactory = new TaskFactory(new LimitedConcurrencyLevelTaskScheduler(Setting.ConsumeThreadMaxCount));
            _remotingClient = new SocketRemotingClient(Setting.BrokerAddress, Setting.SocketSetting, Setting.LocalAddress);
            _adminRemotingClient = new SocketRemotingClient(Setting.BrokerAdminAddress, Setting.SocketSetting, Setting.LocalAdminAddress);
            _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>();
            _scheduleService = ObjectContainer.Resolve<IScheduleService>();
            _allocateMessageQueueStragegy = ObjectContainer.Resolve<IAllocateMessageQueueStrategy>();
            _executePullRequestWorker = new Worker("ExecutePullRequest", ExecutePullRequest);
            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);

            _remotingClient.RegisterConnectionEventListener(new ConnectionEventListener(this));
        }
Beispiel #5
0
 public MessageHandler()
 {
     _scheduleService = ObjectContainer.Resolve<IScheduleService>();
     _scheduleService.StartTask("PrintThroughput", PrintThroughput, 1000, 1000);
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(typeof(Program).Name);
     _throughputLogger = ObjectContainer.Resolve<ILoggerFactory>().Create("throughput");
 }
Beispiel #6
0
 public ScheduleController(IRepository repository, IScheduleService schedService, ITruckService truckService, IMappingEngine mapper)
 {
     this.repository = repository;
     this.schedService = schedService;
     this.truckService = truckService;
     this.mapper = mapper;
 }
Beispiel #7
0
        public ClientService(ClientSetting setting, Producer producer, Consumer consumer)
        {
            Ensure.NotNull(setting, "setting");
            if (producer == null && consumer == null)
            {
                throw new ArgumentException("producer or consumer must set at least one of them.");
            }
            else if (producer != null && consumer != null)
            {
                throw new ArgumentException("producer or consumer cannot set both of them.");
            }

            Interlocked.Increment(ref _instanceNumber);

            _producer = producer;
            _consumer = consumer;
            _setting = setting;
            _clientId = BuildClientId(setting.ClientName);
            _brokerConnectionDict = new ConcurrentDictionary<string, BrokerConnection>();
            _topicMessageQueueDict = new ConcurrentDictionary<string, IList<MessageQueue>>();
            _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>();
            _jsonSerializer = ObjectContainer.Resolve<IJsonSerializer>();
            _scheduleService = ObjectContainer.Resolve<IScheduleService>();
            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
            _nameServerRemotingClientList = RemotingClientUtils.CreateRemotingClientList(_setting.NameServerList, _setting.SocketSetting).ToList();
        }
Beispiel #8
0
        public Consumer(string id, string groupName, ConsumerSetting setting)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }
            if (groupName == null)
            {
                throw new ArgumentNullException("groupName");
            }
            Id = id;
            GroupName = groupName;
            Setting = setting ?? new ConsumerSetting();

            _lockObject = new object();
            _subscriptionTopics = new List<string>();
            _topicQueuesDict = new ConcurrentDictionary<string, IList<MessageQueue>>();
            _pullRequestQueue = new BlockingCollection<PullRequest>(new ConcurrentQueue<PullRequest>());
            _pullRequestDict = new ConcurrentDictionary<string, PullRequest>();
            _consumingMessageQueue = new BlockingCollection<ConsumingMessage>(new ConcurrentQueue<ConsumingMessage>());
            _messageRetryQueue = new BlockingCollection<ConsumingMessage>(new ConcurrentQueue<ConsumingMessage>());
            _handlingMessageDict = new ConcurrentDictionary<long, ConsumingMessage>();
            _taskIds = new List<int>();
            _remotingClient = new SocketRemotingClient(Setting.BrokerAddress, Setting.BrokerPort);
            _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>();
            _scheduleService = ObjectContainer.Resolve<IScheduleService>();
            _allocateMessageQueueStragegy = ObjectContainer.Resolve<IAllocateMessageQueueStrategy>();
            _executePullRequestWorker = new Worker("Consumer.ExecutePullRequest", ExecutePullRequest);
            _handleMessageWorker = new Worker("Consumer.HandleMessage", HandleMessage);
            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
        }
Beispiel #9
0
        public ChunkWriter(ChunkManager chunkManager)
        {
            Ensure.NotNull(chunkManager, "chunkManager");

            _chunkManager = chunkManager;
            _scheduleService = ObjectContainer.Resolve<IScheduleService>();
        }
Beispiel #10
0
 public MessageService(IMessageStore messageStore, IOffsetManager offsetManager, IScheduleService scheduleService)
 {
     _messageStore = messageStore;
     _offsetManager = offsetManager;
     _scheduleService = scheduleService;
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
 }
Beispiel #11
0
        public Consumer(string groupName, ConsumerSetting setting)
        {
            if (groupName == null)
            {
                throw new ArgumentNullException("groupName");
            }
            GroupName = groupName;
            Setting = setting ?? new ConsumerSetting();

            _lockObject = new object();
            _subscriptionTopics = new Dictionary<string, HashSet<string>>();
            _topicQueuesDict = new ConcurrentDictionary<string, IList<MessageQueue>>();
            _pullRequestDict = new ConcurrentDictionary<string, PullRequest>();
            _remotingClient = new SocketRemotingClient(Setting.BrokerAddress, Setting.SocketSetting, Setting.LocalAddress);
            _adminRemotingClient = new SocketRemotingClient(Setting.BrokerAdminAddress, Setting.SocketSetting, Setting.LocalAdminAddress);
            _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>();
            _scheduleService = ObjectContainer.Resolve<IScheduleService>();
            _allocateMessageQueueStragegy = ObjectContainer.Resolve<IAllocateMessageQueueStrategy>();
            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);

            _remotingClient.RegisterConnectionEventListener(new ConnectionEventListener(this));

            if (Setting.MessageHandleMode == MessageHandleMode.Sequential)
            {
                _consumingMessageQueue = new BlockingCollection<ConsumingMessage>();
                _consumeMessageWorker = new Worker("ConsumeMessage", () => HandleMessage(_consumingMessageQueue.Take()));
            }
            _messageRetryQueue = new BlockingCollection<ConsumingMessage>();
        }
Beispiel #12
0
 public DefaultEventService(
     IJsonSerializer jsonSerializer,
     IScheduleService scheduleService,
     ITypeNameProvider typeNameProvider,
     IMemoryCache memoryCache,
     IAggregateRootFactory aggregateRootFactory,
     IAggregateStorage aggregateStorage,
     IEventStore eventStore,
     IMessagePublisher<DomainEventStreamMessage> domainEventPublisher,
     IOHelper ioHelper,
     ILoggerFactory loggerFactory)
 {
     _eventMailboxDict = new ConcurrentDictionary<string, EventMailBox>();
     _ioHelper = ioHelper;
     _jsonSerializer = jsonSerializer;
     _scheduleService = scheduleService;
     _typeNameProvider = typeNameProvider;
     _memoryCache = memoryCache;
     _aggregateRootFactory = aggregateRootFactory;
     _aggregateStorage = aggregateStorage;
     _eventStore = eventStore;
     _domainEventPublisher = domainEventPublisher;
     _logger = loggerFactory.Create(GetType().FullName);
     _batchSize = ENodeConfiguration.Instance.Setting.EventMailBoxPersistenceMaxBatchSize;
 }
 public DisplayLunchViewModel(IScheduleService service)
 {
     this.Service = service;
     this.Week = new ObservableCollection<LunchTimeDto>();
     this.WeekView = CollectionViewSource.GetDefaultView(Week);
     this.WeekView.GroupDescriptions.Add(new PropertyGroupDescription("DayOfWeek"));
 }
Beispiel #14
0
 public SendReplyService()
 {
     _clientWrapperDict = new ConcurrentDictionary<string, SocketRemotingClientWrapper>();
     _jsonSerializer = ObjectContainer.Resolve<IJsonSerializer>();
     _scheduleService = ObjectContainer.Resolve<IScheduleService>();
     _ioHelper = ObjectContainer.Resolve<IOHelper>();
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
 }
Beispiel #15
0
 public DefaultQueueStore(IMessageStore messageStore, IConsumeOffsetStore consumeOffsetStore, IScheduleService scheduleService, ILoggerFactory loggerFactory)
 {
     _queueDict = new ConcurrentDictionary<string, Queue>();
     _messageStore = messageStore;
     _consumeOffsetStore = consumeOffsetStore;
     _scheduleService = scheduleService;
     _logger = loggerFactory.Create(GetType().FullName);
 }
 public ExaminationDatasheetsController(IGroupService gs, ICourseService cs, IAcademicProgressService aps,
     IScheduleService scs)
 {
     groupService = gs;
     courseService = cs;
     academicProgressService = aps;
     scheduleService = scs;
 }
Beispiel #17
0
 public MessageService(IBinarySerializer binarySerializer, IScheduleService scheduleService, SendEmailService sendEmailService)
 {
     _nameServerRemotingClientList = CreateRemotingClientList(Settings.NameServerList);
     _clusterBrokerDict = new ConcurrentDictionary<string, IList<BrokerClient>>();
     _binarySerializer = binarySerializer;
     _scheduleService = scheduleService;
     _sendEmailService = sendEmailService;
 }
 public DefaultConsumeOffsetStore(IScheduleService scheduleService, IJsonSerializer jsonSerializer, ILoggerFactory loggerFactory)
 {
     _groupConsumeOffsetsDict = new ConcurrentDictionary<string, ConcurrentDictionary<string, long>>();
     _scheduleService = scheduleService;
     _jsonSerializer = jsonSerializer;
     _logger = loggerFactory.Create(GetType().FullName);
     _persistConsumeOffsetTaskName = string.Format("{0}.PersistConsumeOffsetInfo", this.GetType().Name);
 }
Beispiel #19
0
        public ChunkWriter(ChunkManager chunkManager)
        {
            Ensure.NotNull(chunkManager, "chunkManager");

            _chunkManager = chunkManager;
            _scheduleService = ObjectContainer.Resolve<IScheduleService>();
            _flushTaskName = string.Format("{0}-FlushChunk", _chunkManager.Name);
        }
 public DefaultConsumeOffsetStore(IScheduleService scheduleService, IJsonSerializer jsonSerializer, ILoggerFactory loggerFactory)
 {
     _groupConsumeOffsetsDict = new ConcurrentDictionary<string, ConcurrentDictionary<QueueKey, long>>();
     _groupNextConsumeOffsetsDict = new ConcurrentDictionary<string, ConcurrentDictionary<QueueKey, long>>();
     _scheduleService = scheduleService;
     _jsonSerializer = jsonSerializer;
     _logger = loggerFactory.Create(GetType().FullName);
 }
Beispiel #21
0
 public QueueService(IQueueStore queueStore, IMessageStore messageStore, IOffsetManager offsetManager, IScheduleService scheduleService, ILoggerFactory loggerFactory)
 {
     _queueDict = new ConcurrentDictionary<string, Queue>();
     _queueStore = queueStore;
     _messageStore = messageStore;
     _offsetManager = offsetManager;
     _scheduleService = scheduleService;
     _logger = loggerFactory.Create(GetType().FullName);
 }
 public EditGroupScheduleViewModel(IScheduleService service)
 {
     this.SaveCommand = new RelayCommand(Save, CanSave);
     this.EducatorsAfternoon = new ObservableCollection<EditPersonScheduleViewModel>();
     this.EducatorsMorning = new ObservableCollection<EditPersonScheduleViewModel>();
     this.BeneficiariesAfternoon = new ObservableCollection<PersonDto>();
     this.BeneficiariesMorning = new ObservableCollection<PersonDto>();
     this.Service = service;
 }
Beispiel #23
0
 public SendReplyService()
 {
     _jsonSerializer = ObjectContainer.Resolve<IJsonSerializer>();
     _scheduleService = ObjectContainer.Resolve<IScheduleService>();
     _ioHelper = ObjectContainer.Resolve<IOHelper>();
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
     _sendReplyRemotingClientDict = new ConcurrentDictionary<string, SocketRemotingClientWrapper>();
     _taskFactory = new TaskFactory(new LimitedConcurrencyLevelTaskScheduler(Environment.ProcessorCount));
 }
Beispiel #24
0
 public MessageService(IBinarySerializer binarySerializer, IScheduleService scheduleService, SendEmailService sendEmailService)
 {
     _remotingClient = new SocketRemotingClient(Settings.BrokerAddress);
     _binarySerializer = binarySerializer;
     _scheduleService = scheduleService;
     _unconsumedMessageWarnningThreshold = int.Parse(ConfigurationManager.AppSettings["unconsumedMessageWarnningThreshold"]);
     _checkUnconsumedMessageInterval = int.Parse(ConfigurationManager.AppSettings["checkUnconsumedMessageInterval"]);
     _sendEmailService = sendEmailService;
 }
Beispiel #25
0
 public ClusterManager(NameServerController nameServerController)
 {
     _scheduleService = ObjectContainer.Resolve<IScheduleService>();
     _jsonSerializer = ObjectContainer.Resolve<IJsonSerializer>();
     _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>();
     _clusterDict = new ConcurrentDictionary<string, Cluster>();
     _nameServerController = nameServerController;
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
 }
 public DefaultChunkReadStatisticService(IMessageStore messageStore, IScheduleService scheduleService, ILoggerFactory loggerFactory)
 {
     _messageStore = messageStore;
     _scheduleService = scheduleService;
     _logger = loggerFactory.Create("ChunkRead");
     _fileReadDict = new ConcurrentDictionary<int, CountInfo>();
     _unmanagedReadDict = new ConcurrentDictionary<int, CountInfo>();
     _cachedReadDict = new ConcurrentDictionary<int, CountInfo>();
 }
 public SqlServerMessageStore(SqlServerMessageStoreSetting setting)
 {
     _setting = setting;
     _scheduleService = ObjectContainer.Resolve<IScheduleService>();
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
     _messageDataTable = BuildMessageDataTable();
     _deleteMessageSQLFormat = "delete from [" + _setting.MessageTable + "] where Topic = '{0}' and QueueId = {1} and QueueOffset < {2}";
     _selectAllMessageSQL = "select * from [" + _setting.MessageTable + "] order by MessageOffset asc";
 }
 public CommitConsumeOffsetService(Consumer consumer, ClientService clientService)
 {
     _consumeOffsetInfoDict = new ConcurrentDictionary<string, ConsumeOffsetInfo>();
     _consumer = consumer;
     _clientService = clientService;
     _clientId = clientService.GetClientId();
     _binarySerializer = ObjectContainer.Resolve<IBinarySerializer>();
     _scheduleService = ObjectContainer.Resolve<IScheduleService>();
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
 }
 public SuspendedPullRequestManager()
 {
     _scheduleService = ObjectContainer.Resolve<IScheduleService>();
     _messageService = ObjectContainer.Resolve<IMessageService>();
     _worker = new Worker(() =>
     {
         var notifyItem = _notifyQueue.Take();
         NotifyMessageArrived(BuildKey(notifyItem.Topic, notifyItem.QueueId), notifyItem.QueueOffset);
     });
 }
 public SqlServerOffsetManager(SqlServerOffsetManagerSetting setting)
 {
     _setting = setting;
     _scheduleService = ObjectContainer.Resolve<IScheduleService>();
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
     _getLatestVersionSQL = "select max(Version) from [" + _setting.QueueOffsetTable + "]";
     _getLatestVersionQueueOffsetSQL = "select * from [" + _setting.QueueOffsetTable + "] where Version = {0}";
     _insertNewVersionQueueOffsetSQLFormat = "insert into [" + _setting.QueueOffsetTable + "] (Version,ConsumerGroup,Topic,QueueId,QueueOffset,Timestamp) values ({0},'{1}','{2}',{3},{4},'{5}')";
     _deleteOldVersionQueueOffsetSQLFormat = "delete from [" + _setting.QueueOffsetTable + "] where Version = {0}";
 }
 public ScheduleSubscriber(
     IFeedServiceAgent feedSvc,
     IUCenterService uCenter,
     IMemcachedClient cache,
     IScheduleRepository repository,
     IMsgApiService msgSvc,
     IScheduleService scheduleSvc)
 {
     _feedSvc     = feedSvc;
     _uCenter     = uCenter;
     _cache       = cache;
     _repository  = repository;
     _msgSvc      = msgSvc;
     _scheduleSvc = scheduleSvc;
 }
Beispiel #32
0
        static void InitializeEQueue()
        {
            ECommonConfiguration
            .Create()
            .UseAutofac()
            .RegisterCommonComponents()
            .UseLog4Net()
            .UseJsonNet()
            .RegisterUnhandledExceptionHandler()
            .RegisterEQueueComponents()
            .SetDefault <IQueueSelector, QueueAverageSelector>();

            _logger          = ObjectContainer.Resolve <ILoggerFactory>().Create(typeof(Program).Name);
            _scheduleService = ObjectContainer.Resolve <IScheduleService>();
        }
 public SuspendedPullRequestManager()
 {
     _scheduleService            = ObjectContainer.Resolve <IScheduleService>();
     _queueStore                 = ObjectContainer.Resolve <IQueueStore>();
     _logger                     = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
     _notifyMessageArrivedWorker = new Worker("NotifyMessageArrived", () =>
     {
         var notifyItem = _notifyQueue.Take();
         if (notifyItem == null)
         {
             return;
         }
         NotifyMessageArrived(notifyItem.Topic, notifyItem.QueueId, notifyItem.QueueOffset);
     });
 }
        public CodeListPage()
        {
            InitializeComponent();
            _service = TinyIoCContainer.Current.Resolve <IScheduleService>();

            List <string> itemsSource = _service.GetCodeList();

            CodeList.ItemsSource = itemsSource;

            if (Device.RuntimePlatform == Device.Android)
            {
                //Fixes an android bug where the search bar would be hidden
                SearchBar.HeightRequest = 40.0;
            }
        }
        public static string GetSpecialDayGroupInfoList(this IScheduleService s,
                                                        int?Limit, string StartReference, out SpecialDayGroupInfo[] SpecialDayGroupInfo)
        {
            s.InitializeGuard();

            string r = null;

            SpecialDayGroupInfo[] localSpecialDayGroupInfo = null;

            s.Test.RunStep(() => r = s.ServiceClient.Port.GetSpecialDayGroupInfoList(Limit, StartReference, out localSpecialDayGroupInfo), "Get SpecialDayGroupInfo List");

            SpecialDayGroupInfo = localSpecialDayGroupInfo ?? new SpecialDayGroupInfo[0];

            return(r);
        }
Beispiel #36
0
        private void Initialize(IUnitOfWork unitOfWork)
        {
            _unitOfWork = unitOfWork ?? throw new ArgumentNullException("unitOfWork");

            _typiconEntity = _unitOfWork.Repository <TypiconEntity>().Get(c => c.Name == "Типикон");

            if (_typiconEntity == null)
            {
                throw new NullReferenceException("TypiconEntity");
            }

            var easterContext = new EasterFakeContext(new DateTime(2010, 4, 7));

            _scheduleService = ScheduleServiceFactory.Create(_unitOfWork, easterContext);
        }
        public void SetUp()
        {
            availableGroups = fixt.CreateMany <ScheduleGroup>(10);
            fakeService     = A.Fake <IScheduleService>();
            fakeNotificator = A.Fake <INotifiactionSender>();
            storage         = new InMemoryBotStorage(fakeService, fakeNotificator);
            IScheduleGroup @out;

            A.CallTo(() => fakeService.GroupsMonitor.TryGetCorrectGroup(null, out @out)).WithAnyArguments().Returns(true)
            .AssignsOutAndRefParametersLazily(
                call => new List <object>()
            {
                call.Arguments[0]
            });
        }
 public InspectionJyyController(IInspectionAttachmentService InspectionAttachmentService, ISysUserService sysUserService, IOrderService sysOrderService, IOrderMainService sysOrderMainService, IInspecationMainService sysInspectionMainService, IInspectionRecordService sysInspectionRecordService, IInspectionService sysInspectionService, ISysUserRoleService sysUserRoleService, IHostingEnvironment hostingEnvironment, IScheduleService scheduleService, IImportTrans_main_recordService importTrans_main_recordService, ISysCustomizedListService sysCustomizedListService)
 {
     this._sysOrderMainService         = sysOrderMainService;
     this._InspectionAttachmentService = InspectionAttachmentService;
     this._sysOrderService             = sysOrderService;
     this._sysInspectionMainService    = sysInspectionMainService;
     this._hostingEnvironment          = hostingEnvironment;
     this._sysUserRoleService          = sysUserRoleService;
     this._sysUserService  = sysUserService;
     this._scheduleService = scheduleService;
     this._importTrans_main_recordService = importTrans_main_recordService;
     this._sysCustomizedListService       = sysCustomizedListService;
     this._sysInspectionService           = sysInspectionService;
     this._sysInspectionRecordService     = sysInspectionRecordService;
 }
        public static List <ScheduleInfo> GetFullScheduleInfoListA1(this IScheduleService s)
        {
            var r = new List <ScheduleInfo>();

            string nextReference = null;

            do
            {
                ScheduleInfo[] dst = null;
                nextReference = s.GetScheduleInfoList(null, nextReference, out dst);
                r.AddRange(dst);
            } while (!string.IsNullOrEmpty(nextReference) && !s.Test.StopRequested());

            return(r);
        }
Beispiel #40
0
 public List <SQLAdmin.Domain.Schedule> GetAllSchedule()
 {
     using (ChannelFactory <IScheduleService> channelFactory = new ChannelFactory <IScheduleService>("SQLAdmin.Timer"))
     {
         try
         {
             IScheduleService proxy = channelFactory.CreateChannel();
             return(proxy.GetAllSchedules().ToSchedules());
         }
         catch (Exception e)
         {
             throw;
         }
     }
 }
        public static List <SpecialDayGroup> GetSpecialDayGroupListA5(this IScheduleService s)
        {
            var r = new List <SpecialDayGroup>();

            string nextReference = null;

            do
            {
                SpecialDayGroup[] dst = null;
                nextReference = s.GetSpecialDayGroupList(null, nextReference, out dst);
                r.AddRange(dst);
            } while (!string.IsNullOrEmpty(nextReference) && !s.Test.StopRequested());

            return(r);
        }
 public OfficialRostersController(IAccountService accountService, IRosterService rosterService, UserManager <UserEntity> userManager,
                                  ILogger logger, IScheduleService scheduleService, IMatchDetailService matchDetailService,
                                  ISummonerInfoRepository summonerInfoRepository, IScheduleRepository scheduleRepository,
                                  IGameInfoService gameInfoService)
 {
     _accountService         = accountService ?? throw new ArgumentNullException(nameof(accountService));
     _rosterService          = rosterService ?? throw new ArgumentNullException(nameof(rosterService));
     _userManager            = userManager ?? throw new ArgumentNullException(nameof(userManager));
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _scheduleService        = scheduleService ?? throw new ArgumentNullException(nameof(scheduleService));
     _matchDetailService     = matchDetailService ?? throw new ArgumentNullException(nameof(matchDetailService));
     _summonerInfoRepository = summonerInfoRepository ?? throw new ArgumentNullException(nameof(summonerInfoRepository));
     _scheduleRepository     = scheduleRepository ?? throw new ArgumentNullException(nameof(scheduleRepository));
     _gameInfoService        = gameInfoService ?? throw new ArgumentNullException(nameof(gameInfoService));
 }
 public SqlServerMessageStore(SqlServerMessageStoreSetting setting)
 {
     _setting          = setting;
     _jsonSerializer   = ObjectContainer.Resolve <IJsonSerializer>();
     _scheduleService  = ObjectContainer.Resolve <IScheduleService>();
     _logger           = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
     _messageLogger    = ObjectContainer.Resolve <ILoggerFactory>().Create("MessageLogger");
     _messageDataTable = BuildMessageDataTable();
     _deleteMessagesByTimeAndMaxQueueOffsetFormat = "delete from [" + _setting.MessageTable + "] where Topic = '{0}' and QueueId = {1} and QueueOffset < {2} and StoredTime < '{3}'";
     _selectMaxMessageOffsetSQL     = "select max(MessageOffset) from [" + _setting.MessageTable + "]";
     _selectAllMessageSQL           = "select * from [" + _setting.MessageTable + "] where MessageOffset > {0} order by MessageOffset asc";
     _batchLoadMessageSQLFormat     = "select * from [" + _setting.MessageTable + "] where MessageOffset >= {0} and MessageOffset < {1}";
     _batchLoadQueueIndexSQLFormat  = "select QueueOffset,MessageOffset from [" + _setting.MessageTable + "] where Topic = '{0}' and QueueId = {1} and QueueOffset >= {2} and QueueOffset < {3}";
     _getMessageOffsetByQueueOffset = "select MessageOffset from [" + _setting.MessageTable + "] where Topic = '{0}' and QueueId = {1} and QueueOffset = {2}";
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="apiBaseUrl"></param>
 /// <param name="primarySubscriptionKey"></param>
 /// <param name="secondarySubscriptionKey"></param>
 public FantasyDataClient(Uri apiBaseUrl, string primarySubscriptionKey, string secondarySubscriptionKey)
 {
     DailyFantasyService     = new DailyFantasyService(apiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
     SeasonService           = new SeasonService(apiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
     NewsService             = new NewsService(apiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
     PlayerGameStatService   = new PlayerGameStatService(apiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
     PlayerSeasonStatService = new PlayerSeasonStatService(apiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
     TeamDefenseService      = new TeamDefenseService(apiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
     GameService             = new GameService(apiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
     InjuryService           = new InjuryService(apiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
     StadiumService          = new StadiumService(apiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
     TeamService             = new TeamService(apiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
     BoxScoreService         = new BoxScoreService(apiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
     PlayerService           = new PlayerService(apiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
     ScheduleService         = new ScheduleService(apiBaseUrl.AbsoluteUri, primarySubscriptionKey, secondarySubscriptionKey);
 }
Beispiel #45
0
 public SuspendedPullRequestManager()
 {
     _scheduleService            = IocManager.Instance.Resolve <IScheduleService>();
     _queueStore                 = IocManager.Instance.Resolve <IQueueStore>();
     _logger                     = IocManager.Instance.Resolve <ILoggerFactory>().Create(GetType().FullName);
     _notifyQueue                = new BlockingCollection <NotifyItem>(new ConcurrentQueue <NotifyItem>());
     _notifyMessageArrivedWorker = new Worker("NotifyMessageArrived", () =>
     {
         var notifyItem = _notifyQueue.Take();
         if (notifyItem == null)
         {
             return;
         }
         NotifyMessageArrived(notifyItem.Topic, notifyItem.QueueId, notifyItem.QueueOffset);
     });
 }
Beispiel #46
0
 public DefaultProcessingEventProcessor(IPublishedVersionStore publishedVersionStore, IMessageDispatcher dispatcher, IOHelper ioHelper, ILoggerFactory loggerFactory, IScheduleService scheduleService)
 {
     _mailboxDict = new ConcurrentDictionary <string, ProcessingEventMailBox>();
     _problemAggregateRootMailBoxDict = new ConcurrentDictionary <string, ProcessingEventMailBox>();
     _publishedVersionStore           = publishedVersionStore;
     _dispatcher                      = dispatcher;
     _ioHelper                        = ioHelper;
     _logger                          = loggerFactory.Create(GetType().FullName);
     _scheduleService                 = scheduleService;
     _scanInactiveMailBoxTaskName     = "CleanInactiveProcessingEventMailBoxes_" + DateTime.Now.Ticks + new Random().Next(10000);
     _processProblemAggregateTaskName = "ProcessProblemAggregate_" + DateTime.Now.Ticks + new Random().Next(10000);
     _timeoutSeconds                  = ENodeConfiguration.Instance.Setting.AggregateRootMaxInactiveSeconds;
     Name = ENodeConfiguration.Instance.Setting.DomainEventProcessorName;
     _scanExpiredAggregateIntervalMilliseconds    = ENodeConfiguration.Instance.Setting.ScanExpiredAggregateIntervalMilliseconds;
     _processProblemAggregateIntervalMilliseconds = ENodeConfiguration.Instance.Setting.ProcessProblemAggregateIntervalMilliseconds;
 }
Beispiel #47
0
        public SchedulesController(IScheduleService scheduleService,
                                   IFlightStateService flightStateService,
                                   IFlightService flightService,

                                   IMapper <ScheduleDTO, ScheduleModel> scheduleMaper,
                                   IMapper <ScheduleDetailsDTO, ScheduleDetailsImportModel> scheduleDetailsMaper,
                                   IMapper <FlightDTO, FlightModel> flightMaper)
        {
            this._scheduleService    = scheduleService;
            this._flightStateService = flightStateService;
            this._flightService      = flightService;

            this._scheduleMaper        = scheduleMaper;
            this._scheduleDetailsMaper = scheduleDetailsMaper;
            this._flightMaper          = flightMaper;
        }
Beispiel #48
0
 public Producer(string id, ProducerSetting setting)
 {
     if (id == null)
     {
         throw new ArgumentNullException("id");
     }
     Id      = id;
     Setting = setting ?? new ProducerSetting();
     _topicQueueCountDict = new ConcurrentDictionary <string, int>();
     _taskIds             = new List <int>();
     _remotingClient      = new SocketRemotingClient(Setting.BrokerAddress, Setting.BrokerPort);
     _scheduleService     = ObjectContainer.Resolve <IScheduleService>();
     _binarySerializer    = ObjectContainer.Resolve <IBinarySerializer>();
     _queueSelector       = ObjectContainer.Resolve <IQueueSelector>();
     _logger = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
 }
Beispiel #49
0
 public SocketRemotingClient(string address, int port, ISocketEventListener socketEventListener = null)
 {
     _lockObject1         = new object();
     _lockObject2         = new object();
     _address             = address;
     _port                = port;
     _socketEventListener = socketEventListener;
     _clientSocket        = new ClientSocket(new RemotingClientSocketEventListener(this));
     _responseFutureDict  = new ConcurrentDictionary <long, ResponseFuture>();
     _messageQueue        = new BlockingCollection <byte[]>(new ConcurrentQueue <byte[]>());
     _scheduleService     = ObjectContainer.Resolve <IScheduleService>();
     _worker              = new Worker("SocketRemotingClient.HandleMessage", HandleMessage);
     _logger              = ObjectContainer.Resolve <ILoggerFactory>()
                            .Create(GetType()
                                    .FullName);
 }
        public void SetUp()
        {
            List <ScheduleDataModelWp> schedule = new List <ScheduleDataModelWp>()
            {
                new ScheduleDataModelWp()
                {
                    Beginning = new DateTime(2019, 02, 25), PerformanceId = 176, Title = "Таємниця лісовичка", MainImage = "https://lvivpuppet.com/wp-content/uploads/2019/01/lisovychok_resize.jpg", redirectToTicket = "https://ticketclub.com.ua/event/4984/?session=10610"
                },
                new ScheduleDataModelWp()
                {
                    Beginning = new DateTime(2019, 02, 26), PerformanceId = 65, Title = "Садок вишневий", MainImage = "https://lvivpuppet.com/wp-content/uploads/2018/10/sadok_resize.jpg", redirectToTicket = "https://ticketclub.com.ua/eventsession/10591/"
                },
                new ScheduleDataModelWp()
                {
                    Beginning = new DateTime(2019, 02, 28), PerformanceId = 149, Title = "Лисичка, Котик і Півник", MainImage = "https://lvivpuppet.com/wp-content/uploads/2018/10/kotyk_pivnyk_resize.jpg", redirectToTicket = "https://ticketclub.com.ua/event/4986/?session=10807"
                },
                new ScheduleDataModelWp()
                {
                    Beginning = new DateTime(2019, 03, 03), PerformanceId = 104, Title = "Тарас", MainImage = "https://lvivpuppet.com/wp-content/uploads/2018/06/Taras_resize.jpg", redirectToTicket = "https://ticketclub.com.ua/event/4892/?session=10620"
                },
                new ScheduleDataModelWp()
                {
                    Beginning = new DateTime(2019, 02, 21), PerformanceId = 48, Title = "А де ж п'яте", MainImage = "https://lvivpuppet.com/wp-content/uploads/2018/10/Where-is-5th_resize.jpg", redirectToTicket = "https://ticketclub.com.ua/event/4985/?session=10796"
                },
                new ScheduleDataModelWp()
                {
                    Beginning = new DateTime(2019, 02, 22), PerformanceId = 104, Title = "Тарас", MainImage = "https://lvivpuppet.com/wp-content/uploads/2018/06/Taras_resize.jpg", redirectToTicket = "https://ticketclub.com.ua/event/4892/?session=10620"
                },
            };

            scheduleMock   = new Mock <IScheduleRepository>();
            unitOfWorkMock = new Mock <ITheaterScheduleUnitOfWork>();

            object response = schedule;

            memoryMock = new Mock <IMemoryCache>();
            memoryMock
            .Setup(x => x.TryGetValue(It.IsAny <object>(), out response))
            .Returns(true);

            scheduleMock
            .Setup(s => s.GetListPerformancesByDateRange(languageCode, startDate, endDate))
            .Returns(schedule);

            scheduleService = new ScheduleServiceWp(unitOfWorkMock.Object, scheduleMock.Object, memoryMock.Object);
        }
Beispiel #51
0
        public Producer(string id, ProducerSetting setting)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }
            Id      = id;
            Setting = setting ?? new ProducerSetting();

            _lockObject        = new object();
            _taskIds           = new List <int>();
            _topicQueueIdsDict = new ConcurrentDictionary <string, IList <int> >();
            _remotingClient    = new SocketRemotingClient(Setting.BrokerProducerIPEndPoint, null, this);
            _scheduleService   = ObjectContainer.Resolve <IScheduleService>();
            _queueSelector     = ObjectContainer.Resolve <IQueueSelector>();
            _logger            = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
        }
Beispiel #52
0
 public AdminController(RoleManager <IdentityRole> roleManager,
                        IUserService userService,
                        IStudentService studentService,
                        ITeacherService teacherService,
                        IParentService parentService,
                        IClassService classService,
                        IScheduleService scheduleService,
                        IRepository <Subject> repoSubject) : base(roleManager)
 {
     _userService     = userService;
     _studentService  = studentService;
     _teacherService  = teacherService;
     _parentService   = parentService;
     _classService    = classService;
     _scheduleService = scheduleService;
     _repoSubject     = repoSubject;
 }
        public static string HelperScheduleiCalTimePeriodsGenerationA17(this IScheduleService s, uint numberPeriodsPerDay, bool isExtendedRecurrenceSupported)
        {
            ICalendar iCalendar   = new ICalendar();
            int       startMinute = 1;

            System.DateTime startDate = System.DateTime.Now;

            if (isExtendedRecurrenceSupported)
            {
                startDate = new System.DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month, System.DateTime.Now.Day, 0, startMinute, 0);
            }
            else
            {
                startDate = new System.DateTime(1970, System.DateTime.Now.Month, System.DateTime.Now.Day, 0, startMinute, 0);
            }
            System.DateTime endDate = startDate.AddMinutes(1);
            for (var k = 1; k <= numberPeriodsPerDay; k++)
            {
                if (isExtendedRecurrenceSupported)
                {
                    VEvent vEvent = new VEvent();
                    vEvent.Summary = "required number of time periods per day";
                    vEvent.SetDates(startDate, endDate);
                    vEvent.Rrule = "FREQ=DAILY";
                    vEvent.Uid   = UIDiCalendarGenerationA6(s).ToString();

                    iCalendar.AddVEvent(vEvent);
                }
                else
                {
                    VEvent vEvent = new VEvent();
                    vEvent.Summary = "required number of time periods per day";
                    startMinute    = endDate.Minute + 1;

                    vEvent.SetDates(startDate, endDate);
                    vEvent.Rrule = "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR";
                    vEvent.Uid   = UIDiCalendarGenerationA6(s).ToString();

                    iCalendar.AddVEvent(vEvent);
                }
                startDate = endDate.AddMinutes(1);
                endDate   = startDate.AddMinutes(1);
            }
            return(iCalendar.ICalendarValue);
        }
 public SuspendedPullRequestManager()
 {
     _scheduleService = ObjectContainer.Resolve <IScheduleService>();
     _queueStore      = ObjectContainer.Resolve <IQueueStore>();
     _logger          = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
     _notifyQueue     = new BlockingCollection <NotifyItem>(new ConcurrentQueue <NotifyItem>());
     _taskFactory     = new TaskFactory(new LimitedConcurrencyLevelTaskScheduler(Environment.ProcessorCount));
     _checkBlockingPullRequestTaskName = string.Format("{0}.CheckBlockingPullRequest", this.GetType().Name);
     _notifyMessageArrivedWorker       = new Worker(string.Format("{0}.NotifyMessageArrived", this.GetType().Name), () =>
     {
         var notifyItem = _notifyQueue.Take();
         if (notifyItem == null)
         {
             return;
         }
         NotifyMessageArrived(notifyItem.Topic, notifyItem.QueueId, notifyItem.QueueOffset);
     });
 }
Beispiel #55
0
        public SocketRemotingClient(EndPoint serverEndPoint, SocketSetting setting = null, EndPoint localEndPoint = null)
        {
            serverEndPoint.CheckNotNull("serverEndPoint");

            _serverEndPoint           = serverEndPoint;
            _localEndPoint            = localEndPoint;
            _setting                  = setting ?? new SocketSetting();
            _receiveDataBufferPool    = new BufferPool(_setting.ReceiveDataBufferSize, _setting.ReceiveDataBufferPoolSize);
            _clientSocket             = new ClientSocket(_serverEndPoint, _localEndPoint, _setting, _receiveDataBufferPool, HandleReplyMessage);
            _responseFutureDict       = new ConcurrentDictionary <long, ResponseFuture>();
            _replyMessageQueue        = new BlockingCollection <byte[]>(new ConcurrentQueue <byte[]>());
            _responseHandlerDict      = new Dictionary <int, IResponseHandler>();
            _connectionEventListeners = new List <IConnectionEventListener>();
            _scheduleService          = IocManager.Instance.Resolve <IScheduleService>();
            _logger = IocManager.Instance.Resolve <ILoggerFactory>().Create(GetType().FullName);

            RegisterConnectionEventListener(new ConnectionEventListener(this));
        }
        public ScheduleViewModel(IScheduleService scheduleService, INavigationService navigationService)
        {
            _scheduleService = scheduleService;

            _navigationService = navigationService;

            this.PageTitle = PageTitleName;

            SelectedDate = DateTime.Now;

            WeekDaysView = new ObservableCollection <DateCellViewModel>();

            SheduleList = new ObservableCollection <ScheduleItemViewModel>();

            DaySelectCommand = new Command(ExecuteDaySelectCommand, (x) => !IsBusy);

            ScheduleSelectCommand = new Command <int>(async(x) => await ExecuteScheduleSelectCommand(x), (x) => !IsBusy);
        }
Beispiel #57
0
        public Producer(string id, ProducerSetting setting)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }
            Id      = id;
            Setting = setting ?? new ProducerSetting();

            _lockObject        = new object();
            _topicQueueIdsDict = new ConcurrentDictionary <string, IList <int> >();
            _remotingClient    = new SocketRemotingClient(Id + ".RemotingClient", Setting.BrokerAddress, Setting.LocalAddress);
            _scheduleService   = ObjectContainer.Resolve <IScheduleService>();
            _queueSelector     = ObjectContainer.Resolve <IQueueSelector>();
            _logger            = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);

            _remotingClient.RegisterConnectionEventListener(new ConnectionEventListener(this));
        }
Beispiel #58
0
        public SocketRemotingClient(EndPoint serverEndPoint, SocketSetting setting = null, EndPoint localEndPoint = null)
        {
            Ensure.NotNull(serverEndPoint, "serverEndPoint");

            _serverEndPoint                   = serverEndPoint;
            _localEndPoint                    = localEndPoint;
            _setting                          = setting ?? new SocketSetting();
            _receiveDataBufferPool            = new BufferPool(_setting.ReceiveDataBufferSize, _setting.ReceiveDataBufferPoolSize);
            _clientSocket                     = new ClientSocket(_serverEndPoint, _localEndPoint, _setting, _receiveDataBufferPool, HandleServerMessage);
            _responseFutureDict               = new ConcurrentDictionary <long, ResponseFuture>();
            _replyMessageQueue                = new BlockingCollection <byte[]>(new ConcurrentQueue <byte[]>());
            _responseHandlerDict              = new Dictionary <int, IResponseHandler>();
            _remotingServerMessageHandlerDict = new Dictionary <int, IRemotingServerMessageHandler>();
            _connectionEventListeners         = new List <IConnectionEventListener>();
            _scheduleService                  = DependencyManage.Resolve <IScheduleService>();

            RegisterConnectionEventListener(new ConnectionEventListener(this));
        }
Beispiel #59
0
 public OrdersController(
     IOrderService service,
     IAccountService accountService,
     IHubContext <NotifyHub> hubContext,
     UserManager <AppUser> userManager,
     IDishService dishService,
     IDishCategoryService dishCatService,
     IScheduleService scheduleService
     )
 {
     _service         = service;
     _accountService  = accountService;
     _hubContext      = hubContext;
     _userManager     = userManager;
     _dishService     = dishService;
     _dishCatService  = dishCatService;
     _scheduleService = scheduleService;
 }
Beispiel #60
0
        public ChunkManager(string name, ChunkManagerConfig config, string relativePath = null)
        {
            Ensure.NotNull(name, "name");
            Ensure.NotNull(config, "config");

            Name    = name;
            _config = config;
            if (string.IsNullOrEmpty(relativePath))
            {
                _chunkPath = _config.BasePath;
            }
            else
            {
                _chunkPath = Path.Combine(_config.BasePath, relativePath);
            }
            _chunks          = new ConcurrentDictionary <int, Chunk>();
            _scheduleService = ObjectContainer.Resolve <IScheduleService>();
        }