コード例 #1
0
        public QueryResultsDirectory(
			CurrentStorage storage
		)
            : base(storage,
				CreateTableDefinition())
        {
        }
コード例 #2
0
        protected QueryParameterDirectoryBase(
			CurrentStorage   storage,
			TableDefinition  tableDefinition
		)
            : base(storage, tableDefinition)
        {
        }
コード例 #3
0
        public TemplateDirectory(
			CurrentStorage storage
		)
            : base(storage,
				CreateTableDefinition())
        {
        }
コード例 #4
0
        public QueryGroupParameterDirectory(
			CurrentStorage storage
		)
            : base(storage,
				CreateTableDefinition())
        {
        }
コード例 #5
0
		public InternalSqliteConnectionDialog(MsSqlAuditorModel model)
		{
			this._model              = model;
			this._storage            = model.DefaultVaultProcessor.CurrentStorage;
			this._connectionsManager = new ConnectionsManager(model);
			this._loginManager       = new LoginManager(this._storage);
			this._templateManager    = new TemplateManager(this._storage);
			this._templates          = TemplateNodesLoader.GetTemplates();

			InitializeComponent();

			List<BindingWrapper<ConnectionType>> connectionTypes = this._model.ConnectionTypes;

			this.dataTypeBindingSource.DataSource = connectionTypes;
			this.dataTypeBindingSource.DataMember = "Item";
			this.cmbDataType.DataSource           = dataTypeBindingSource.DataSource;

			this.cmbDataType.SelectionChangeCommitted += this.cmbDataType_SelectedIndexChanged;

			this.cmbConnectionGroup.SelectionChangeCommitted += this.cmbConnectionGroup_SelectedIndexChanged;
			this.cmbServerInstance.SelectionChangeCommitted  += this.cmbServerInstance_SelectedIndexChanged;
			this.cmbTemplate.SelectionChangeCommitted        += this.cmbTemplate_SelectedIndexChanged;
			this.cmbLogin.SelectionChangeCommitted           += this.cmbLogin_SelectedIndexChanged;

			if (connectionTypes.Count > 0)
			{
				UpdateConnectionGroupList();
			}

			UpdateButtonsState();
		}
コード例 #6
0
        public ServerInstanceDirectory(
			CurrentStorage   storage
		)
            : base(storage,
				CreateTableDefinition())
        {
        }
        public TemplateNodeQueryParameterDirectory(
			CurrentStorage storage
		)
            : base(storage,
				CreateTableDefinition())
        {
        }
コード例 #8
0
		public ConnectionGroupDirectory(
			CurrentStorage storage
		) : base (
				storage,
				CreateTableDefinition()
			)
		{
		}
コード例 #9
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="connection"></param>
        /// <param name="tableDefinition"></param>
        /// <param name="readOnly">Is table read-only?</param>
        /// <param name="tableName">Table name</param>
        protected TableDirectory(
			CurrentStorage   storage,
			TableDefinition  tableDefinition
		)
            : base(storage,
				tableDefinition)
        {
        }
コード例 #10
0
		public SqliteInternalQueryConnection(
			CurrentStorage currentStorage,
			InstanceInfo   instance
		) : base(ConnectionFactory.CreateSQLiteConnection(currentStorage.FileName, false))
		{
			this._instance        = instance;
			this._currentScope    = currentStorage;
		}
コード例 #11
0
			public SqliteInternalQueryCommand(
				SQLiteCommand    command,
				CurrentStorage   currentScope,
				InstanceInfo     instanceInfo
			) : base(command)
			{
				this._instanceInfo   = instanceInfo;
				this._currentStorage = currentScope;
			}
コード例 #12
0
		public static ServerProperties Load(
			InstanceInfo        instance,
			CurrentStorage      storage
		)
		{
			ServerProperties storedProps = storage.ServerInstanceDirectory
				.GetServerProperties(instance);

			return storedProps;
		}
コード例 #13
0
		public CreateDirectConnectionDialog(MsSqlAuditorModel model)
		{
			this._model              = model;
			this._storage            = this._model.DefaultVaultProcessor.CurrentStorage;
			this._connectionsManager = new ConnectionsManager(model);

			SetLocale();

			InitializeComponent();
			InitializeEventHandlers();
			InitializeBindings();
		}
