Exemple #1
0
        private ISyncJob CreateSyncJob(SyncConfig syncConfig)
        {
            var name = string.Format("{0} {1}",syncConfig.SyncDirection.ToUpper(), syncConfig.ObjectType.ToUpper());

            var batchSize = Config.BatchSize;

            if (syncConfig.SyncDirection.EqualsIgnoreCase(SyncDirection.Export))
                return new Exporter(_queueRepository, _salsaRepository, _errorHandler, batchSize, name, syncConfig.ObjectType, syncConfig.QueueName);
            else if (syncConfig.SyncDirection.EqualsIgnoreCase(SyncDirection.Import))
                return new Importer(_salsaRepository, _queueRepository, _errorHandler, batchSize, name, syncConfig.ObjectType, syncConfig.QueueName);
            else
                throw new ApplicationException(string.Format("Invalid SyncDirection '{0}' for this SyncConfigs record. Supported types include 'import' and 'export'.", syncConfig.SyncDirection));
        }
Exemple #2
0
 public void ShouldGetQueueName()
 {
     var syncJob = new SyncConfig {SyncDirection = SyncDirection.Export, ObjectType = "testObjectType"};
     Assert.AreEqual("AftToSalsaQueue_testObjectType", syncJob.QueueName);
 }