From ca724636d4615c6c58d3830fa8ccd620250886ea Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 26 Jun 2008 12:38:03 +0000 Subject: Apply patch from bug #1601 -- more documentation for Data/MySQL. Thanks kerunix_Flan! --- OpenSim/Data/MySQL/MySQLAssetData.cs | 61 +++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 19 deletions(-) (limited to 'OpenSim/Data/MySQL/MySQLAssetData.cs') diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index a29e11b..a64a256 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -36,6 +36,9 @@ using OpenSim.Framework; namespace OpenSim.Data.MySQL { + /// + /// A MySQL Interface for the Asset Server + /// internal class MySQLAssetData : AssetDataBase, IPlugin { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -45,12 +48,16 @@ namespace OpenSim.Data.MySQL #region IPlugin Members /// - /// Initialises Asset interface - /// Loads and initialises the MySQL storage plugin - /// Warns and uses the obsolete mysql_connection.ini if connect string is empty. - /// Check for migration + /// Initialises Asset interface + /// + /// + /// Loads and initialises the MySQL storage plugin. + /// Warns and uses the obsolete mysql_connection.ini if connect string is empty. + /// Check for migration + /// + /// /// - /// connect string. + /// connect string override public void Initialise(string connect) { // TODO: This will let you pass in the connect string in @@ -78,10 +85,16 @@ namespace OpenSim.Data.MySQL } /// - /// uses the obsolete mysql_connection.ini + /// Initialises Asset interface + /// + /// + /// Loads and initialises the MySQL storage plugin + /// uses the obsolete mysql_connection.ini + /// + /// /// - /// connect string. - /// Probably deprecated and shouldn't be used + /// connect string + /// Probably DEPRECATED and shouldn't be used override public void Initialise() { IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); @@ -98,6 +111,13 @@ namespace OpenSim.Data.MySQL #region IAssetProvider Members + /// + /// + /// Execute CreateAssetsTable.sql if oldVersion == null + /// do nothing if oldVersion != null + /// + /// + /// private void UpgradeAssetsTable(string oldVersion) { // null as the version, indicates that the table didn't exist @@ -112,6 +132,7 @@ namespace OpenSim.Data.MySQL /// /// Ensure that the assets related tables exists and are at the latest version /// + /// private void TestTables(Migration m) { Dictionary tableList = new Dictionary(); @@ -129,10 +150,11 @@ namespace OpenSim.Data.MySQL } /// - /// + /// Fetch Asset from database /// - /// - /// + /// Asset UUID to fetch + /// Return the asset + /// On failure : throw an exception and attempt to reconnect to database override public AssetBase FetchAsset(LLUUID assetID) { AssetBase asset = null; @@ -175,9 +197,10 @@ namespace OpenSim.Data.MySQL } /// - /// + /// Create an asset in database, or update it if existing. /// - /// + /// Asset UUID to create + /// On failure : Throw an exception and attempt to reconnect to database override public void CreateAsset(AssetBase asset) { lock (_dbConnection) @@ -224,19 +247,19 @@ namespace OpenSim.Data.MySQL } /// - /// + /// Update a asset in database, see /// - /// + /// Asset UUID to update override public void UpdateAsset(AssetBase asset) { CreateAsset(asset); } /// - /// + /// check if the asset UUID exist in database /// - /// - /// + /// The asset UUID + /// true if exist. override public bool ExistsAsset(LLUUID uuid) { bool assetExists = false; @@ -285,7 +308,7 @@ namespace OpenSim.Data.MySQL #endregion /// - /// database provider version + /// Database provider version /// override public string Version { -- cgit v1.1