Ejemplo n.º 1
0
        public void PingPanoramaServer()
        {
            var panoramaServerUri = _panoramaSettings.PanoramaServerUri;

            if (!_panoramaSettings.PublishToPanorama || panoramaServerUri == null)
            {
                return;
            }

            var panoramaClient = new WebPanoramaClient(panoramaServerUri);

            try
            {
                var success = panoramaClient.PingPanorama(_panoramaSettings.PanoramaFolder,
                                                          _panoramaSettings.PanoramaUserEmail,
                                                          _panoramaSettings.PanoramaPassword
                                                          );

                if (success && _status != 1)
                {
                    _logger.Log("Successfully pinged Panorama server.");
                    _status = 1;
                }
                if (!success && _status != 2)
                {
//                        _logger.LogErrorToFile("Error pinging Panorama server.  Please confirm that " + panoramaServerUri +
//                                 " is running LabKey Server 16.1 or higher.");
                    _status = 2;
                }
            }
            catch (Exception ex)
            {
                if (_status != 2)
                {
                    _logger.LogException(ex, "Error pinging Panorama server " + panoramaServerUri);
                    _status = 2;
                }
            }
        }
Ejemplo n.º 2
0
        public void PingPanoramaServer()
        {
            var panoramaServerUri = _panoramaSettingsTab.PanoramaServerUri;

            if (_panoramaSettingsTab.IsSelected() && panoramaServerUri != null)
            {
                var panoramaClient = new WebPanoramaClient(panoramaServerUri);
                try
                {
                    var success = panoramaClient.PingPanorama(_panoramaSettingsTab.Settings.PanoramaFolder,
                                                              _panoramaSettingsTab.Settings.PanoramaUserEmail,
                                                              _panoramaSettingsTab.DecryptPassword(_panoramaSettingsTab.Settings.PanoramaPassword
                                                                                                   ));

                    if (success && _status != 1)
                    {
                        _logger.Log("Successfully pinged Panorama server.");
                        _status = 1;
                    }
                    if (!success && _status != 2)
                    {
                        _logger.LogErrorToFile("Error pinging Panorama server.  Please confirm that " + panoramaServerUri +
                                               " is running LabKey Server 16.1 or higher.");
                        _status = 2;
                    }
                }
                catch (Exception ex)
                {
                    if (_status != 2)
                    {
                        _logger.LogError("Error pinging Panorama server " + panoramaServerUri);
                        _logger.LogException(ex);
                        _status = 2;
                    }
                }
            }
        }