Example #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public Dns(AdConfiguration config)
        {
            // Initialize DnsCache.
            this.DnsCache = new ConcurrentDictionary<string, DnsCache>();

            // Store configuration.
            this.Config = config;
        }
Example #2
0
        /// <summary>
        /// Constructor to create cache.
        /// </summary>
        /// <param name="hostname">Hostname associated with cache entries.</param>
        /// <param name="serverIPs"></param>
        public DnsCache(string hostname, AdConfiguration config)
        {
            // Store hostname.
            this.Hostname = hostname;

            // Store configuration.
            this.Config = config;

            // Initialize cache.  It is not populated until Dns lookup is actually performed.
            this.CacheItems = new ConcurrentDictionary<IPAddress, DnsCacheItem>();
        }
Example #3
0
        /// <summary>
        /// Create new Active Directory connection.
        /// </summary>
        /// <param name="configuration">Configuration settings to use.</param>
        public AdService(AdConfiguration configuration)
        {
            // Verify a valid configuration object was passed.
            if (configuration == null)
            {
                throw new ArgumentException("A valid configuration was not specified.");
            }

            // Store configuration.
            this.Config = configuration;

            // Initialize Dns configuration.
            this.Dns = new Dns(this.Config);
        }