예제 #1
0
        public static void ReadServerDatabaseSchemaVersionRange(IClusterDB iClusterDB, Guid serverGuid, int defaultMinimum, int defaultMaximum, out int minVersion, out int maxVersion)
        {
            string keyName = string.Format("Exchange\\Servers\\{0}\\Schema", serverGuid);

            minVersion = iClusterDB.GetValue <int>(keyName, "Minimum Version", defaultMinimum);
            maxVersion = iClusterDB.GetValue <int>(keyName, "Maximum Version", defaultMaximum);
        }
        internal Dictionary <Guid, AmDbStateInfo> GetAllDbStatesFromClusdb(IClusterDB clusdb)
        {
            Dictionary <Guid, AmDbStateInfo> dictionary = new Dictionary <Guid, AmDbStateInfo>();

            if (!DistributedStore.Instance.IsKeyExist("ExchangeActiveManager\\DbState", null))
            {
                return(dictionary);
            }
            IEnumerable <Tuple <string, RegistryValueKind> > valueInfos = clusdb.GetValueInfos("ExchangeActiveManager\\DbState");

            if (valueInfos != null)
            {
                foreach (Tuple <string, RegistryValueKind> tuple in valueInfos)
                {
                    string item  = tuple.Item1;
                    string value = clusdb.GetValue <string>("ExchangeActiveManager\\DbState", item, string.Empty);
                    Guid   guid;
                    if (!string.IsNullOrEmpty(value) && Guid.TryParse(item, out guid))
                    {
                        AmDbStateInfo value2 = AmDbStateInfo.Parse(guid, value);
                        dictionary.Add(guid, value2);
                    }
                }
            }
            return(dictionary);
        }
예제 #3
0
        // Token: 0x06001BD8 RID: 7128 RVA: 0x00078450 File Offset: 0x00076650
        internal static ExDateTime GetLastServerUpdateTimeFromClusdb()
        {
            ExDateTime exDateTimeMinValueUtc = SharedHelper.ExDateTimeMinValueUtc;

            try
            {
                using (IClusterDB clusterDB = ClusterDB.Open())
                {
                    string value = clusterDB.GetValue <string>("ExchangeActiveManager\\LastLog", AmServerName.LocalComputerName.NetbiosName, string.Empty);
                    if (!string.IsNullOrEmpty(value) && !ExDateTime.TryParse(value, out exDateTimeMinValueUtc))
                    {
                        exDateTimeMinValueUtc = SharedHelper.ExDateTimeMinValueUtc;
                    }
                }
            }
            catch (ClusterException ex)
            {
                ClusterBatchWriter.Tracer.TraceError <string>(0L, "GetLastServerUpdateTimeFromClusdb() failed with {0}", ex.Message);
            }
            return(exDateTimeMinValueUtc);
        }
예제 #4
0
        private void InitializeFromClusdbInternal()
        {
            AmConfig config = AmSystemManager.Instance.Config;

            if (config.IsPAM)
            {
                AmDagConfig dagConfig = config.DagConfig;
                using (IClusterDB clusterDB = ClusterDB.Open())
                {
                    foreach (AmServerName amServerName in dagConfig.MemberServers)
                    {
                        string keyName = AmThrottledActionTracker <TData> .ConstructRegKeyName(amServerName.NetbiosName);

                        string[] value = clusterDB.GetValue <string[]>(keyName, this.ActionName, null);
                        if (value != null && value.Length > 0)
                        {
                            LinkedList <TData> linkedList = new LinkedList <TData>();
                            foreach (string text in value)
                            {
                                int num = text.IndexOf('=');
                                if (num != -1)
                                {
                                    string s       = text.Substring(0, num);
                                    string dataStr = null;
                                    if (num < text.Length - 1)
                                    {
                                        dataStr = text.Substring(num + 1);
                                    }
                                    ExDateTime actionTime = ExDateTime.Parse(s);
                                    TData      value2     = Activator.CreateInstance <TData>();
                                    value2.Initialize(actionTime, dataStr);
                                    linkedList.AddFirst(value2);
                                }
                            }
                            this.actionHistory[amServerName] = linkedList;
                        }
                    }
                }
            }
        }
예제 #5
0
        public static void ReadRequestedDatabaseSchemaVersion(IClusterDB iClusterDB, Guid databaseGuid, int defaultVersion, out int requestedVersion)
        {
            string keyName = string.Format("Exchange\\Databases\\{0}\\Schema", databaseGuid);

            requestedVersion = iClusterDB.GetValue <int>(keyName, "Requested Version", defaultVersion);
        }