示例#1
0
 // Token: 0x0600007B RID: 123 RVA: 0x00004124 File Offset: 0x00002324
 protected void DetermineDatabaseOperations(Dictionary <Guid, DatabaseInfo> dbMap)
 {
     foreach (DatabaseInfo databaseInfo in dbMap.Values)
     {
         databaseInfo.Analyze();
         if (this.IsActionsMatchWithPreviousPhase(databaseInfo))
         {
             List <AmDbOperation> list     = new List <AmDbOperation>();
             IADDatabase          database = databaseInfo.Database;
             if (databaseInfo.IsMountedButAdminRequestedDismount)
             {
                 AmDbActionCode actionCode = new AmDbActionCode(AmDbActionInitiator.Admin, this.m_reasonCode, AmDbActionCategory.Dismount);
                 AmDbDismountAdminDismountedOperation item = new AmDbDismountAdminDismountedOperation(database, actionCode);
                 list.Add(item);
                 this.m_dismountRequests++;
             }
             else
             {
                 if (databaseInfo.IsMismounted)
                 {
                     AmDbActionCode actionCode2            = new AmDbActionCode(AmDbActionInitiator.Automatic, this.m_reasonCode, AmDbActionCategory.ForceDismount);
                     AmDbDismountMismountedOperation item2 = new AmDbDismountMismountedOperation(database, actionCode2, databaseInfo.MisMountedServerList);
                     list.Add(item2);
                     this.m_dismountRequests++;
                 }
                 if (databaseInfo.IsActiveOnDisabledServer && !base.AllCopiesAreDisfavored(database))
                 {
                     list.Add(base.BuildMoveForActivationDisabled(database));
                     this.m_moveRequests++;
                 }
                 if (databaseInfo.IsPeriodicMountRequired)
                 {
                     AmDbActionCode     actionCode3 = new AmDbActionCode(AmDbActionInitiator.Automatic, this.m_reasonCode, AmDbActionCategory.Mount);
                     AmDbMountOperation item3       = new AmDbMountOperation(database, actionCode3);
                     list.Add(item3);
                     this.m_mountRequests++;
                 }
                 if (databaseInfo.IsClusterDatabaseOutOfSync)
                 {
                     AmDbActionCode actionCode4             = new AmDbActionCode(AmDbActionInitiator.Automatic, this.m_reasonCode, AmDbActionCategory.SyncState);
                     AmDbClusterDatabaseSyncOperation item4 = new AmDbClusterDatabaseSyncOperation(database, actionCode4);
                     list.Add(item4);
                     this.m_clusDbSyncRequests++;
                 }
                 if (databaseInfo.IsAdPropertiesOutOfSync)
                 {
                     AmDbActionCode actionCode5        = new AmDbActionCode(AmDbActionInitiator.Automatic, this.m_reasonCode, AmDbActionCategory.SyncAd);
                     AmDbAdPropertySyncOperation item5 = new AmDbAdPropertySyncOperation(database, actionCode5);
                     list.Add(item5);
                     this.m_adSyncRequests++;
                 }
             }
             databaseInfo.OperationsQueued = list;
         }
     }
 }
 // Token: 0x06000062 RID: 98 RVA: 0x000034CC File Offset: 0x000016CC
 protected virtual void PopulateWithDatabaseOperations(Dictionary <Guid, DatabaseInfo> dbMap)
 {
     foreach (DatabaseInfo databaseInfo in dbMap.Values)
     {
         databaseInfo.Analyze();
         if (this.m_isDebugOptionEnabled && this.m_amConfig.IsIgnoreServerDebugOptionEnabled(databaseInfo.ActiveServer))
         {
             AmTrace.Warning("Batchmounter operation for database {0} is not performed since debug option {1} is set for server {2} which is the current active for the database", new object[]
             {
                 databaseInfo.Database.Name,
                 databaseInfo.ActiveServer.NetbiosName,
                 AmDebugOptions.IgnoreServerFromAutomaticActions.ToString()
             });
         }
         else
         {
             List <AmDbOperation> list     = new List <AmDbOperation>();
             IADDatabase          database = databaseInfo.Database;
             if (databaseInfo.IsMountedButAdminRequestedDismount)
             {
                 AmDbActionCode actionCode = new AmDbActionCode(AmDbActionInitiator.Admin, this.m_reasonCode, AmDbActionCategory.Dismount);
                 AmDbDismountAdminDismountedOperation item = new AmDbDismountAdminDismountedOperation(database, actionCode);
                 list.Add(item);
                 this.m_dismountRequests++;
             }
             else
             {
                 if (databaseInfo.IsMismounted)
                 {
                     AmDbActionCode actionCode2            = new AmDbActionCode(AmDbActionInitiator.Automatic, this.m_reasonCode, AmDbActionCategory.ForceDismount);
                     AmDbDismountMismountedOperation item2 = new AmDbDismountMismountedOperation(database, actionCode2, databaseInfo.MisMountedServerList);
                     list.Add(item2);
                     this.m_dismountRequests++;
                 }
                 if (databaseInfo.IsActiveOnDisabledServer && !this.AllCopiesAreDisfavored(database))
                 {
                     list.Add(this.BuildMoveForActivationDisabled(database));
                     this.m_moveRequests++;
                 }
                 if (!databaseInfo.IsMountedOnActive)
                 {
                     AmDbActionCode     actionCode3 = new AmDbActionCode(AmDbActionInitiator.Automatic, this.m_reasonCode, AmDbActionCategory.Mount);
                     AmDbMountOperation item3       = new AmDbMountOperation(database, actionCode3);
                     list.Add(item3);
                     this.m_mountRequests++;
                 }
                 if (databaseInfo.IsClusterDatabaseOutOfSync)
                 {
                     AmDbActionCode actionCode4             = new AmDbActionCode(AmDbActionInitiator.Automatic, this.m_reasonCode, AmDbActionCategory.SyncState);
                     AmDbClusterDatabaseSyncOperation item4 = new AmDbClusterDatabaseSyncOperation(database, actionCode4);
                     list.Add(item4);
                     this.m_clusDbSyncRequests++;
                 }
                 if (databaseInfo.IsAdPropertiesOutOfSync)
                 {
                     AmDbActionCode actionCode5        = new AmDbActionCode(AmDbActionInitiator.Automatic, this.m_reasonCode, AmDbActionCategory.SyncAd);
                     AmDbAdPropertySyncOperation item5 = new AmDbAdPropertySyncOperation(database, actionCode5);
                     list.Add(item5);
                     this.m_adSyncRequests++;
                 }
             }
             databaseInfo.OperationsQueued = list;
         }
     }
 }