コード例 #14
0
		public static CurrentStorage Create(
			string         fileName,
			ICryptoService cryptoService,
			bool           readOnly = false
		)
		{
			CurrentStorage storage = new CurrentStorage(fileName, readOnly)
			{
				CryptoService = cryptoService
			};

			storage.CreateTables();

			return storage;
		}
コード例 #15
0
		public static QueryDirectories GetInstance(CurrentStorage storage, bool isGroupQuery)
		{
			if (isGroupQuery)
			{
				return new QueryDirectories(
					storage.QueryGroupDirectory,
					storage.QueryGroupParameterDirectory
				);
			}

			return new QueryDirectories(
				storage.QueryDirectory,
				storage.QueryParameterDirectory
			);
		}
コード例 #16
0
        public static CurrentStorage Create(
            string fileName,
            ICryptoService cryptoService,
            bool readOnly = false
            )
        {
            CurrentStorage storage = new CurrentStorage(fileName, readOnly)
            {
                CryptoService = cryptoService
            };

            storage.CreateTables();

            return(storage);
        }
コード例 #17
0
 public LastConnectionProtocolTable(CurrentStorage storage)
     : base(storage, CreateTableDefinition())
 {
 }
コード例 #18
0
		public UserSettingsManager()
		{
			this._currentStorage = Program.Model.DefaultVaultProcessor.CurrentStorage;
		}
コード例 #19
0
 public ServiceInfoTable(CurrentStorage storage)
     : base(storage, CreateTableDefinition())
 {
 }
コード例 #20
0
 public NodeInstanceTable(CurrentStorage storage)
     : base(storage, CreateTableDefinition())
 {
     this._storage = storage;
 }
コード例 #21
0
		public ServerProperties LoadServerProperties(CurrentStorage storage)
		{
			ServerProperties storedProps = ServerProperties.Load(this, storage);

			if (storedProps != null)
			{
				this._serverProperties = storedProps;
			}

			return this._serverProperties;
		}
コード例 #22
0
 public MetaResultTable(CurrentStorage storage)
     : base(storage, CreateTableDefinition())
 {
     this.maxRequestCache = null;
     this.maxRequestLock  = new object();
 }
コード例 #23
0
		public ScheduleJobProcessor(CurrentStorage storage)
		{
			this._storage = storage;
		}
コード例 #24
0
        public ScheduleSettingsTable(CurrentStorage storage)
            : base(storage,
				GetTableDefinition())
        {
        }
コード例 #25
0
		public LoginManager(CurrentStorage storage)
		{
			this._storage       = storage;
			this._cryptoService = storage.CryptoService;
		}
コード例 #26
0
		public SqliteInnerQueryConnection(
			CurrentStorage             currentStorage,
			SqliteConnectionParameters connectionParameters
		) : base(
				ConnectionFactory.CreateSQLiteConnection(currentStorage.FileName, true)
			)
		{
			SqliteConnectionParameters.Values paramValues =
				connectionParameters.Resolve(currentStorage);

			if (paramValues == null)
			{
				const string errorMessage = "Can not resolve SQLite internal connection parameters";

				Log.Error(errorMessage);

				throw new ArgumentException(errorMessage, "connectionParameters");
			}

			this._paramValues = paramValues;
		}
