public static IInitialSyncStateCreationStrategy <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> Create(
            IEntitySyncStateFactory <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> syncStateFactory,
            EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> environment,
            SynchronizationMode synchronizationMode,
            ConflictResolution conflictResolution,
            Func <
                EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity>,
                ConflictInitialSyncStateCreationStrategyAutomatic <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> > automaticConflictResolutionStrategyFactory)
        {
            switch (synchronizationMode)
            {
            case SynchronizationMode.MergeInBothDirections:
                var conflictResolutionStrategy = Create(syncStateFactory, environment, conflictResolution, automaticConflictResolutionStrategyFactory);
                return(new TwoWayInitialSyncStateCreationStrategy <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> (
                           syncStateFactory,
                           conflictResolutionStrategy
                           ));

            case SynchronizationMode.ReplicateOutlookIntoServer:
            case SynchronizationMode.MergeOutlookIntoServer:
                return(new OneWayInitialSyncStateCreationStrategy_AToB <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> (
                           syncStateFactory,
                           synchronizationMode == SynchronizationMode.ReplicateOutlookIntoServer ? OneWaySyncMode.Replicate : OneWaySyncMode.Merge
                           ));

            case SynchronizationMode.ReplicateServerIntoOutlook:
            case SynchronizationMode.MergeServerIntoOutlook:
                return(new OneWayInitialSyncStateCreationStrategy_BToA <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> (
                           syncStateFactory,
                           synchronizationMode == SynchronizationMode.ReplicateServerIntoOutlook ? OneWaySyncMode.Replicate : OneWaySyncMode.Merge
                           ));
            }
            throw new NotImplementedException();
        }
 public static IInitialSyncStateCreationStrategy<string, DateTime, ContactItemWrapper, Uri, string, vCard> Create (IEntitySyncStateFactory<string, DateTime, ContactItemWrapper, Uri, string, vCard> syncStateFactory, EntitySyncStateEnvironment<string, DateTime, ContactItemWrapper, Uri, string, vCard> environment, SynchronizationMode synchronizationMode, ConflictResolution conflictResolution)
 {
   switch (synchronizationMode)
   {
     case SynchronizationMode.MergeInBothDirections:
       var conflictResolutionStrategy = Create (syncStateFactory, environment, conflictResolution);
       return new TwoWayInitialSyncStateCreationStrategy<string, DateTime, ContactItemWrapper, Uri, string, vCard> (
           syncStateFactory,
           conflictResolutionStrategy
           );
     case SynchronizationMode.ReplicateOutlookIntoServer:
     case SynchronizationMode.MergeOutlookIntoServer:
       return new OneWayInitialSyncStateCreationStrategy_AToB<string, DateTime, ContactItemWrapper, Uri, string, vCard> (
           syncStateFactory,
           synchronizationMode == SynchronizationMode.ReplicateOutlookIntoServer ? OneWaySyncMode.Replicate : OneWaySyncMode.Merge
           );
     case SynchronizationMode.ReplicateServerIntoOutlook:
     case SynchronizationMode.MergeServerIntoOutlook:
       return new OneWayInitialSyncStateCreationStrategy_BToA<string, DateTime, ContactItemWrapper, Uri, string, vCard> (
           syncStateFactory,
           synchronizationMode == SynchronizationMode.ReplicateServerIntoOutlook ? OneWaySyncMode.Replicate : OneWaySyncMode.Merge
           );
   }
   throw new NotImplementedException();
 }
 public DeleteInA(
     EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> environment,
     IEntityRelationData <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> knownData,
     TAtypeEntityVersion currentAVersion)
     : base(environment, knownData)
 {
     _currentAVersion = currentAVersion;
 }
Beispiel #4
0
 public GoogleContactUpdateFromNewerToOlder(
     EntitySyncStateEnvironment <string, DateTime, ContactItemWrapper, string, GoogleContactVersion, GoogleContactWrapper, GoogleContactContext> environment,
     IEntityRelationData <string, DateTime, string, GoogleContactVersion> knownData,
     DateTime newA,
     GoogleContactVersion newB)
     : base(environment, knownData, newA, newB)
 {
 }
 public OutlookDistListUpdateFromNewerToOlder(
     EntitySyncStateEnvironment <string, DateTime, IDistListItemWrapper, WebResourceName, string, vCard, DistributionListSychronizationContext> environment,
     IEntityRelationData <string, DateTime, WebResourceName, string> knownData,
     DateTime newA,
     string newB)
     : base(environment, knownData, newA, newB)
 {
 }
