public ExternalRmsServerInfoMap(string path, int maxCount, IMruDictionaryPerfCounters perfCounters)
        {
            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentNullException("path");
            }
            string uniqueFileNameForProcess = RmsClientManagerUtils.GetUniqueFileNameForProcess("ExternalRmsServerInfo_1.dat");

            this.dictionary = new MruDictionary <Uri, ExternalRMSServerInfo>(maxCount, new ExternalRmsServerInfoMap.UriComparer(), perfCounters);
            this.serializer = new MruDictionarySerializer <Uri, ExternalRMSServerInfo>(path, uniqueFileNameForProcess, ExternalRMSServerInfo.ColumnNames, new MruDictionarySerializerRead <Uri, ExternalRMSServerInfo>(ExternalRmsServerInfoMap.TryReadValues), new MruDictionarySerializerWrite <Uri, ExternalRMSServerInfo>(ExternalRmsServerInfoMap.TryWriteValues), perfCounters);
            if (!this.serializer.TryReadFromDisk(this.dictionary))
            {
                ExternalRmsServerInfoMap.Tracer.TraceError <string>(0L, "External Rms Server Info Map failed to read map-file ({0}).", uniqueFileNameForProcess);
            }
        }
Example #2
0
        public RmsLicenseStoreInfoMap(string path, int maxCount, IMruDictionaryPerfCounters perfCounters)
        {
            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentNullException("path");
            }
            this.path = path;
            string uniqueFileNameForProcess = RmsClientManagerUtils.GetUniqueFileNameForProcess("RmsLicenseStoreInfoMap_2.dat");

            this.dictionary             = new MruDictionary <MultiValueKey, RmsLicenseStoreInfo>(maxCount, new RmsLicenseStoreInfoMap.MultiValueKeyComparer(), perfCounters);
            this.dictionary.OnRemoved  += this.MruDictionaryOnRemoved;
            this.dictionary.OnReplaced += this.MruDictionaryOnReplaced;
            this.serializer             = new MruDictionarySerializer <MultiValueKey, RmsLicenseStoreInfo>(path, uniqueFileNameForProcess, RmsLicenseStoreInfo.ColumnNames, new MruDictionarySerializerRead <MultiValueKey, RmsLicenseStoreInfo>(RmsLicenseStoreInfoMap.TryReadValues), new MruDictionarySerializerWrite <MultiValueKey, RmsLicenseStoreInfo>(RmsLicenseStoreInfoMap.TryWriteValues), perfCounters);
            if (!this.serializer.TryReadFromDisk(this.dictionary))
            {
                RmsLicenseStoreInfoMap.Tracer.TraceError <string>(0L, "Rms License Store Info Map failed to read map-file ({0}).", uniqueFileNameForProcess);
            }
        }
Example #3
0
        public static void Start()
        {
            Server localServer = null;

            RmsClientManagerLog.rmsLogSchema = new LogSchema("Microsoft Exchange Server", Assembly.GetExecutingAssembly().GetName().Version.ToString(), "Rms Client Manager Log", RmsClientManagerLog.Fields);
            RmsClientManagerLog.rmsLog       = new Log(RmsClientManagerUtils.GetUniqueFileNameForProcess(RmsClientManagerLog.LogSuffix, true), new LogHeaderFormatter(RmsClientManagerLog.rmsLogSchema), "RmsClientManagerLog");
            ADOperationResult adoperationResult = ADNotificationAdapter.TryRunADOperation(delegate()
            {
                ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromRootOrgScopeSet(), 254, "Start", "f:\\15.00.1497\\sources\\dev\\data\\src\\storage\\rightsmanagement\\RmsClientManagerLog.cs");
                localServer = topologyConfigurationSession.FindLocalServer();
                RmsClientManagerLog.notificationCookie = ADNotificationAdapter.RegisterChangeNotification <Server>(localServer.Id, new ADNotificationCallback(RmsClientManagerLog.HandleConfigurationChange));
            });

            if (!adoperationResult.Succeeded)
            {
                RmsClientManagerLog.Tracer.TraceError <Exception>(0L, "Failed to get the local server.  Unable to load the log configuration. Error {0}", adoperationResult.Exception);
                throw new ExchangeConfigurationException(ServerStrings.FailedToReadConfiguration, adoperationResult.Exception);
            }
            RmsClientManagerLog.Configure(localServer);
        }
 public static string GetUniqueFileNameForProcess(string fileSuffix)
 {
     return(RmsClientManagerUtils.GetUniqueFileNameForProcess(fileSuffix, false));
 }