Beispiel #1
0
        public VersionOneQuery(VersionOneSettings settings)
        {
            Settings = settings;
            ProxyProvider proxyProvider = ((settings.ProxySettings != null) && settings.ProxySettings.ProxyIsEnabled) ? new ProxyProvider(settings.ProxySettings.Uri, settings.ProxySettings.Username, settings.ProxySettings.Password, settings.ProxySettings.Domain) : null;

            processor = new VersionOneAPIConnector(settings.Path, null, proxyProvider).WithVersionOneUsernameAndPassword(settings.Username, settings.Password).WithWindowsIntegratedAuthentication();
        }
        public V1Component(VersionOneSettings settings)
        {
            Settings = settings;
            var nativeSettings = ConvertSettings(settings);

            processor = new VersionOneProcessor(nativeSettings, new BlackholeLogger());
            AddProperties();
        }
Beispiel #3
0
        public VersionOneQuery GetVersionOneHelper(VersionOneSettings settings)
        {
            if (component == null || DifferentSettingsRequired(settings))
            {
                component = new VersionOneQuery(settings);

                logger.Info("Successfully connected to VersionOne.");
            }

            return(component);
        }
Beispiel #4
0
        private bool Equals(VersionOneSettings other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(other.Integrated.Equals(Integrated) && Equals(other.Path, Path) && Equals(other.Username, Username) && Equals(other.Password, Password) && Equals(other.ProxySettings, ProxySettings));
        }
        public V1Component GetV1Component(VersionOneSettings settings)
        {
            if (component == null || DifferentSettingsRequired(settings))
            {
                component = new V1Component(settings);

                if (!component.ValidateConnection())
                {
                    logger.Info("Failed to validate VersionOne connection");
                    throw new InvalidOperationException("Failed to validate VersionOne connection");
                }

                logger.Info("Successfully connected to VersionOne.");
            }

            return(component);
        }
Beispiel #6
0
 private bool DifferentSettingsRequired(VersionOneSettings settings)
 {
     return(component == null || !component.Settings.Equals(settings));
 }