Beispiel #6
0
 public RestoreInB(
     EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> environment,
     IEntityRelationData <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> knownData,
     TBtypeEntityVersion currentBVersion)
     : base(environment, knownData)
 {
     _currentBVersion = currentBVersion;
 }
 public OutlookCardDavUpdateFromNewerToOlder(
     EntitySyncStateEnvironment <string, DateTime, ContactItemWrapper, Uri, string, vCard> environment,
     IEntityRelationData <string, DateTime, Uri, string> knownData,
     DateTime newA,
     string newB)
     : base(environment, knownData, newA, newB)
 {
 }
 public OutlookCardDavUpdateFromNewerToOlder(
     EntitySyncStateEnvironment <string, DateTime, IContactItemWrapper, WebResourceName, string, vCard, ICardDavRepositoryLogger> environment,
     IEntityRelationData <string, DateTime, WebResourceName, string> knownData,
     DateTime newA,
     string newB)
     : base(environment, knownData, newA, newB)
 {
 }
 public DeleteInAWithNoRetry(
     EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> environment,
     TAtypeEntityId aId,
     TAtypeEntityVersion currentAVersion)
     : base(environment)
 {
     _aId             = aId;
     _currentAVersion = currentAVersion;
 }
Beispiel #10
0
 public DeleteInBWithNoRetry(
     EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> environment,
     TBtypeEntityId bId,
     TBtypeEntityVersion currentBVersion)
     : base(environment)
 {
     _bId             = bId;
     _currentBVersion = currentBVersion;
 }
 public EntitySyncStateFactory(IEntityMapper <TAtypeEntity, TBtypeEntity> mapper, IWriteOnlyEntityRepository <TAtypeEntity, TAtypeEntityId, TAtypeEntityVersion> aRepository, IWriteOnlyEntityRepository <TBtypeEntity, TBtypeEntityId, TBtypeEntityVersion> bRepository, IEntityRelationDataFactory <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> dataFactory, IExceptionLogger exceptionLogger)
 {
     _environment = new EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> (
         mapper,
         aRepository,
         bRepository,
         dataFactory,
         this,
         exceptionLogger);
 }
 public UpdateAToB(
     EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> environment,
     IEntityRelationData <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> knownData,
     TAtypeEntityVersion newAVersion,
     TBtypeEntityVersion currentBVersion)
     : base(environment, knownData)
 {
     _newAVersion     = newAVersion;
     _currentBVersion = currentBVersion;
 }
