public MigrationBatchIdParameter(MigrationBatchId identity)
 {
     if (identity == null)
     {
         throw new ArgumentNullException("identity");
     }
     this.MigrationBatchId = identity;
     this.RawIdentity      = this.MigrationBatchId.ToString();
 }
        public void Initialize(ObjectId objectId)
        {
            MigrationBatchId migrationBatchId = objectId as MigrationBatchId;

            if (migrationBatchId == null)
            {
                throw new ArgumentException("objectId");
            }
            this.MigrationBatchId = migrationBatchId;
        }
Beispiel #3
0
 public Identity(MigrationBatchId id) : this(id.Id, id.ToString())
 {
 }
Beispiel #4
0
        internal static MigrationJob GetMigrationJobByBatchId(Task task, MigrationBatchDataProvider batchProvider, MigrationBatchId migrationBatchId, bool skipCorrupt, bool failIfNotFound = true)
        {
            MigrationJob migrationJob = null;
            Exception    ex           = null;

            try
            {
                migrationJob = batchProvider.JobCache.GetJob(migrationBatchId);
            }
            catch (PropertyErrorException ex2)
            {
                ex = ex2;
            }
            catch (InvalidDataException ex3)
            {
                ex = ex3;
            }
            if (ex != null)
            {
                MigrationLogger.Log(MigrationEventType.Warning, MigrationLogger.GetDiagnosticInfo(ex, null), new object[0]);
                task.WriteError(new MigrationPermanentException(Strings.MigrationJobCorrupted, ex), ExchangeErrorCategory.Client, null);
            }
            if (migrationJob != null && migrationJob.Status == MigrationJobStatus.Corrupted && skipCorrupt)
            {
                migrationJob = null;
            }
            if (migrationJob == null && failIfNotFound)
            {
                MigrationObjectTaskBase <TIdentityParameter> .WriteJobNotFoundError(task, migrationBatchId.ToString());
            }
            return(migrationJob);
        }