Example #1
0
 internal BackupScheduler(BackupMetadata backupMetadata, Action timerCallack)
 {
     this._backupMetadataObj = backupMetadata;
     this._periodicTimer     = new BackupTimer(backupMetadata, TimerCallback);
     this._rescheduleTimer   = new RescheduleTimer(TimerCallback, BackupRescheduleTimerTraceType);
     this._timerCallback     = timerCallack;
 }
Example #2
0
 /// <summary>
 /// Provides a shallow copy of object
 /// </summary>
 /// <param name="copyFromObj">Object from which to copy the settings from</param>
 internal void CopyFrom(BackupMetadata copyFromObj)
 {
     this.Version                        = copyFromObj.Version;
     this.PartitionId                    = copyFromObj.PartitionId;
     this.Policy                         = copyFromObj.Policy;
     this.PolicyUpdateTime               = copyFromObj.PolicyUpdateTime;
     this.LastRecoveryPoint              = copyFromObj.LastRecoveryPoint;
     this.NumberOfBackupsInChain         = copyFromObj.NumberOfBackupsInChain;
     this.JitterInMillisUsedInLastBackup = copyFromObj.JitterInMillisUsedInLastBackup;
 }
Example #3
0
        /// <summary>
        /// Does a shallow copy of the BackupMetadata object
        /// </summary>
        /// <returns>Cloned object</returns>
        public object Clone()
        {
            var obj = new BackupMetadata
            {
                Version                        = this.Version,
                PartitionId                    = this.PartitionId,
                Policy                         = this.Policy,
                PolicyUpdateTime               = this.PolicyUpdateTime,
                LastRecoveryPoint              = this.LastRecoveryPoint,
                NumberOfBackupsInChain         = this.NumberOfBackupsInChain,
                JitterInMillisUsedInLastBackup = this.JitterInMillisUsedInLastBackup
            };

            return(obj);
        }
Example #4
0
        internal BackupTimer(BackupMetadata metadata, Action timerCallback)
        {
            this.policy         = metadata.Policy;
            this.backupMetadata = metadata;
            backupTimer         = new BRSTimer(timerCallback);

            if (metadata.Policy.PolicyType == BackupPolicyType.ScheduleBased)
            {
                // Order the time of day and day of week lists

                var derivedPolicy = (ScheduleBasedBackupPolicy)metadata.Policy;
                derivedPolicy.RunTimes = derivedPolicy.RunTimes.OrderBy(t => t).ToList();
                derivedPolicy.RunDays  = derivedPolicy.RunDays.OrderBy(t => t).ToList();
            }

            LoadJiterConfig();
        }