public JournalOutService(IGDetailPlanetService gDetailPlanetService, IGGeometryPlanetService geometryPlanetService, ISystemService systemService, IUTaskService uTaskService, IUReportService uReportService, IUSpyService uSpyService, IMothershipService mothershipService, ISpriteImages spriteImages, ISynchronizer synchronizer, IMapAdressService mapAdressService, IUMotherJumpService motherJumpService, IGameUserService gameUserService, IStoreService storeService, ILocalizerService localizer) { _gDetailPlanetService = gDetailPlanetService; _geometryPlanetService = geometryPlanetService; _systemService = systemService; _uTaskService = uTaskService; _uReportService = uReportService; _uSpyService = uSpyService; _mothershipService = mothershipService; _spriteImages = spriteImages; _synchronizer = synchronizer; _mapAdressService = mapAdressService; _motherJumpService = motherJumpService; _gameUserService = gameUserService; _storeService = storeService; _localizer = localizer; }
public void Setup() { _blockTree = Substitute.For <IBlockTree>(); _peerPool = Substitute.For <IEthSyncPeerPool>(); _synchronizer = Substitute.For <ISynchronizer>(); _syncServer = new SyncServer(new StateDb(), new StateDb(), _blockTree, NullReceiptStorage.Instance, TestSealValidator.AlwaysValid, _peerPool, _synchronizer, new SyncConfig(), LimboLogs.Instance); }
public SyncExOzProducts(ICommandSender commandSender, IConsoleLogger logger, ISynchronizer <ProductOptionList, SessionList> productSessionSynchronizer) { _commandSender = commandSender; _logger = logger; _productSessionSynchronizer = productSessionSynchronizer; }
protected Engine(Model model, EngineConfiguration config) { _config = config; _synchronizer = _config.CreateSynchronizer(); _authorizer = _config.CreateAuthorizer(); Configure(model); if (_config.SnapshotBehavior == SnapshotBehavior.AfterRestore) { _log.Info("Starting snaphot job on threadpool"); ThreadPool.QueueUserWorkItem(_ => CreateSnapshot()); //Give the snapshot thread a chance to start and aquire the readlock Thread.Sleep(TimeSpan.FromMilliseconds(10)); } if (_config.PersistenceMode == PersistenceMode.SnapshotPerTransaction) { CommandExecuted += (s, e) => CreateSnapshot(); } Core.Config.Engines.AddEngine(config.Location.OfJournal, this); }
public void Register(ISynchronizer synchronizer) { if (synchronizer == null) return; _synchronizers.Add(synchronizer); }
public MainViewModel(IStorage storage, ISynchronizer synchronizer, IMessageService messageService, INavigationService navigationService) { this.storage = storage; this.synchronizer = synchronizer; this.messageService = messageService; this.navigationService = navigationService; Bookmarks = new ObservableCollection<BookmarkViewModel>(); History = new ObservableCollection<BookmarkViewModel>(); Tabs = new ObservableCollection<BookmarkViewModel>(); Refresh = new RelayCommand(RefreshAsync); SelectFolder = new RelayCommand(SelectFolderForCurrentCategory); Search = new RelayCommand(() => navigationService.GoToPage("SearchPage.xaml")); // Listen to events of the synchronizer component this.synchronizer.RefreshWeaveDataCompleted += new RefreshWeaveDataCompletedEventHandler(RefreshCompleted); this.synchronizer.RefreshWeaveDataProgressChanged += new ProgressChangedEventHandler(RefreshProgressChanged); // Load the bookmarks, history and opened tabs from durable storage this.storage.LoadBookmarks(); this.storage.LoadHistory(); this.storage.LoadTabs(); UpdateData(); }
public LoginPresenter(ILoginView view, IServerCommunicator serverCommunicator, IMobileConfigurationReader mobileConfigurationReader, INavigationManager navigationManager, IFileSystem fileSystem, IVaultRepositoryFactory vaultRepositoryFactory, ISynchronizer synchronizer, IAlertDisplayer alertDisplayer, ISecureStringConverter secureStringConverter, IApplicationContext applicationContext) { this.View = view; this.MobileConfigurationReader = mobileConfigurationReader; this.NavigationManager = navigationManager; this.FileSystem = fileSystem; this.Synchronizer = synchronizer; this.VaultRepositoryFactory = vaultRepositoryFactory; this.AlertDisplayer = alertDisplayer; this.SecureStringConverter = secureStringConverter; this.ApplicationContext = applicationContext; var config = MobileConfigurationReader.GetConfiguration(); this.View.SyncButtonVisible = config.ApplicationMode == ApplicationMode.Client; var repository = VaultRepositoryFactory.CreateInstance(); var vaults = repository.GetAllVaultNames(); this.View.VaultNames = vaults; this.View.SelectedVaultName = vaults.FirstOrDefault(); this.View.Login += OnLogin; this.View.NavigateToConfiguration += OnNavigateToConfiguration; this.View.Sync += OnSync; this.Synchronizer.StatusUpdate += (message) => this.View.ActivityIndicatorText = message; this.View.Initialize += OnInitialize; }
public SyncExOzOperators(ICommandSender commandSender, IConsoleLogger logger, ISynchronizer <SessionList, ProductList> productSynchronizer) { _commandSender = commandSender; _logger = logger; _productSynchronizer = productSynchronizer; }
private void Synchronize(ISynchronizer synchronizer) { while (!token.IsCancellationRequested) { synchronizer.Sync(); } }
public void UpdateOptions(Options options) { _profileName = options.Name; _synchronizer = _synchronizerFactory.CreateSynchronizer(options); _interval = TimeSpan.FromMinutes(options.SynchronizationIntervalInMinutes); _inactive = options.Inactive; }
public SynchronizationJob( ISynchronizer synchronizer, ILogger <SynchronizationJob> logger) { _synchronizer = synchronizer; _logger = logger; }
public ContactAndDistListSynchronizer( IPartialSynchronizer <string, DateTime, WebResourceName, string, ICardDavRepositoryLogger> contactSynchronizer, ISynchronizer <DistributionListSychronizationContext> distributionListSynchronizer, EmailAddressCacheDataAccess emailAddressCacheDataAccess, IEntityRepository <WebResourceName, string, vCard, ICardDavRepositoryLogger> loggingCardDavRepositoryDecorator, IOutlookSession outlookSession) { if (contactSynchronizer == null) { throw new ArgumentNullException(nameof(contactSynchronizer)); } if (distributionListSynchronizer == null) { throw new ArgumentNullException(nameof(distributionListSynchronizer)); } if (loggingCardDavRepositoryDecorator == null) { throw new ArgumentNullException(nameof(loggingCardDavRepositoryDecorator)); } if (outlookSession == null) { throw new ArgumentNullException(nameof(outlookSession)); } _contactSynchronizer = contactSynchronizer; _distributionListSynchronizer = distributionListSynchronizer; _emailAddressCacheDataAccess = emailAddressCacheDataAccess; _loggingCardDavRepositoryDecorator = loggingCardDavRepositoryDecorator; _outlookSession = outlookSession; }
/// <summary> /// Tracks the <see cref="target" /> for synchronization /// </summary> /// <param name="referencehe reference.</param> /// <remarks>The <see cref="target">reference's</see> synchronize-able child references are also tracked recursively</remarks> /// <exception cref="ArgumentNullException">reference</exception> public void Synchronize(object reference) { if (reference == null) { throw new ArgumentNullException(nameof(reference)); } SourceSynchronizer sourceSynchronizer = _referencePool.GetSyncSource(reference); if (sourceSynchronizer == null) { if (_pendingForSynchronization.Contains(reference)) { return; } Type referenceType = reference.GetType(); if (referenceType.HasElementType) { _typeEncoder.RegisterType(referenceType.GetElementType()); } _typeEncoder.RegisterType(referenceType); ISynchronizer sourceFactory = Settings.Synchronizers.FindSynchronizerByType(referenceType); var referenceId = _referenceIdIncrementer++; _pendingForSynchronization.Add(reference); sourceSynchronizer = sourceFactory.Synchronize(this, referenceId, reference); _pendingForSynchronization.Remove(reference); _referencePool.AddSyncSource(sourceSynchronizer); _pendingTrackedSyncSourceObjects.Add(sourceSynchronizer); } }
private static SynchronizerDto MapSynchronizer(ISynchronizer oldSynchronizer, string userId) { var userPlayerIds = oldSynchronizer.Players.Where(x => x.UserId == userId).Select(x => x.Id); var userTeams = oldSynchronizer.Players.Where(x => x.UserId == userId && x.Team != null).Select(x => x.Team).Distinct().ToList(); var tileSet = oldSynchronizer.TileSet; return(new SynchronizerDto() { ChangedActors = oldSynchronizer.ChangedActors.Select(x => MapActor(x, userTeams.Contains(x.Team) || userPlayerIds.Contains(x.OwnerId))), DeletedActors = oldSynchronizer.DeletedActors, ChangedDecorations = oldSynchronizer.ChangedDecorations.Select(x => MapDecoration(x, userTeams.Contains(x.Team) || userPlayerIds.Contains(x.OwnerId))), DeletedDecorations = oldSynchronizer.DeletedDecorations, ChangedEffects = oldSynchronizer.ChangedEffects.Select(x => MapEffect(x)), DeletedEffects = oldSynchronizer.DeletedEffects, Players = oldSynchronizer.Players.Select(x => new PlayerDto() { Id = x.Id, UserId = x.UserId, KeyActorsSync = x.KeyActorsSync, Status = (PlayerStatus)(int)x.Status, Team = x.Team, }), ChangedTiles = oldSynchronizer.ChangedTiles.Select(x => MapTile(x, userTeams.Contains(x.Team) || userPlayerIds.Contains(x.OwnerId))), TempActor = oldSynchronizer.TempActor, TempDecoration = oldSynchronizer.TempDecoration, TilesetHeight = tileSet.GetLength(1), TilesetWidth = tileSet.GetLength(0) }); }
public CommandCenter(IMothershipService mothershipService, IGDetailPlanetService gDetailPlanetService, ISynchronizer synchronizer, IStoreService storeService, IGameUserService gameUserService, IUMotherJumpService motherJumpService, ITurels turels) : base(mothershipService, gDetailPlanetService, synchronizer, storeService, gameUserService, motherJumpService) { _turels = turels; }
public SyncManager(bool streamingEnabled, ISynchronizer synchronizer, IPushManager pushManager, ISSEHandler sseHandler, INotificationManagerKeeper notificationManagerKeeper, ITelemetryRuntimeProducer telemetryRuntimeProducer, IStatusManager statusManager, ITasksManager tasksManager, IWrapperAdapter wrapperAdapter, ITelemetrySyncTask telemetrySyncTask, ISplitLogger log = null) { _streamingEnabled = streamingEnabled; _synchronizer = synchronizer; _pushManager = pushManager; _sseHandler = sseHandler; _log = log ?? WrapperAdapter.GetLogger(typeof(Synchronizer)); _telemetryRuntimeProducer = telemetryRuntimeProducer; _statusManager = statusManager; _tasksManager = tasksManager; _wrapperAdapter = wrapperAdapter; _telemetrySyncTask = telemetrySyncTask; _sseHandler.ActionEvent += OnProcessFeedbackSSE; notificationManagerKeeper.ActionEvent += OnProcessFeedbackSSE; _shutdownCancellationTokenSource = new CancellationTokenSource(); }
protected Engine(Model model, EngineConfiguration config) { _config = config; _synchronizer = _config.CreateSynchronizer(); _authorizer = _config.CreateAuthorizer(); IsolatedReturnTypes.AddRange(_config.IsolatedTypes); _config.Isolation.Commands.SetFormatter(_config.CreateFormatter(FormatterUsage.Messages)); _config.Isolation.ReturnValues.SetFormatter(_config.CreateFormatter(FormatterUsage.Results)); Configure(model); if (_config.SnapshotBehavior == SnapshotBehavior.AfterRestore) { Logger.Info("Starting snaphot job on threadpool"); ThreadPool.QueueUserWorkItem(_ => CreateSnapshot()); //Give the snapshot thread a chance to start and aquire the readlock Thread.Sleep(TimeSpan.FromMilliseconds(10)); } if (_config.PersistenceMode == PersistenceMode.SnapshotPerTransaction) { CommandExecuted += (s, e) => CreateSnapshot(); } model.Starting(this); Core.Config.Engines.AddEngine(config.JournalPath, this); }
public static List <string> SyncOutlookToCalDav_CalDavIsEmpty( IEntityRelationDataAccess <string, DateTime, Uri, string> entityRelationDataAccess = null, Action <Options> optionsModifier = null) { var calDavEvents = new List <string>(); ICalDavDataAccess calDavDataAccess = MockRepository.GenerateMock <ICalDavDataAccess>(); calDavDataAccess .Expect(r => r.GetEvents(null)) .IgnoreArguments() .Return(Task.FromResult <IReadOnlyList <EntityIdWithVersion <Uri, string> > > ( new EntityIdWithVersion <Uri, string>[] { })); calDavDataAccess .Expect(r => r.CreateEntity(null)) .IgnoreArguments() .Return(Task.FromResult( EntityIdWithVersion.Create(new Uri("http://bla.com"), "blubb"))) .WhenCalled(a => calDavEvents.Add((string)a.Arguments[0])); ISynchronizer synchronizer = CreateEventSynchronizer( SynchronizationMode.ReplicateOutlookIntoServer, calDavDataAccess, entityRelationDataAccess, optionsModifier); WaitForTask(synchronizer.Synchronize()); return(calDavEvents); }
public static string SyncOutlookToCalDav_EventsExistsInCalDav(string existingEventData, IEntityRelationDataAccess <string, DateTime, Uri, string> entityRelationDataAccess = null) { string roundTrippedData = null; ICalDavDataAccess calDavDataAccess = MockRepository.GenerateMock <ICalDavDataAccess>(); var entityUri = new Uri("/e1", UriKind.Relative); calDavDataAccess .Expect(r => r.GetEvents(null)) .IgnoreArguments() .Return(Task.FromResult <IReadOnlyList <EntityIdWithVersion <Uri, string> > > ( new[] { EntityIdWithVersion.Create(entityUri, "v1") })); calDavDataAccess .Expect(r => r.GetEntities(Arg <ICollection <Uri> > .List.Equal(new[] { entityUri }))) .Return(Task.FromResult <IReadOnlyList <EntityWithVersion <Uri, string> > > ( new[] { EntityWithVersion.Create(entityUri, existingEventData) })); calDavDataAccess .Expect(r => r.UpdateEntity(new Uri("http://bla.com"), null)) .IgnoreArguments() .Return(Task.FromResult <EntityIdWithVersion <Uri, string> > ( EntityIdWithVersion.Create(new Uri("http://bla.com"), "blubb"))) .WhenCalled(a => { roundTrippedData = (string)a.Arguments[1]; }); ISynchronizer synchronizer = OutlookTestContext.CreateEventSynchronizer( SynchronizationMode.ReplicateOutlookIntoServer, calDavDataAccess, entityRelationDataAccess); WaitForTask(synchronizer.Synchronize()); return(roundTrippedData); }
protected AbstractSynchronizedRunner(Action <T> job, ISynchronizer areRunnerAwaiter, ISynchronizer areSenderAwaiter) { _job = job; RunnerAwaiter = areRunnerAwaiter; SenderAwaiter = areSenderAwaiter; Task.Run(Run); }
public void UpdateOptions (Options options) { _profileName = options.Name; _synchronizer = _synchronizerFactory.CreateSynchronizer (options); _interval = TimeSpan.FromMinutes (options.SynchronizationIntervalInMinutes); _inactive = options.Inactive; }
public UserSyncService(Data.PMN.DataContext db, IConfiguration config, ILogger <UserSyncService> logger, ISynchronizer synchronizer) { Running = false; Db = db; Logger = logger; Config = config; Synchronizer = synchronizer; }
public SyncService(ILogger logger, ITrigger trigger, ISynchronizer synchronizer) { _logger = logger; _trigger = trigger; _synchronizer = synchronizer; _trigger.SyncRequested += (sender, args) => Synchronize(); }
public Synchronizer(ICommandSender commandSender, ISettings settings, ISynchronizer hubspotSynchronizer, ISynchronizer hohoDataSynchronizer, ISynchronizer valueRetailDataSynchronizer ) { _settings = settings; _commandSender = commandSender; _hubspotSynchronizer = hubspotSynchronizer; }
public SyncSetupDialog() { this.InitializeComponent(); this.synchronizer = new OneDriveSynchronizer(this.onedriveClient); this.Opened += this.DialogOpened; this.Closing += this.DialogClosing; }
public SplitsWorker(ISplitCache splitCache, ISynchronizer synchronizer, ISplitLogger log = null) { _splitCache = splitCache; _synchronizer = synchronizer; _log = log ?? WrapperAdapter.GetLogger(typeof(SplitsWorker)); }
internal RegistrationRepository(string file, ISynchronizer synchronizer, IFileReader reader, IFileWriter writer) { _synchronizer = synchronizer; _reader = reader; _writer = writer; _serializer = new JavaScriptSerializer(); _file = file; }
public SplitsWorker(ISplitCache splitCache, ISynchronizer synchronizer, ISplitLogger log = null) { _splitCache = splitCache; _synchronizer = synchronizer; _log = log ?? WrapperAdapter.GetLogger(typeof(SplitsWorker)); _queue = new BlockingCollection <long>(new ConcurrentQueue <long>()); }
public MainJob ( ILogger <MainJob> logger, ISynchronizer synchronizer ) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _synchronizer = synchronizer ?? throw new ArgumentNullException(nameof(synchronizer)); }
public SegmentsWorker(ISynchronizer synchronizer, ITasksManager tasksManager, ISplitLogger log = null) { _synchronizer = synchronizer; _tasksManager = tasksManager; _log = log ?? WrapperAdapter.GetLogger(typeof(SegmentsWorker)); _queue = new BlockingCollection <SegmentQueueDto>(new ConcurrentQueue <SegmentQueueDto>()); }
public static void Synchronizer_ItemEnabled(ISynchronizer <TState> syncronizer) { Mock_SynchronizerItem <TState> item_1 = new Mock_SynchronizerItem <TState>(); syncronizer.Add(item_1); AssertState(syncronizer, 1, 0, false); item_1.Enable(); AssertState(syncronizer, 1, 1, true); }
public DelaySynchronizer(ISynchronizer operand, int millisecondsDelay) : base(operand) { if (millisecondsDelay < -1) { throw new ArgumentOutOfRangeException(nameof(millisecondsDelay), Resources.GetString("Synchronizable_Delay_InvalidMillisecondsDelay")); } m_millisecondsDelay = millisecondsDelay; }
public PauseSynchronizer(ISynchronizer operand, int millisecondsPause) : base(operand) { if (millisecondsPause < -1) { throw new ArgumentOutOfRangeException(nameof(millisecondsPause), Resources.GetString("Synchronizable_Pause_InvalidMillisecondsPause")); } m_millisecondsPause = millisecondsPause; }
/// <summary> /// Initializes a new instance of the <see cref="TimestampCacheProvider"/> class. /// </summary> /// <param name="storage">The storage for this cacheprovider.</param> /// <param name="network">The network.</param> /// <param name="synchronizer">The synchronizer.</param> /// <param name="areWeCachingThis">The are we caching this.</param> public TimestampCacheProvider(IStructuredStorage storage, INetworkInformation network, ISynchronizer synchronizer, Func<Uri, bool> areWeCachingThis = null) { Contract.Requires<ArgumentNullException>(storage != null, "storage"); Contract.Requires<ArgumentNullException>(network != null, "network"); Contract.Requires<ArgumentNullException>(synchronizer != null, "synchronizer"); this.network = network; this.storage = storage; this.synchronizer = synchronizer; this.areWeCachingThis = areWeCachingThis ?? (u => true); }
protected bool SynchronizeInternal(IInitialSyncStateCreationStrategy<string, int, string, string, int, string> strategy) { _synchronizer = new Synchronizer<string, int, string, string, int, string> ( _synchronizerSetup, strategy, NullTotalProgressFactory.Instance, EqualityComparer<string>.Default, EqualityComparer<string>.Default, MockRepository.GenerateMock<IExceptionLogger>() ); return _synchronizer.Synchronize().Result; }
public AutoRegistrationPlugin(ISynchronizer synchronizer, IRegistrationRepository registrationRepository, IPageRepository pageRepository, IPageFormatter pageFormatter, IEntryFormatter entryFormatter, INotificationSender notificationSender, ILogger logger, IPluginConfiguration configuration, IFileReader fileReader, ISettings settings) { _synchronizer = synchronizer; _fileReader = fileReader; _settings = settings; _registrationRepository = registrationRepository; _pageRepository = pageRepository; _pageFormatter = pageFormatter; _entryFormatter = entryFormatter; _notificationSender = notificationSender; _logger = logger; _configuration = configuration; }
public SyncRefreshActivePart([NotNull] IServiceProvider serviceProvider) : base(serviceProvider) { _synchronizer = ServiceProvider.GetRequiredService<ISynchronizer>(); _eventBroker = ServiceProvider.GetRequiredService<IEventBroker>(); }
public SyncNotificationActivePart([NotNull] IServiceProvider serviceProvider) : base(serviceProvider) { _synchronizer = ServiceProvider.GetService<ISynchronizer>(); }
public AutoSyncActivePart([NotNull] IServiceProvider serviceProvider) : base(serviceProvider) { _synchronizer = ServiceProvider.GetService<ISynchronizer>(); _uiAsyncOperation = ServiceProvider.GetRequiredService<IUIShell>().CreateUIAsyncOperation(); }