Beispiel #13
0
 public EntitySyncStateFactory(
     IEntityMapper <TAtypeEntity, TBtypeEntity, TContext> mapper,
     IEntityRelationDataFactory <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> dataFactory,
     IExceptionLogger exceptionLogger)
 {
     _environment = new EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> (
         mapper,
         dataFactory,
         this,
         exceptionLogger);
 }
    private static IConflictInitialSyncStateCreationStrategy<string, DateTime, AppointmentItemWrapper, WebResourceName, string, IICalendar> Create (IEntitySyncStateFactory<string, DateTime, AppointmentItemWrapper, WebResourceName, string, IICalendar> syncStateFactory, EntitySyncStateEnvironment<string, DateTime, AppointmentItemWrapper, WebResourceName, string, IICalendar> environment, ConflictResolution conflictResolution)
    {
      switch (conflictResolution)
      {
        case ConflictResolution.OutlookWins:
          return new ConflictInitialSyncStateCreationStrategyAWins<string, DateTime, AppointmentItemWrapper, WebResourceName, string, IICalendar> (syncStateFactory);
        case ConflictResolution.ServerWins:
          return new ConflictInitialSyncStateCreationStrategyBWins<string, DateTime, AppointmentItemWrapper, WebResourceName, string, IICalendar> (syncStateFactory);
        case ConflictResolution.Automatic:
          return new EventConflictInitialSyncStateCreationStrategyAutomatic (environment);
      }

      throw new NotImplementedException();
    }
    private static IConflictInitialSyncStateCreationStrategy<string, DateTime, ContactItemWrapper, Uri, string, vCard> Create (IEntitySyncStateFactory<string, DateTime, ContactItemWrapper, Uri, string, vCard> syncStateFactory, EntitySyncStateEnvironment<string, DateTime, ContactItemWrapper, Uri, string, vCard> environment, ConflictResolution conflictResolution)
    {
      switch (conflictResolution)
      {
        case ConflictResolution.OutlookWins:
          return new ConflictInitialSyncStateCreationStrategyAWins<string, DateTime, ContactItemWrapper, Uri, string, vCard> (syncStateFactory);
        case ConflictResolution.ServerWins:
          return new ConflictInitialSyncStateCreationStrategyBWins<string, DateTime, ContactItemWrapper, Uri, string, vCard> (syncStateFactory);
        case ConflictResolution.Automatic:
          return new ContactConflictInitialSyncStateCreationStrategyAutomatic (environment);
      }

      throw new NotImplementedException();
    }
        private static IConflictInitialSyncStateCreationStrategy <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> Create(
            IEntitySyncStateFactory <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> syncStateFactory,
            EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> environment,
            ConflictResolution conflictResolution,
            Func <
                EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity>,
                ConflictInitialSyncStateCreationStrategyAutomatic <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> > automaticConflictResolutionStrategyFactory)
        {
            switch (conflictResolution)
            {
            case ConflictResolution.OutlookWins:
                return(new ConflictInitialSyncStateCreationStrategyAWins <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> (syncStateFactory));

            case ConflictResolution.ServerWins:
                return(new ConflictInitialSyncStateCreationStrategyBWins <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> (syncStateFactory));

            case ConflictResolution.Automatic:
                return(automaticConflictResolutionStrategyFactory(environment));
            }

            throw new NotImplementedException();
        }
Beispiel #17
0
        public static IInitialSyncStateCreationStrategy <string, DateTime, TaskItemWrapper, string, string, Task> Create(IEntitySyncStateFactory <string, DateTime, TaskItemWrapper, string, string, Task> syncStateFactory, EntitySyncStateEnvironment <string, DateTime, TaskItemWrapper, string, string, Task> environment, SynchronizationMode synchronizationMode, ConflictResolution conflictResolution)
        {
            switch (synchronizationMode)
            {
            case SynchronizationMode.MergeInBothDirections:
                var conflictResolutionStrategy = Create(syncStateFactory, environment, conflictResolution);
                return(new TwoWayInitialSyncStateCreationStrategy <string, DateTime, TaskItemWrapper, string, string, Task> (
                           syncStateFactory,
                           conflictResolutionStrategy
                           ));

            case SynchronizationMode.ReplicateOutlookIntoServer:
            case SynchronizationMode.MergeOutlookIntoServer:
                return(new OneWayInitialSyncStateCreationStrategy_AToB <string, DateTime, TaskItemWrapper, string, string, Task> (
                           syncStateFactory,
                           synchronizationMode == SynchronizationMode.ReplicateOutlookIntoServer ? OneWaySyncMode.Replicate : OneWaySyncMode.Merge
                           ));

            case SynchronizationMode.ReplicateServerIntoOutlook:
            case SynchronizationMode.MergeServerIntoOutlook:
                return(new OneWayInitialSyncStateCreationStrategy_BToA <string, DateTime, TaskItemWrapper, string, string, Task> (
                           syncStateFactory,
                           synchronizationMode == SynchronizationMode.ReplicateServerIntoOutlook ? OneWaySyncMode.Replicate : OneWaySyncMode.Merge
                           ));
            }
            throw new NotImplementedException();
        }
