Exemplo n.º 1
0
 private void RefreshRidMasterInformation()
 {
     if (DateTime.UtcNow - this.lastRidMasterRefreshTime > FullSyncObjectRequestDataProvider.RidMasterRefreshInterval)
     {
         RidMasterInfo ridMasterInfo = SyncDaemonArbitrationConfigHelper.GetRidMasterInfo(this.configurationSession);
         this.configurationSession.DomainController = ridMasterInfo.RidMasterServer;
         this.lastRidMasterRefreshTime = DateTime.UtcNow;
     }
 }
        internal static ArbitrationConfigFromAD GetArbitrationConfigFromAD(string serviceInstanceName)
        {
            IConfigurationSession configurationSession = ForwardSyncDataAccessHelper.CreateSession(true);
            RidMasterInfo         ridMasterInfo        = SyncDaemonArbitrationConfigHelper.GetRidMasterInfo(configurationSession);

            SyncServiceInstance[] array = configurationSession.Find <SyncServiceInstance>(SyncServiceInstance.GetMsoSyncRootContainer(), QueryScope.SubTree, new ComparisonFilter(ComparisonOperator.Equal, ADObjectSchema.Name, serviceInstanceName), null, 1);
            if (array == null || array.Length != 1)
            {
                throw new SyncDaemonArbitrationConfigException(Strings.ErrorCannotRetrieveSyncDaemonArbitrationConfigContainer((array == null) ? "0" : array.Length.ToString()));
            }
            return(new ArbitrationConfigFromAD(array[0], ridMasterInfo));
        }