From 8a0a0f9bb563f2cb7ec823587e13e3f4483d3a68 Mon Sep 17 00:00:00 2001
From: Jeff Ames
Date: Thu, 26 Jun 2008 01:12:28 +0000
Subject: Add patch from bug #1596 - adds Doxygen documentation in
OpenSim.Data.MySQL files. Thanks kerunix_Flan!
---
OpenSim/Data/MySQL/MySQLAssetData.cs | 37 ++++++++++++++++-
OpenSim/Data/MySQL/MySQLDataStore.cs | 68 ++++++++++++++++++++++++++++++--
OpenSim/Data/MySQL/MySQLGridData.cs | 24 +++++++++--
OpenSim/Data/MySQL/MySQLInventoryData.cs | 31 ++++++++++++++-
OpenSim/Data/MySQL/MySQLLogData.cs | 5 +++
OpenSim/Data/MySQL/MySQLManager.cs | 34 ++++++++++++++--
OpenSim/Data/MySQL/MySQLUserData.cs | 42 ++++++++++++++++++--
7 files changed, 224 insertions(+), 17 deletions(-)
(limited to 'OpenSim/Data')
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs
index 3cda5b8..a29e11b 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -44,6 +44,13 @@ 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
+ ///
+ /// connect string.
override public void Initialise(string connect)
{
// TODO: This will let you pass in the connect string in
@@ -70,6 +77,11 @@ namespace OpenSim.Data.MySQL
m.Update();
}
+ ///
+ /// uses the obsolete mysql_connection.ini
+ ///
+ /// connect string.
+ /// Probably deprecated and shouldn't be used
override public void Initialise()
{
IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
@@ -116,6 +128,11 @@ namespace OpenSim.Data.MySQL
m.Version = 1;
}
+ ///
+ ///
+ ///
+ ///
+ ///
override public AssetBase FetchAsset(LLUUID assetID)
{
AssetBase asset = null;
@@ -157,6 +174,10 @@ namespace OpenSim.Data.MySQL
return asset;
}
+ ///
+ ///
+ ///
+ ///
override public void CreateAsset(AssetBase asset)
{
lock (_dbConnection)
@@ -202,11 +223,20 @@ namespace OpenSim.Data.MySQL
}
}
+ ///
+ ///
+ ///
+ ///
override public void UpdateAsset(AssetBase asset)
{
CreateAsset(asset);
}
+ ///
+ ///
+ ///
+ ///
+ ///
override public bool ExistsAsset(LLUUID uuid)
{
bool assetExists = false;
@@ -254,12 +284,17 @@ namespace OpenSim.Data.MySQL
#endregion
-
+ ///
+ /// database provider version
+ ///
override public string Version
{
get { return _dbConnection.getVersion(); }
}
+ ///
+ /// The name of this DB provider
+ ///
override public string Name
{
get { return "MySQL Asset storage engine"; }
diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs
index d3e7a90..def875f 100644
--- a/OpenSim/Data/MySQL/MySQLDataStore.cs
+++ b/OpenSim/Data/MySQL/MySQLDataStore.cs
@@ -85,7 +85,11 @@ namespace OpenSim.Data.MySQL
*
**********************************************************************/
- // see IRegionDataStore
+ ///
+ /// see IRegionDataStore
+ ///
+ ///
+ ///
public void Initialise(string connectionstring, bool persistPrimInventories)
{
m_dataSet = new DataSet();
@@ -221,7 +225,7 @@ namespace OpenSim.Data.MySQL
///
/// Execute a SQL statement stored in a resource, as a string
///
- ///
+ /// the ressource name
public void ExecuteResourceSql(string name, MySqlConnection dbcon)
{
MySqlCommand cmd = new MySqlCommand(getResourceString(name), dbcon);
@@ -255,6 +259,10 @@ namespace OpenSim.Data.MySQL
throw new Exception(string.Format("Resource '{0}' was not found", name));
}
+ ///
+ ///
+ ///
+ ///
private void UpgradeLandTable(string oldVersion, MySqlConnection dbconn)
{
// null as the version, indicates that the table didn't exist
@@ -268,6 +276,12 @@ namespace OpenSim.Data.MySQL
ExecuteResourceSql("UpgradeLandTableToVersion2.sql", dbconn);
}
}
+
+ ///
+ /// Adds an object into region storage
+ ///
+ ///
+ ///
public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
{
lock (m_dataSet)
@@ -290,6 +304,11 @@ namespace OpenSim.Data.MySQL
}
}
+ ///
+ /// removes an object from region storage
+ ///
+ ///
+ ///
public void RemoveObject(LLUUID obj, LLUUID regionUUID)
{
m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID);
@@ -327,6 +346,7 @@ namespace OpenSim.Data.MySQL
/// Remove all persisted items of the given prim.
/// The caller must acquire the necessrary synchronization locks and commit or rollback changes.
///
+ /// the Item UUID
private void RemoveItems(LLUUID uuid)
{
String sql = String.Format("primID = '{0}'", uuid);
@@ -341,6 +361,7 @@ namespace OpenSim.Data.MySQL
///
/// Load persisted objects from region storage.
///
+ /// the Region UUID
public List LoadObjects(LLUUID regionUUID)
{
Dictionary createdObjects = new Dictionary();
@@ -460,6 +481,11 @@ namespace OpenSim.Data.MySQL
}
}
+ ///
+ /// Store a terrain revision in region storage
+ ///
+ /// terrain data
+ /// region UUID
public void StoreTerrain(double[,] ter, LLUUID regionID)
{
int revision = 1;
@@ -483,6 +509,11 @@ namespace OpenSim.Data.MySQL
}
}
+ ///
+ /// Load the latest terrain revision from region storage
+ ///
+ /// the region UUID
+ ///
public double[,] LoadTerrain(LLUUID regionID)
{
double[,] terret = new double[256,256];
@@ -531,6 +562,11 @@ namespace OpenSim.Data.MySQL
return terret;
}
+ ///
+ /// delete from land where UUID=globalID
+ /// delete from landaccesslist where LandUUID=globalID
+ ///
+ ///
public void RemoveLandObject(LLUUID globalID)
{
lock (m_dataSet)
@@ -551,6 +587,9 @@ namespace OpenSim.Data.MySQL
}
}
+ ///
+ ///
+ ///
public void StoreLandObject(ILandObject parcel)
{
lock (m_dataSet)
@@ -589,6 +628,11 @@ namespace OpenSim.Data.MySQL
}
}
+ ///
+ ///
+ ///
+ ///
+ ///
public List LoadRegionBanList(LLUUID regionUUID)
{
List regionbanlist = new List();
@@ -615,6 +659,10 @@ namespace OpenSim.Data.MySQL
}
}
+ ///
+ ///
+ ///
+ ///
public void AddToRegionBanlist(RegionBanListItem item)
{
lock (m_dataSet)
@@ -635,6 +683,10 @@ namespace OpenSim.Data.MySQL
}
}
+ ///
+ ///
+ ///
+ ///
public void RemoveFromRegionBanlist(RegionBanListItem item)
{
lock (m_dataSet)
@@ -669,6 +721,11 @@ namespace OpenSim.Data.MySQL
}
+ ///
+ ///
+ ///
+ ///
+ ///
public List LoadLandObjects(LLUUID regionUUID)
{
List landDataForRegion = new List();
@@ -694,6 +751,9 @@ namespace OpenSim.Data.MySQL
return landDataForRegion;
}
+ ///
+ ///
+ ///
public void Commit()
{
if (m_connection.State != ConnectionState.Open)
@@ -722,7 +782,9 @@ namespace OpenSim.Data.MySQL
}
}
-
+ ///
+ ///
+ ///
public void Shutdown()
{
Commit();
diff --git a/OpenSim/Data/MySQL/MySQLGridData.cs b/OpenSim/Data/MySQL/MySQLGridData.cs
index e5940e2..394dbbd 100644
--- a/OpenSim/Data/MySQL/MySQLGridData.cs
+++ b/OpenSim/Data/MySQL/MySQLGridData.cs
@@ -49,8 +49,12 @@ namespace OpenSim.Data.MySQL
private MySQLManager database;
///
- /// Initialises the Grid Interface
+ /// Initialises Grid 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.
override public void Initialise(string connect)
{
if (connect != String.Empty)
@@ -166,7 +170,7 @@ namespace OpenSim.Data.MySQL
/// Minimum Y coordinate
/// Maximum X coordinate
/// Maximum Y coordinate
- ///
+ /// Array of sim profiles
override public RegionProfileData[] GetProfilesInRange(uint xmin, uint ymin, uint xmax, uint ymax)
{
try
@@ -332,15 +336,21 @@ namespace OpenSim.Data.MySQL
}
}
+ ///
+ /// Update a sim profile
+ ///
+ /// The profile to update
+ /// Sucessful?
+ /// Same as AddProfile
override public DataResponse UpdateProfile(RegionProfileData profile)
{
return AddProfile(profile);
}
///
- /// Deletes a profile from the database
+ /// Deletes a sim profile from the database
///
- /// The profile to delete
+ /// the sim UUID
/// Successful?
//public DataResponse DeleteProfile(RegionProfileData profile)
public DataResponse DeleteProfile(string uuid)
@@ -397,6 +407,12 @@ namespace OpenSim.Data.MySQL
return false;
}
+ ///
+ /// Adds a location reservation
+ ///
+ ///
+ ///
+ ///
override public ReservationData GetReservationAtPoint(uint x, uint y)
{
try
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs
index de0826f..2d93df3 100644
--- a/OpenSim/Data/MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs
@@ -48,6 +48,13 @@ namespace OpenSim.Data.MySQL
///
private MySQLManager database;
+ ///
+ /// Initialises User 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.
public void Initialise(string connect)
{
if (connect != String.Empty)
@@ -162,6 +169,7 @@ namespace OpenSim.Data.MySQL
///
/// Closes this DB provider
///
+ /// do nothing
public void Close()
{
// Do nothing.
@@ -250,7 +258,12 @@ namespace OpenSim.Data.MySQL
}
}
- // see InventoryItemBase.getUserRootFolder
+
+ ///
+ /// see InventoryItemBase.getUserRootFolder
+ ///
+ ///
+ ///
public InventoryFolderBase getUserRootFolder(LLUUID user)
{
try
@@ -595,6 +608,7 @@ namespace OpenSim.Data.MySQL
addInventoryFolder(folder);
}
+ ///
/// Creates a new inventory folder
///
/// Folder to create
@@ -633,7 +647,12 @@ namespace OpenSim.Data.MySQL
folders.Add(f);
}
- // See IInventoryData
+
+ ///
+ /// See IInventoryData
+ ///
+ ///
+ ///
public List getFolderHierarchy(LLUUID parentID)
{
List folders = new List();
@@ -645,6 +664,10 @@ namespace OpenSim.Data.MySQL
return folders;
}
+ ///
+ /// Delete a folder from database
+ ///
+ /// the folder UUID
protected void deleteOneFolder(LLUUID folderID)
{
try
@@ -665,6 +688,10 @@ namespace OpenSim.Data.MySQL
}
}
+ ///
+ /// Delete all item in a folder
+ ///
+ /// the folder UUID
protected void deleteItemsInFolder(LLUUID folderID)
{
try
diff --git a/OpenSim/Data/MySQL/MySQLLogData.cs b/OpenSim/Data/MySQL/MySQLLogData.cs
index 2ca5bb2..fee7f2f 100644
--- a/OpenSim/Data/MySQL/MySQLLogData.cs
+++ b/OpenSim/Data/MySQL/MySQLLogData.cs
@@ -44,7 +44,9 @@ namespace OpenSim.Data.MySQL
///
/// Artificial constructor called when the plugin is loaded
+ /// Uses the obsolete mysql_connection.ini if connect string is empty.
///
+ /// connect string
public void Initialise(string connect)
{
if (connect != String.Empty)
@@ -79,6 +81,8 @@ namespace OpenSim.Data.MySQL
}
+ ///
+ ///
private void TestTables(Migration m)
{
// under migrations, bail
@@ -132,6 +136,7 @@ namespace OpenSim.Data.MySQL
///
/// Closes the database provider
///
+ /// do nothing
public void Close()
{
// Do nothing.
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs
index 4b11739..7c3ed28 100644
--- a/OpenSim/Data/MySQL/MySQLManager.cs
+++ b/OpenSim/Data/MySQL/MySQLManager.cs
@@ -62,6 +62,7 @@ namespace OpenSim.Data.MySQL
/// The username logging into the database
/// The password for the user logging in
/// Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.
+ /// The MySQL server port
public MySQLManager(string hostname, string database, string username, string password, string cpooling,
string port)
{
@@ -71,11 +72,19 @@ namespace OpenSim.Data.MySQL
Initialise(s);
}
+ ///
+ /// Initialises and creates a new MySQL connection and maintains it.
+ ///
+ /// connectionString
public MySQLManager(String connect)
{
Initialise(connect);
}
+ ///
+ /// Initialises and creates a new MySQL connection and maintains it.
+ ///
+ /// connectionString
public void Initialise(String connect)
{
try
@@ -103,6 +112,7 @@ namespace OpenSim.Data.MySQL
///
/// Get the connection being used
///
+ /// MySqlConnection Object
public MySqlConnection Connection
{
get { return dbcon; }
@@ -184,13 +194,17 @@ namespace OpenSim.Data.MySQL
///
/// Execute a SQL statement stored in a resource, as a string
///
- ///
+ /// name of embedded resource
public void ExecuteResourceSql(string name)
{
MySqlCommand cmd = new MySqlCommand(getResourceString(name), dbcon);
cmd.ExecuteNonQuery();
}
+ ///
+ /// Execute a MySqlCommand
+ ///
+ /// sql string to execute
public void ExecuteSql(string sql)
{
MySqlCommand cmd = new MySqlCommand(sql, dbcon);
@@ -536,6 +550,11 @@ namespace OpenSim.Data.MySQL
return retval;
}
+ ///
+ /// Reads an avatar appearence from an active data reader
+ ///
+ /// An active database reader
+ /// An avatar appearence
public AvatarAppearance readAppearanceRow(IDataReader reader)
{
AvatarAppearance appearance = null;
@@ -647,6 +666,7 @@ namespace OpenSim.Data.MySQL
/// Firstlife text
/// UUID for profile image
/// UUID for firstlife image
+ /// Ignored
/// Success?
public bool insertUserRow(LLUUID uuid, string username, string lastname, string passwordHash,
string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ,
@@ -718,7 +738,7 @@ namespace OpenSim.Data.MySQL
}
///
- /// Creates a new user and inserts it into the database
+ /// Update user data into the database where User ID = uuid
///
/// User ID
/// First part of the login
@@ -742,6 +762,7 @@ namespace OpenSim.Data.MySQL
/// Firstlife text
/// UUID for profile image
/// UUID for firstlife image
+ /// UUID for weblogin Key
/// Success?
public bool updateUserRow(LLUUID uuid, string username, string lastname, string passwordHash,
string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ,
@@ -810,7 +831,7 @@ namespace OpenSim.Data.MySQL
///
/// Inserts a new region into the database
///
- /// The region to insert
+ /// The region to insert
/// Success?
public bool insertRegion(RegionProfileData regiondata)
{
@@ -914,7 +935,7 @@ namespace OpenSim.Data.MySQL
///
/// Delete a region from the database
///
- /// The region to insert
+ /// The region to delete
/// Success?
//public bool deleteRegion(RegionProfileData regiondata)
public bool deleteRegion(string uuid)
@@ -995,6 +1016,11 @@ namespace OpenSim.Data.MySQL
return returnval;
}
+ ///
+ /// Create (or replace if existing) an avatar appearence
+ ///
+ ///
+ /// Succes?
public bool insertAppearanceRow(AvatarAppearance appearance)
{
string sql = String.Empty;
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index 05874f8..11d9c26 100644
--- a/OpenSim/Data/MySQL/MySQLUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserData.cs
@@ -56,8 +56,12 @@ namespace OpenSim.Data.MySQL
private string m_connectString;
///
+ /// 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
///
+ /// connect string.
override public void Initialise(string connect)
{
if (connect == String.Empty) {
@@ -494,7 +498,11 @@ namespace OpenSim.Data.MySQL
return returnlist;
}
- // see IUserData
+ ///
+ /// See IUserData
+ ///
+ /// User UUID
+ /// User profile data
override public UserProfileData GetUserByUUID(LLUUID uuid)
{
try
@@ -526,7 +534,7 @@ namespace OpenSim.Data.MySQL
///
/// Returns a user session searching by name
///
- /// The account name
+ /// The account name : "Username Lastname"
/// The users session
override public UserAgentData GetAgentByName(string name)
{
@@ -545,6 +553,11 @@ namespace OpenSim.Data.MySQL
return GetAgentByUUID(profile.ID);
}
+ ///
+ ///
+ ///
+ ///
+ /// is it still used ?
override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey)
{
Dictionary param = new Dictionary();
@@ -694,9 +707,11 @@ namespace OpenSim.Data.MySQL
return false;
}
+ ///
/// Appearance
/// TODO: stubs for now to get us to a compiling state gently
- // override
+ /// override
+ ///
override public AvatarAppearance GetUserAppearance(LLUUID user)
{
try {
@@ -723,6 +738,12 @@ namespace OpenSim.Data.MySQL
return null;
}
}
+
+ ///
+ /// Updates an avatar appearence
+ ///
+ /// The user UUID
+ /// The avatar appearance
// override
override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance)
{
@@ -741,16 +762,31 @@ namespace OpenSim.Data.MySQL
}
}
+ ///
+ /// Adds an attachment item to a user
+ ///
+ /// the user UUID
+ /// the item UUID
override public void AddAttachment(LLUUID user, LLUUID item)
{
return;
}
+ ///
+ /// Removes an attachment from a user
+ ///
+ /// the user UUID
+ /// the item UUID
override public void RemoveAttachment(LLUUID user, LLUUID item)
{
return;
}
+ ///
+ /// Get the list of item attached to a user
+ ///
+ /// the user UUID
+ /// UUID list of attached item
override public List GetAttachments(LLUUID user)
{
return new List();
--
cgit v1.1