public bugzilla_properties CheckConnection(BugzillaProfile profile) { var errors = new PluginProfileErrorCollection(); try { SetServerCertificateValidationCallback(profile); var validators = new Queue<Validator>(); var connectionValidator = new ConnectionValidator(profile); validators.Enqueue(connectionValidator); var scriptValidator = new ScriptValidator(profile); validators.Enqueue(scriptValidator); var responseValidator = new ResponseValidator(profile, scriptValidator); validators.Enqueue(responseValidator); var deserializeValidator = new DeserializeValidator(profile, responseValidator); validators.Enqueue(deserializeValidator); var settingsValidator = new SettingsValidator(profile, deserializeValidator); validators.Enqueue(settingsValidator); var savedQueryValidator = new SavedQueryValidator(profile); validators.Enqueue(savedQueryValidator); while (validators.Count > 0) { var validator = validators.Dequeue(); validator.Execute(errors); } if (errors.Any()) { throw new BugzillaPluginProfileException(profile, errors); } return deserializeValidator.Data; } catch (BugzillaPluginProfileException) { throw; } catch (Exception ex) { errors.Add(new PluginProfileError { FieldName = BugzillaProfile.ProfileField, Message = string.Format("The connection with {0} is failed. {1}", profile, ex.Message) }); throw new BugzillaPluginProfileException(profile, errors); } }
public bugzilla_properties CheckConnection(BugzillaProfile profile) { var errors = new PluginProfileErrorCollection(); try { var validators = new Queue <Validator>(); var connectionValidator = new ConnectionValidator(profile); validators.Enqueue(connectionValidator); var scriptValidator = new ScriptValidator(profile); validators.Enqueue(scriptValidator); var responseValidator = new ResponseValidator(profile, scriptValidator); validators.Enqueue(responseValidator); var deserializeValidator = new DeserializeValidator(profile, responseValidator); validators.Enqueue(deserializeValidator); var settingsValidator = new SettingsValidator(profile, deserializeValidator); validators.Enqueue(settingsValidator); var savedQueryValidator = new SavedQueryValidator(profile); validators.Enqueue(savedQueryValidator); while (validators.Count > 0) { var validator = validators.Dequeue(); validator.Execute(errors); } if (errors.Any()) { throw new BugzillaPluginProfileException(profile, errors); } return(deserializeValidator.Data); } catch (BugzillaPluginProfileException) { throw; } catch (Exception ex) { errors.Add(new PluginProfileError { FieldName = BugzillaProfile.ProfileField, Message = string.Format("The connection with {0} is failed. {1}", profile, ex.Message) }); throw new BugzillaPluginProfileException(profile, errors); } }
public SettingsValidator(IBugTrackingConnectionSettingsSource connectionSettings, DeserializeValidator deserializeValidator) : base(connectionSettings) { _deserializeValidator = deserializeValidator; }