Пример #1
0
        private void Connect(ReplicationTopology topology)
        {
            EdgeSyncLog        edgeSyncLog = new EdgeSyncLog(string.Empty, new Version(), string.Empty, string.Empty, string.Empty);
            EdgeSyncLogSession logSession  = edgeSyncLog.OpenSession(string.Empty, string.Empty, 0, string.Empty, EdgeSyncLoggingLevel.None);

            try
            {
                DirectTrust.Load();
                NetworkCredential networkCredential = Util.ExtractNetworkCredential(topology.LocalHub, this.edgeServer.Fqdn, logSession);
                if (networkCredential == null)
                {
                    this.failureDetail = Strings.NoCredentialsFound(this.EdgeServer.Fqdn).ToString();
                }
                else
                {
                    this.edgeConnection = (LdapTargetConnection)TestEdgeConnectionFactory.Create(topology.LocalHub, new TargetServerConfig(this.EdgeServer.Name, this.EdgeServer.Fqdn, this.EdgeServer.EdgeSyncAdamSslPort), networkCredential, SyncTreeType.General, logSession);
                    this.failureDetail  = string.Empty;
                    if (this.edgeConnection != null)
                    {
                        this.ExtractLeaseInfo();
                        this.ExtractCookieRecords();
                    }
                }
            }
            catch (ExDirectoryException ex)
            {
                this.failureDetail  = ex.Message;
                this.edgeConnection = null;
            }
            finally
            {
                DirectTrust.Unload();
            }
        }
Пример #2
0
 public ConfigValidator(ReplicationTopology topology, string configObjectName) : base(topology)
 {
     this.searchScope         = SearchScope.Subtree;
     this.orgConfigObjectList = new Dictionary <string, ExSearchResultEntry>();
     this.orgAdRootPath       = DistinguishedName.RemoveLeafRelativeDistinguishedNames(base.Topology.LocalHub.DistinguishedName, 4);
     this.configObjectName    = configObjectName;
 }
Пример #3
0
 public EdgeConnectionInfo(ReplicationTopology topology, Server edgeServer)
 {
     this.edgeServer           = edgeServer;
     this.leaseType            = LeaseTokenType.None;
     this.lastSynchronizedDate = DateTime.MinValue;
     this.Connect(topology);
 }
Пример #4
0
 public RecipientValidator(ReplicationTopology topology) : base(topology, "Recipients")
 {
     base.ConfigDirectoryPath = string.Empty;
     base.LdapQuery           = Schema.Query.QueryAllSmtpRecipients;
     this.orgConfigRoot       = base.OrgAdRootPath;
     base.OrgAdRootPath       = DistinguishedName.RemoveLeafRelativeDistinguishedNames(base.Topology.LocalHub.DistinguishedName, 8);
     this.compareAttributes   = this.PayloadAttributes;
 }
Пример #5
0
        public static bool TryLoadLocalSiteTopology(string domainController, out ReplicationTopology topology, out Exception exception)
        {
            topology  = null;
            exception = null;
            ITopologyConfigurationSession session = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(domainController, true, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 154, "TryLoadLocalSiteTopology", "f:\\15.00.1497\\sources\\dev\\EdgeSync\\src\\Common\\Validation\\ReplicationTopology.cs");
            ADSite localSite = null;
            EdgeSyncServiceConfig edgeSyncServiceConfig = null;
            ADOperationResult     adoperationResult     = ADNotificationAdapter.TryRunADOperation(delegate()
            {
                localSite = session.GetLocalSite();
                if (localSite == null)
                {
                    throw new ADTransientException(Strings.CannotGetLocalSite);
                }
                edgeSyncServiceConfig = session.Read <EdgeSyncServiceConfig>(localSite.Id.GetChildId("EdgeSyncService"));
            }, 3);

            if (!adoperationResult.Succeeded)
            {
                exception = adoperationResult.Exception;
                return(false);
            }
            if (edgeSyncServiceConfig == null)
            {
                topology = new ReplicationTopology(session, null, localSite, null);
                return(true);
            }
            ReplicationTopology resultTopology = null;

            adoperationResult = ADNotificationAdapter.TryRunADOperation(delegate()
            {
                Server server      = session.FindLocalServer();
                resultTopology     = new ReplicationTopology(session, server, localSite, edgeSyncServiceConfig);
                QueryFilter filter = Util.BuildServerFilterForSite(localSite.Id);
                ADPagedReader <Server> adpagedReader = session.FindPaged <Server>(null, QueryScope.SubTree, filter, null, 0);
                resultTopology.siteEdgeServers.Clear();
                resultTopology.siteHubServers.Clear();
                foreach (Server server2 in adpagedReader)
                {
                    if (server2.IsEdgeServer)
                    {
                        resultTopology.siteEdgeServers.Add(server2);
                    }
                    if (server2.IsHubTransportServer)
                    {
                        resultTopology.siteHubServers.Add(server2);
                    }
                }
            }, 3);
            if (!adoperationResult.Succeeded)
            {
                exception = adoperationResult.Exception;
                return(false);
            }
            topology = resultTopology;
            return(true);
        }
Пример #6
0
 public EdgeSyncValidator(ReplicationTopology topology)
 {
     this.topology = topology;
 }
Пример #7
0
 public TransportServerValidator(ReplicationTopology topology) : base(topology, "Transport Server")
 {
     base.ConfigDirectoryPath = "CN=" + AdministrativeGroup.DefaultName + ",CN=Administrative Groups";
     base.LdapQuery           = Schema.Query.QueryBridgeheads;
 }
Пример #8
0
 public SendConnectorValidator(ReplicationTopology topology) : base(topology, "Send Connector")
 {
     base.ConfigDirectoryPath = "CN=" + AdministrativeGroup.DefaultName + ",CN=Administrative Groups";
     base.LdapQuery           = Schema.Query.QuerySendConnectors;
 }
 public AcceptedDomainValidator(ReplicationTopology topology) : base(topology, "Accepted Domain")
 {
     base.ConfigDirectoryPath = "CN=Accepted Domains,CN=Transport Settings";
     base.LdapQuery           = Schema.Query.QueryAll;
 }
 public TransportConfigValidator(ReplicationTopology topology) : base(topology, "Transport Configuration")
 {
     base.SearchScope         = SearchScope.Base;
     base.ConfigDirectoryPath = "CN=Transport Settings";
     base.LdapQuery           = Schema.Query.QueryAll;
 }
 public RemoteDomainValidator(ReplicationTopology topology) : base(topology, "Remote Domain")
 {
     base.ConfigDirectoryPath = "CN=Internet Message Formats,CN=Global Settings";
     base.LdapQuery           = Schema.Query.QueryAll;
 }
Пример #12
0
 public MessageClassificationValidator(ReplicationTopology topology) : base(topology, "Message Classification")
 {
     base.ConfigDirectoryPath = "CN=Message Classifications,CN=Transport Settings";
     base.LdapQuery           = Schema.Query.QueryAll;
 }