Ejemplo n.º 1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="serviceSettings">Discovery service settings.</param>
        /// <param name="servers">Available arcgis-servers.</param>
        /// <param name="solveServiceValidator">Services validator.</param>
        public DiscoveryService(DiscoveryServiceInfo serviceSettings,
                                ICollection <AgsServer> servers,
                                ISolveServiceValidator solveServiceValidator)
        {
            Debug.Assert(serviceSettings != null);
            Debug.Assert(servers != null);
            Debug.Assert(solveServiceValidator != null);

            // Validate services config.
            solveServiceValidator.Validate(serviceSettings);

            _discoveryServiceConfig = serviceSettings;

            _server = ServiceHelper.FindServerByName(serviceSettings.ServerName, servers);

            // Initialize service if server was found successfully.
            if (_server != null)
            {
                Initialize();
            }
        }