示例#1
0
 public RouteSelector(ISharedCacheClient anchorMailboxSharedCacheClient, ISharedCacheClient mailboxServerSharedCacheClient, IRoutingLookupFactory locatorServiceLookupFactory)
 {
     if (anchorMailboxSharedCacheClient == null)
     {
         throw new ArgumentNullException("anchorMailboxCacheClient");
     }
     if (mailboxServerSharedCacheClient == null)
     {
         throw new ArgumentNullException("mailboxServerCacheClient");
     }
     if (locatorServiceLookupFactory == null)
     {
         throw new ArgumentNullException("locatorServiceLookupFactory");
     }
     this.Initialize(anchorMailboxSharedCacheClient, mailboxServerSharedCacheClient, locatorServiceLookupFactory);
 }
示例#2
0
 public ServerLocator(ISharedCacheClient anchorMailboxCacheClient, ISharedCacheClient mailboxServerCacheClient, IRoutingLookupFactory locatorServiceLookupFactory)
 {
     if (anchorMailboxCacheClient == null)
     {
         throw new ArgumentNullException("anchorMailboxCacheClient");
     }
     if (mailboxServerCacheClient == null)
     {
         throw new ArgumentNullException("mailboxServerCacheClient");
     }
     if (locatorServiceLookupFactory == null)
     {
         throw new ArgumentNullException("locatorServiceLookupFactory");
     }
     this.anchorMailboxCacheClient    = anchorMailboxCacheClient;
     this.mailboxServerCacheClient    = mailboxServerCacheClient;
     this.locatorServiceLookupFactory = locatorServiceLookupFactory;
     this.sharedCacheLookupFactory    = new SharedCacheLookupFactory(this.anchorMailboxCacheClient, this.mailboxServerCacheClient);
 }
示例#3
0
        public static bool AddEntry(this ISharedCacheClient cacheClient, IRoutingEntry entry)
        {
            SuccessfulMailboxRoutingEntry firstRoutingEntry = entry as SuccessfulMailboxRoutingEntry;

            if (firstRoutingEntry != null)
            {
                DatabaseGuidRoutingDestination databaseGuidRoutingDestination = entry.Destination as DatabaseGuidRoutingDestination;
                if (databaseGuidRoutingDestination != null)
                {
                    string sharedCacheKeyFromRoutingKey             = cacheClient.GetSharedCacheKeyFromRoutingKey(entry.Key);
                    AnchorMailboxCacheEntry anchorMailboxCacheEntry = new AnchorMailboxCacheEntry();
                    anchorMailboxCacheEntry.Database   = new ADObjectId(databaseGuidRoutingDestination.DatabaseGuid, databaseGuidRoutingDestination.ResourceForest);
                    anchorMailboxCacheEntry.DomainName = databaseGuidRoutingDestination.DomainName;
                    DateTime utcNow = DateTime.UtcNow;
                    string   text;
                    return(cacheClient.TryInsert(sharedCacheKeyFromRoutingKey, anchorMailboxCacheEntry.ToByteArray(), utcNow, out text));
                }
            }
            else
            {
                SuccessfulDatabaseGuidRoutingEntry successfulDatabaseGuidRoutingEntry = entry as SuccessfulDatabaseGuidRoutingEntry;
                if (successfulDatabaseGuidRoutingEntry != null)
                {
                    ServerRoutingDestination serverRoutingDestination = entry.Destination as ServerRoutingDestination;
                    if (serverRoutingDestination != null)
                    {
                        BackEndServer backEndServer = new BackEndServer(serverRoutingDestination.Fqdn, serverRoutingDestination.Version ?? 0);
                        string        resourceForest;
                        if (Utilities.TryExtractForestFqdnFromServerFqdn(backEndServer.Fqdn, out resourceForest))
                        {
                            MailboxServerCacheEntry value = new MailboxServerCacheEntry(backEndServer, resourceForest, DateTime.UtcNow, false);
                            DateTime utcNow2 = DateTime.UtcNow;
                            DatabaseGuidRoutingKey databaseGuidRoutingKey = successfulDatabaseGuidRoutingEntry.Key as DatabaseGuidRoutingKey;
                            string text2;
                            return(cacheClient.TryInsert(databaseGuidRoutingKey.DatabaseGuid.ToString(), value, utcNow2, out text2));
                        }
                    }
                }
            }
            return(false);
        }
示例#4
0
 private void Initialize(ISharedCacheClient anchorMailboxSharedCacheClient, ISharedCacheClient mailboxServerSharedCacheClient, IRoutingLookupFactory locatorServiceLookupFactory)
 {
     this.anchorMailboxSharedCacheClient = anchorMailboxSharedCacheClient;
     this.mailboxServerSharedCacheClient = mailboxServerSharedCacheClient;
     this.locatorServiceLookupFactory    = locatorServiceLookupFactory;
 }
示例#5
0
 public void Initialize(IRouteRefresherDiagnostics diagnostics, ISharedCacheClient anchorMailboxCacheClient, ISharedCacheClient mailboxServerCacheClient)
 {
     this.routeRefresherDiagnostics = diagnostics;
     this.anchorMailboxCacheClient  = anchorMailboxCacheClient;
     this.mailboxServerCacheClient  = mailboxServerCacheClient;
 }
示例#6
0
 public RouteRefresher(ISharedCacheClient anchorMailboxCacheClient, ISharedCacheClient mailboxServerCacheClient, IRouteRefresherDiagnostics diagnostics)
 {
     this.Initialize(diagnostics, anchorMailboxCacheClient, mailboxServerCacheClient);
 }