コード例 #1
0
 internal DatabaseRedundancy(HealthInfoPersisted healthInfo, DbHealthInfoPersisted dbHealth, string serverContactedFqdn)
 {
     this.Identity                 = new ConfigObjectId(dbHealth.DbName);
     this.DbGuid                   = dbHealth.DbGuid;
     this.ServerContactedFqdn      = serverContactedFqdn.ToUpperInvariant();
     this.HealthInfoCreateTime     = DateTimeHelper.ParseIntoNullableLocalDateTimeIfPossible(healthInfo.CreateTimeUtcStr);
     this.HealthInfoLastUpdateTime = DateTimeHelper.ParseIntoNullableLocalDateTimeIfPossible(healthInfo.LastUpdateTimeUtcStr);
     this.DatabaseFoundInAD        = TransitionInfo.ConstructFromRemoteSerializable(dbHealth.DbFoundInAD);
     this.IsDatabaseFoundInAD      = this.DatabaseFoundInAD.IsSuccess;
     this.SkippedFromMonitoring    = TransitionInfo.ConstructFromRemoteSerializable(dbHealth.SkippedFromMonitoring);
     this.AtLeast1RedundantCopy    = TransitionInfo.ConstructFromRemoteSerializable(dbHealth.IsAtLeast1RedundantCopy);
     this.AtLeast2RedundantCopy    = TransitionInfo.ConstructFromRemoteSerializable(dbHealth.IsAtLeast2RedundantCopy);
     this.AtLeast3RedundantCopy    = TransitionInfo.ConstructFromRemoteSerializable(dbHealth.IsAtLeast3RedundantCopy);
     this.AtLeast4RedundantCopy    = TransitionInfo.ConstructFromRemoteSerializable(dbHealth.IsAtLeast4RedundantCopy);
     this.AtLeast1AvailableCopy    = TransitionInfo.ConstructFromRemoteSerializable(dbHealth.IsAtLeast1AvailableCopy);
     this.AtLeast2AvailableCopy    = TransitionInfo.ConstructFromRemoteSerializable(dbHealth.IsAtLeast2AvailableCopy);
     this.AtLeast3AvailableCopy    = TransitionInfo.ConstructFromRemoteSerializable(dbHealth.IsAtLeast3AvailableCopy);
     this.AtLeast4AvailableCopy    = TransitionInfo.ConstructFromRemoteSerializable(dbHealth.IsAtLeast4AvailableCopy);
     this.DbCopies                 = new DatabaseCopyRedundancy[dbHealth.DbCopies.Count];
     for (int i = 0; i < dbHealth.DbCopies.Count; i++)
     {
         this.DbCopies[i] = new DatabaseCopyRedundancy(dbHealth, dbHealth.DbCopies[i]);
     }
     this.IsAtLeast2RedundantCopy             = this.AtLeast2RedundantCopy.IsSuccess;
     this.IsAtLeast2AvailableCopy             = this.AtLeast2AvailableCopy.IsSuccess;
     this.AtLeast2RedundantCopyTransitionTime = this.AtLeast2RedundantCopy.LastTransitionTime;
     this.AtLeast2AvailableCopyTransitionTime = this.AtLeast2AvailableCopy.LastTransitionTime;
 }
コード例 #2
0
 internal DatabaseCopyRedundancy(DbHealthInfoPersisted dbHealth, DbCopyHealthInfoPersisted dbchip)
 {
     this.DatabaseGuid = dbHealth.DbGuid;
     this.DatabaseName = dbHealth.DbName;
     this.ServerName   = MachineName.GetNodeNameFromFqdn(dbchip.ServerFqdn).ToUpperInvariant();
     this.m_copyName   = string.Format("{0}\\{1}", this.DatabaseName, this.ServerName);
     this.Identity     = this.m_copyName;
     this.LastCopyStatusTransitionTime = DateTimeHelper.ToNullableLocalDateTime(dbchip.LastCopyStatusTransitionTime);
     this.CopyFoundInAD       = TransitionInfo.ConstructFromRemoteSerializable(dbchip.CopyFoundInAD);
     this.CopyStatusRetrieved = TransitionInfo.ConstructFromRemoteSerializable(dbchip.CopyStatusRetrieved);
     this.CopyIsAvailable     = TransitionInfo.ConstructFromRemoteSerializable(dbchip.CopyIsAvailable);
     this.CopyIsRedundant     = TransitionInfo.ConstructFromRemoteSerializable(dbchip.CopyIsRedundant);
     this.CopyStatusHealthy   = TransitionInfo.ConstructFromRemoteSerializable(dbchip.CopyStatusHealthy);
     this.CopyStatusActive    = TransitionInfo.ConstructFromRemoteSerializable(dbchip.CopyStatusActive);
     this.CopyStatusMounted   = TransitionInfo.ConstructFromRemoteSerializable(dbchip.CopyStatusMounted);
     this.IsCopyFoundInAD     = this.CopyFoundInAD.IsSuccess;
     this.IsCopyAvailable     = this.CopyIsAvailable.IsSuccess;
     this.IsCopyRedundant     = this.CopyIsRedundant.IsSuccess;
 }