Beispiel #18
0
        private static IConflictInitialSyncStateCreationStrategy <string, DateTime, TaskItemWrapper, string, string, Task> Create(IEntitySyncStateFactory <string, DateTime, TaskItemWrapper, string, string, Task> syncStateFactory, EntitySyncStateEnvironment <string, DateTime, TaskItemWrapper, string, string, Task> environment, ConflictResolution conflictResolution)
        {
            switch (conflictResolution)
            {
            case ConflictResolution.OutlookWins:
                return(new ConflictInitialSyncStateCreationStrategyAWins <string, DateTime, TaskItemWrapper, string, string, Task> (syncStateFactory));

            case ConflictResolution.ServerWins:
                return(new ConflictInitialSyncStateCreationStrategyBWins <string, DateTime, TaskItemWrapper, string, string, Task> (syncStateFactory));

            case ConflictResolution.Automatic:
                return(new GoogleTaskConflictInitialSyncStateCreationStrategyAutomatic(environment));
            }

            throw new NotImplementedException();
        }
 protected UpdateFromNewerToOlder(EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> environment, IEntityRelationData <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> knownData, TAtypeEntityVersion newA, TBtypeEntityVersion newB)
     : base(environment, knownData)
 {
     _newA = newA;
     _newB = newB;
 }
Beispiel #20
0
 public ContactConflictInitialSyncStateCreationStrategyAutomatic(EntitySyncStateEnvironment <string, DateTime, IContactItemWrapper, WebResourceName, string, vCard, ICardDavRepositoryLogger> environment)
     : base(environment)
 {
 }
 public TaskUpdateFromNewerToOlder(EntitySyncStateEnvironment <string, DateTime, ITaskItemWrapper, WebResourceName, string, IICalendar, int> environment, IEntityRelationData <string, DateTime, WebResourceName, string> knownData, DateTime newA, string newB)
     : base(environment, knownData, newA, newB)
 {
 }
 public DeleteInBWithNoRetry(EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> environment, TBtypeEntityId bId)
     : base(environment)
 {
     _bId = bId;
 }
Beispiel #23
0
 public GoogleContactConflictInitialSyncStateCreationStrategyAutomatic(EntitySyncStateEnvironment <string, DateTime, ContactItemWrapper, string, GoogleContactVersion, GoogleContactWrapper, IGoogleContactContext> environment)
     : base(environment)
 {
 }
 public GoogleTaskUpdateFromNewerToOlder(EntitySyncStateEnvironment <string, DateTime, ITaskItemWrapper, string, string, Task, int> environment, IEntityRelationData <string, DateTime, string, string> knownData, DateTime newA, string newB)
     : base(environment, knownData, newA, newB)
 {
 }
 public DeleteInB(EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> environment, IEntityRelationData <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> knownData)
     : base(environment, knownData)
 {
 }
Beispiel #26
0
 public EventConflictInitialSyncStateCreationStrategyAutomatic(EntitySyncStateEnvironment <string, DateTime, AppointmentItemWrapper, WebResourceName, string, IICalendar> environment)
     : base(environment)
 {
 }
Beispiel #27
0
 protected StateBase(EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> environment)
 {
     _environment = environment;
 }
Beispiel #28
0
 public OutlookCaldavEventUpdateFromNewerToOlder(EntitySyncStateEnvironment <string, DateTime, AppointmentItemWrapper, WebResourceName, string, IICalendar> environment, IEntityRelationData <string, DateTime, WebResourceName, string> knownData, DateTime newA, string newB)
     : base(environment, knownData, newA, newB)
 {
 }
 protected UpdateBase(EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> environment, IEntityRelationData <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> knownData)
     : base(environment, knownData)
 {
 }
 protected StateWithKnownData(EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity> environment, IEntityRelationData <TAtypeEntityId, TAtypeEntityVersion, TBtypeEntityId, TBtypeEntityVersion> knownData)
     : base(environment)
 {
     _knownData = knownData;
 }
 public CreateInB(EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> environment, TAtypeEntityId aId, TAtypeEntityVersion aVersion)
     : base(environment)
 {
     AId      = aId;
     AVersion = aVersion;
 }
 public SogoDistListConflictInitialSyncStateCreationStrategyAutomatic(EntitySyncStateEnvironment <string, DateTime, IDistListItemWrapper, WebResourceName, string, DistributionList, DistributionListSychronizationContext> environment)
     : base(environment)
 {
 }
Beispiel #33
0
 public CreateInA(EntitySyncStateEnvironment <TAtypeEntityId, TAtypeEntityVersion, TAtypeEntity, TBtypeEntityId, TBtypeEntityVersion, TBtypeEntity, TContext> environment, TBtypeEntityId bId, TBtypeEntityVersion bVersion)
     : base(environment)
 {
     _bId      = bId;
     _bVersion = bVersion;
 }