/// <summary> /// <para>Initialises Inventory interface</para> /// <para> /// <list type="bullet"> /// <item>Loads and initialises the MySQL storage plugin</item> /// <item>warns and uses the obsolete mysql_connection.ini if connect string is empty.</item> /// <item>Check for migration</item> /// </list> /// </para> /// </summary> /// <param name="connect">connect string</param> public void Initialise(string connect) { if (connect != String.Empty) { database = new MySQLManager(connect); } else { m_log.Warn("Reverting to deprecated mysql_connection.ini file for connection info"); IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); } // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; Migration m = new Migration(database.Connection, assem, "InventoryStore"); m.Update(); }
/// <summary> /// Artificial constructor called when the plugin is loaded /// Uses the obsolete mysql_connection.ini if connect string is empty. /// </summary> /// <param name="connect">connect string</param> public void Initialise(string connect) { if (connect != String.Empty) { database = new MySQLManager(connect); } else { m_log.Warn("Using deprecated mysql_connection.ini. Please update database_connect in GridServer_Config.xml and we'll use that instead"); IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); } // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; Migration m = new Migration(database.Connection, assem, "LogStore"); // TODO: After rev 6000, remove this. People should have // been rolled onto the new migration code by then. TestTables(m); m.Update(); }
/// <summary> /// Initialise User Interface /// Loads and initialises the MySQL storage plugin /// Warns and uses the obsolete mysql_connection.ini if connect string is empty. /// Checks for migration /// </summary> /// <param name="connect">connect string.</param> public override void Initialise(string connect) { if (connect == String.Empty) { // TODO: actually do something with our connect string // instead of loading the second config m_log.Warn("Using obsoletely mysql_connection.ini, try using user_source connect string instead"); IniFile iniFile = new IniFile("mysql_connection.ini"); string settingHostname = iniFile.ParseFileReadValue("hostname"); string settingDatabase = iniFile.ParseFileReadValue("database"); string settingUsername = iniFile.ParseFileReadValue("username"); string settingPassword = iniFile.ParseFileReadValue("password"); string settingPooling = iniFile.ParseFileReadValue("pooling"); string settingPort = iniFile.ParseFileReadValue("port"); m_connectString = "Server=" + settingHostname + ";Port=" + settingPort + ";Database=" + settingDatabase + ";User ID=" + settingUsername + ";Password="******";Pooling=" + settingPooling + ";"; m_log.Info("Creating " + m_maxConnections + " DB connections..."); for (int i = 0; i < m_maxConnections; i++) { m_log.Info("Connecting to DB... [" + i + "]"); MySQLSuperManager msm = new MySQLSuperManager(); msm.Manager = new MySQLManager(m_connectString); m_dbconnections.Add(i, msm); } database = new MySQLManager(m_connectString); } else { m_connectString = connect; database = new MySQLManager(m_connectString); m_log.Info("Creating " + m_maxConnections + " DB connections..."); for (int i = 0; i < m_maxConnections; i++) { m_log.Info("Connecting to DB... [" + i + "]"); MySQLSuperManager msm = new MySQLSuperManager(); msm.Manager = new MySQLManager(m_connectString); m_dbconnections.Add(i, msm); } } // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; Migration m = new Migration(database.Connection, assem, "UserStore"); m.Update(); }
/// <summary> /// <para>Initialises Asset interface</para> /// <para> /// <list type="bullet"> /// <item>Loads and initialises the MySQL storage plugin</item> /// <item>uses the obsolete mysql_connection.ini</item> /// </list> /// </para> /// </summary> /// <remarks>DEPRECATED and shouldn't be used</remarks> public override void Initialise() { IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); string hostname = GridDataMySqlFile.ParseFileReadValue("hostname"); string database = GridDataMySqlFile.ParseFileReadValue("database"); string username = GridDataMySqlFile.ParseFileReadValue("username"); string password = GridDataMySqlFile.ParseFileReadValue("password"); string pooling = GridDataMySqlFile.ParseFileReadValue("pooling"); string port = GridDataMySqlFile.ParseFileReadValue("port"); _dbConnection = new MySQLManager(hostname, database, username, password, pooling, port); }
/// <summary> /// <para>Initialises Grid interface</para> /// <para> /// <list type="bullet"> /// <item>Loads and initialises the MySQL storage plugin</item> /// <item>Warns and uses the obsolete mysql_connection.ini if connect string is empty.</item> /// <item>Check for migration</item> /// </list> /// </para> /// </summary> /// <param name="connect">connect string.</param> override public void Initialise(string connect) { m_connectionString = connect; m_database = new MySQLManager(connect); // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { Migration m = new Migration(dbcon, assem, "GridStore"); m.Update(); } }
/// <summary> /// <para>Initialises Grid interface</para> /// <para> /// <list type="bullet"> /// <item>Loads and initialises the MySQL storage plugin</item> /// <item>Warns and uses the obsolete mysql_connection.ini if connect string is empty.</item> /// <item>Check for migration</item> /// </list> /// </para> /// </summary> /// <param name="connect">connect string.</param> override public void Initialise(string connect) { if (connect != String.Empty) { database = new MySQLManager(connect); m_log.Info("Creating " + m_maxConnections + " DB connections..."); for (int i = 0; i < m_maxConnections; i++) { m_log.Info("Connecting to DB... [" + i + "]"); MySQLSuperManager msm = new MySQLSuperManager(); msm.Manager = new MySQLManager(connect); m_dbconnections.Add(i, msm); } } else { m_log.Warn("Using deprecated mysql_connection.ini. Please update database_connect in GridServer_Config.xml and we'll use that instead"); IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); m_log.Info("Creating " + m_maxConnections + " DB connections..."); for (int i = 0; i < m_maxConnections; i++) { m_log.Info("Connecting to DB... [" + i + "]"); MySQLSuperManager msm = new MySQLSuperManager(); msm.Manager = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); m_dbconnections.Add(i, msm); } } // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; Migration m = new Migration(database.Connection, assem, "GridStore"); m.Update(); }
/// <summary> /// <para>Initializes Asset interface</para> /// <para> /// <list type="bullet"> /// <item>Loads and initializes the MySQL storage plugin.</item> /// <item>Warns and uses the obsolete mysql_connection.ini if connect string is empty.</item> /// <item>Check for migration</item> /// </list> /// </para> /// </summary> /// <param name="connect">connect string</param> override public void Initialize(string connect) { TicksToEpoch = new DateTime(1970,1,1).Ticks; // TODO: This will let you pass in the connect string in // the config, though someone will need to write that. if (String.IsNullOrEmpty(connect)) { // This is old seperate config file m_log.Warn("no connect string, using old mysql_connection.ini instead"); Initialize(); } else { _dbConnection = new MySQLManager(connect); } }
/// <summary> /// <para>Initializes Asset interface</para> /// <para> /// <list type="bullet"> /// <item>Loads and initializes the MySQL storage plugin.</item> /// <item>Warns and uses the obsolete mysql_connection.ini if connect string is empty.</item> /// <item>Check for migration</item> /// </list> /// </para> /// </summary> /// <param name="connect">connect string</param> override public void Initialize(string connect) { TicksToEpoch = new DateTime(1970, 1, 1).Ticks; // TODO: This will let you pass in the connect string in // the config, though someone will need to write that. if (connect == String.Empty) { // This is old seperate config file m_log.Warn("no connect string, using old mysql_connection.ini instead"); Initialize(); } else { _dbConnection = new MySQLManager(connect); } }
/// <summary> /// <para>Initialises Asset interface</para> /// <para> /// <list type="bullet"> /// <item>Loads and initialises the MySQL storage plugin.</item> /// <item>Warns and uses the obsolete mysql_connection.ini if connect string is empty.</item> /// <item>Check for migration</item> /// </list> /// </para> /// </summary> /// <param name="connect">connect string</param> override public void Initialise(string connect) { // TODO: This will let you pass in the connect string in // the config, though someone will need to write that. if (connect == String.Empty) { // This is old seperate config file m_log.Warn("no connect string, using old mysql_connection.ini instead"); Initialise(); } else { _dbConnection = new MySQLManager(connect); } // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; Migration m = new Migration(_dbConnection.Connection, assem, "AssetStore"); m.Update(); }
/// <summary> /// Artificial constructor called when the plugin is loaded /// Uses the obsolete mysql_connection.ini if connect string is empty. /// </summary> /// <param name="connect">connect string</param> public void Initialize(string connect) { if (connect != String.Empty) { database = new MySQLManager(connect); } else { m_log.Warn("Using deprecated mysql_connection.ini. Please update database_connect in GridServer_Config.xml and we'll use that instead"); IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); } }
/// <summary> /// Artificial constructor called when the plugin is loaded /// Uses the obsolete mysql_connection.ini if connect string is empty. /// </summary> /// <param name="connect">connect string</param> public void Initialize(string connect) { if (!String.IsNullOrEmpty(connect)) { database = new MySQLManager(connect); } else { m_log.Warn("Using deprecated mysql_connection.ini. Please update database_connect in GridServer_Config.xml and we'll use that instead"); IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); } }
/// <summary> /// <para>Initialises Asset interface</para> /// <para> /// <list type="bullet"> /// <item>Loads and initialises the MySQL storage plugin.</item> /// <item>Warns and uses the obsolete mysql_connection.ini if connect string is empty.</item> /// <item>Check for migration</item> /// </list> /// </para> /// </summary> /// <param name="connect">connect string</param> override public void Initialise(string connect) { TicksToEpoch = new DateTime(1970, 1, 1).Ticks; // TODO: This will let you pass in the connect string in // the config, though someone will need to write that. if (connect == String.Empty) { // This is old seperate config file m_log.Warn("no connect string, using old mysql_connection.ini instead"); Initialise(); } else { _dbConnection = new MySQLManager(connect); } // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; Migration m = new Migration(_dbConnection.Connection, assem, "AssetStore"); m.Update(); }