コード例 #27
0
		public Values Resolve(CurrentStorage storage)
		{
			string sqlQuery = string.Format(
				@"SELECT DISTINCT {0}.[{26}] AS {22}, {1}.[{27}] AS {23}, {5}.[{28}] AS {24}, {6}.[{29}] AS {25} FROM {0}
					JOIN {1} ON {0}.[{26}] = {1}.{7}
					JOIN {2} ON {1}.[{27}] = {2}.{8}
					JOIN {3} ON {3}.[{30}] = {2}.{9}
					JOIN {4} ON {4}.[{31}] = {3}.{10}
					JOIN {5} ON {5}.[{28}] = {4}.{11}
					JOIN {6} ON {6}.[{29}] = {1}.{12}
					WHERE {0}.{13}={14} AND {1}.{15}={16} AND {1}.{17} NOT NULL AND {5}.{18}={19} AND {6}.{20}={21}",
				ConnectionGroupDirectory.TableName,
				ServerInstanceDirectory.TableName,
				QueryDirectory.TableName,
				TemplateNodeQueryDirectory.TableName,
				TemplateNodeDirectory.TableName,
				TemplateDirectory.TableName,
				LoginDirectory.TableName,

				ConnectionGroupDirectory.TableName.AsFk(),
				ServerInstanceDirectory.TableName.AsFk(),
				TemplateNodeQueryDirectory.TableName.AsFk(),
				TemplateNodeDirectory.TableName.AsFk(),
				TemplateDirectory.TableName.AsFk(),
				LoginDirectory.TableName.AsFk(),

				ConnectionGroupDirectory.NameFn,
				Values.FieldGroupId.AsParamName(),

				ServerInstanceDirectory.ConnectionNameFn,
				Values.FieldServerId.AsParamName(),

				ServerInstanceDirectory.DbTypeFn,

				TemplateDirectory.NameFieldName,
				Values.FieldTemplateId.AsParamName(),

				LoginDirectory.LoginFn,
				Values.FieldLoginId.AsParamName(),

				Values.FieldGroupId,
				Values.FieldServerId,
				Values.FieldTemplateId,
				Values.FieldLoginId,

				ConnectionGroupDirectory.TableIdentityField,
				ServerInstanceDirectory.TableIdentityField,
				TemplateDirectory.TableIdentityField,
				LoginDirectory.TableIdentityField,
				TemplateNodeQueryDirectory.TableIdentityField,
				TemplateNodeDirectory.TableIdentityField
			);

			SQLiteParameter groupParameter    = CreateStringParameter(Values.FieldGroupId.AsParamName(),    Group);
			SQLiteParameter serverParameter   = CreateStringParameter(Values.FieldServerId.AsParamName(),   Connection);
			SQLiteParameter templateParameter = CreateStringParameter(Values.FieldTemplateId.AsParamName(), Template);
			SQLiteParameter loginParameter    = CreateStringParameter(Values.FieldLoginId.AsParamName(),    Login);

			using (SQLiteConnection connection = ConnectionFactory.CreateSQLiteConnection(storage.FileName, true))
			{
				connection.Open();

				List<Values> result = new List<Values>();

				new SqlSelectCommand(
					connection,
					sqlQuery,
					reader => result.Add(Values.FromReader(reader)),
					groupParameter,
					serverParameter,
					templateParameter,
					loginParameter
				)
				.Execute(100);

				return result.FirstOrDefault();
			}
		}
コード例 #28
0
		protected CurrentStorageTable(CurrentStorage storage, TableDefinition tableDefinition)
			: base(storage.Connection, tableDefinition)
		{
			Storage = storage;
		}
コード例 #29
0
		public ServerProperties InitServerProperties(CurrentStorage storage, int timeout = 0)
		{
			if (this._serverProperties == null)
			{
				try
				{
					this._serverProperties = ServerProperties.Query(this, timeout);

					storage.ServerInstanceDirectory.GetId(this.ConnectionGroup, this); // Save properties
				}
				catch (Exception exc)
				{
					log.WarnFormat(
						"Unable to retrieve instance version from remote server. Instance:'{0}';Authentication:'{1}';Exception:'{2}'",
						Instance,
						Authentication,
						exc
					);

					ServerProperties storedProps = LoadServerProperties(storage);

					if (storedProps == null)
					{
						log.WarnFormat(
							"Instance version is not available. Instance:'{0}';Authentication:'{1}';Exception:'{2}'",
							Instance,
							Authentication,
							exc
						);

						throw;
					}
				}
			}

			return this._serverProperties;
		}
コード例 #30
0
		public TemplateManager(CurrentStorage storage)
		{
			this._storage = storage;
		}
コード例 #31
0
        public UserSettingsTable(
			CurrentStorage storage
		)
            : base(storage, CreateTableDefinition())
        {
        }