public SQSListener(string dASAppointmentsQueueName, IAppointmentStorageService appointmentStorageService, IAppointmentOpLogStorageService appointmentOpLogStorageService, IConflictsManager conflictsManager) { DASAppointmentsQueueName = dASAppointmentsQueueName; AppointmentStorageService = appointmentStorageService; AppointmentOpLogStorageService = appointmentOpLogStorageService; ConflictsManager = conflictsManager; }
public void ResolveConflicts(IDataStore localDataStore, IConflictsManager conflictsManager) { if (Conflicts == null || Conflicts.Count == 0) { return; } foreach (var conflict in Conflicts) { var identityChange = conflict.Resolve(localDataStore); conflictsManager.AddNewIdentityChange(identityChange); } }
public RuleSetConflictsController(IHost host, IConflictsManager conflictsManager) { if (host == null) { throw new ArgumentNullException(nameof(host)); } if (conflictsManager == null) { throw new ArgumentNullException(nameof(conflictsManager)); } this.host = host; this.conflictsManager = conflictsManager; this.FixConflictsCommand = new RelayCommand <IEnumerable <ProjectRuleSetConflict> >(this.OnFixConflicts, this.OnFixConflictsStatus); }
public void ApplyInsert(IEntityConflict entityConflict, IConflictsManager conflictsManager) { foreach (var row in Insert) { conflictsManager.ApplyForeignKeyChange(row); var existing = FindExisting(row); if (existing != null) { entityConflict.OnApplyInsertAlreadyExisting(existing, row); continue; } if (conflictsManager.HasForeignKeyDeleted(row)) { continue; } ApplyInsertWhenNoExistInLocal(entityConflict, row); } }
public void ApplyChanges(ISqlDataStore datastore, ISyncStatProvider statProvider, IConflictsManager conflictsManager) { if (EntityChangeset.Count == 0) { return; } var progression = new LinearProgression(EntityChangeset.Count * 3); statProvider.SetNewState(SyncStates.ApplyingRemoteChange, progression); var changeSets = new List <ChangeSet>(); foreach (var entityChangeset in EntityChangeset) { entityChangeset.SetDatastore(datastore); var conflic = conflictsManager.CreateEntityConflict(entityChangeset, _syncSessionInfo); changeSets.Add(new ChangeSet(entityChangeset, conflic, conflictsManager)); } // Update FK changes before delete foreach (var entityChange in changeSets) { entityChange.ApplyUpdate(); progression.CurrentStepFinished(); } // Delete FK before delete PK changeSets.Reverse(); foreach (var entityChange in changeSets) { entityChange.ApplyDelete(); progression.CurrentStepFinished(); } // Insert PK before insert FK changeSets.Reverse(); foreach (var entityChange in changeSets) { entityChange.ApplyInsert(); entityChange.ApplyLastSync(); entityChange.ResolveConflicts(datastore); progression.CurrentStepFinished(); } }
public ChangeSet(EntityChangeset entityChangeset, IEntityConflict conflic, IConflictsManager conflictsManager) { _entityChangeset = entityChangeset; _conflic = conflic; _conflictsManager = conflictsManager; }
protected void ApplyRemoteChange(IConflictsManager conflictsManager) { RemoteChanges.ApplyChanges(DataStore as ISqlDataStore, StatProvider, conflictsManager); StatProvider.SetConflicts(conflictsManager); }
public void ResolveConflicts(IDataStore localDataStore, IConflictsManager conflictsManager) { }
public void SetConflicts(IConflictsManager conflicts) { Conflicts = conflicts.Count; Info("{0} - Conflict detected:{1}", Source, Conflicts); }
private void ApplyChanges(EntitiesChangeset localChange, IConflictsManager conflictsManager) { SyncSession.HighBoundaryAnchor = SyncDateTimeProvider.UtcNow; localChange.ApplyChanges(Desktop.DataStore, new Mock <ISyncStatProvider>().Object, conflictsManager); }