예제 #1
0
        public override ExitCodeType Run(IDataLoadJob job, GracefulCancellationToken cancellationToken)
        {
            job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, "About to run Task '" + ProcessTask.Name + "'"));
            job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, "Mutilate class is" + MutilateDataTables.GetType().FullName));

            try
            {
                return(MutilateDataTables.Mutilate(job));
            }
            catch (Exception e)
            {
                job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Error, "Mutilate failed on job " + job + " Mutilator was of type " + MutilateDataTables.GetType().Name + " see InnerException for specifics", e));
                return(ExitCodeType.Error);
            }
        }
예제 #2
0
        public MutilateDataTablesRuntimeTask(IProcessTask task, RuntimeArgumentCollection args, MEF mef)
            : base(task, args)
        {
            //All attachers must be marked as mounting stages, and therefore we can pull out the RAW Server and Name
            var stageArgs = args.StageSpecificArguments;

            if (stageArgs == null)
            {
                throw new NullReferenceException("Stage args was null");
            }
            if (stageArgs.DbInfo == null)
            {
                throw new NullReferenceException("Stage args had no DbInfo, unable to mutilate tables without a database - mutilator is sad");
            }

            if (string.IsNullOrWhiteSpace(task.Path))
            {
                throw new ArgumentException("Path is blank for ProcessTask '" + task + "' - it should be a class name of type " + typeof(IMutilateDataTables).Name);
            }

            MutilateDataTables = mef.CreateA <IMutilateDataTables>(ProcessTask.Path);
            SetPropertiesForClass(RuntimeArguments, MutilateDataTables);
            MutilateDataTables.Initialize(stageArgs.DbInfo, ProcessTask.LoadStage);
        }
예제 #3
0
 public override void LoadCompletedSoDispose(ExitCodeType exitCode, IDataLoadEventListener postDataLoadEventListener)
 {
     MutilateDataTables.LoadCompletedSoDispose(exitCode, postDataLoadEventListener);
 }
예제 #4
0
 public override void Check(ICheckNotifier checker)
 {
     new MandatoryPropertyChecker(MutilateDataTables).Check(checker);
     MutilateDataTables.Check(checker);
 }