Exemple #1
0
        public VRASCopyConfiguration(GlobalSettings globals, BatchSettingsType settingsForBatch, SourceType source, List <DestinationType> destinations)
        {
            // source settings
            this.BaseFolderPath    = source.SourceFolderPath;
            this.CopyType          = source.CopyType;
            this.FileRegExFilter   = source.FileRegExFilter;
            this.FolderRegExFilter = source.FolderRegExFilter;

            // source folder overrides
            this.CopyThreadPerSource = System.Convert.ToInt32(source.SourceSettingOverrides.CopyThreadPerSource);
            this.CopyZeroByteFiles   = source.SourceSettingOverrides.CopyZeroByteFiles;
            this.DeleteAfterCopy     = source.SourceSettingOverrides.DeleteAfterCopy;
            this.NewFileDelaySeconds = System.Convert.ToInt32(source.SourceSettingOverrides.NewFileDelaySeconds);

            // figure out what settings overrides to use
            SettingThatAreOverridableType mySettings = new SettingThatAreOverridableType();

            if (source.SourceSettingOverrides != null)
            {
                mySettings = source.SourceSettingOverrides;
            }
            else
            {
                mySettings = settingsForBatch.BatchSettingOverrides;
            }

            // batch settings
            this.BatchName = settingsForBatch.BatchName;
            this.CopyFromFirstDestinationDir = mySettings.CopyFromFirstDestinationDir;
            this.CopyRetryCount        = System.Convert.ToInt32(mySettings.CopyRetryCount);
            this.RetrySleepMs          = System.Convert.ToInt32(mySettings.RetrySleepMs);
            this.SleepBetweenBatchesMs = System.Convert.ToInt32(settingsForBatch.BatchSettingOverrides.SleepBetweenBatchesMs);

            // golbal settings
            this.ErrorLogPath = globals.ErrorLogPath;
            this.EventSource  = globals.EventSource;
            this.RegExMatchNotFoundDefaultString = globals.RegExMatchNotFoundDefaultString;
            this.ServiceStopTimeOutSec           = System.Convert.ToInt32(globals.ServiceStopTimeOutSec);
            this.TempFileExt = "." + globals.TempFileExt.TrimStart('.');

            // destinations
            this.DestinationCollection = destinations;

            // prime the event log source.
            VRASLogEvent.EventSourceDefault = this.EventSource;
        }
Exemple #2
0
        public Batch(GlobalSettings g, BatchSettingsType b)
        {
            BatchName           = b.BatchName;
            this.globalsettings = g;
            this.batchSettings  = b;

            this.sourceFolders   = new List <SourceType>();
            this.destFolders     = new List <DestinationType>();
            this.copyThreadPools = new List <VRASThreadManager>();

            this.copyJob = new CopyJobOptionsType();

            this.hasRightsToDestFolders   = false;
            this.hasRightsToSourceFolders = false;
            this.passedValidation         = false;

            // if there were no batch overridable settings use the globals
            this.batchSettings.BatchSettingOverrides = this.SetSettings(g.GlobalOverridableSettings, b.BatchSettingOverrides);

            this.copyFromFirstDestinationDir = this.batchSettings.BatchSettingOverrides.CopyFromFirstDestinationDir;
            this.copyRetryCount        = this.batchSettings.BatchSettingOverrides.CopyRetryCount;
            this.retrySleepMs          = this.batchSettings.BatchSettingOverrides.RetrySleepMs;
            this.sleepBetweenBatchesMs = this.batchSettings.BatchSettingOverrides.SleepBetweenBatchesMs;
        }