From 55f7fe0ae3d979cb0988f385bfee27b8c7f75820 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 2 Jun 2007 00:37:31 +0000 Subject: Dont want to do that again --- MySQL interface is now fully documented. Added little bit more documentation to the MSSQL interface. --- .../MySQLInventoryData.cs | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) (limited to 'OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs') diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs index 50ffbb0..9177cc3 100644 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs @@ -1,3 +1,29 @@ +/* +* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ using System; using System.Collections.Generic; using System.Text; @@ -5,10 +31,19 @@ using libsecondlife; namespace OpenGrid.Framework.Data.MySQL { + /// + /// A MySQL interface for the inventory server + /// class MySQLInventoryData : IInventoryData { + /// + /// The database manager + /// public MySQLManager database; + /// + /// Loads and initialises this database plugin + /// public void Initialise() { IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); @@ -22,21 +57,37 @@ namespace OpenGrid.Framework.Data.MySQL database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); } + /// + /// The name of this DB provider + /// + /// Name of DB provider public string getName() { return "MySQL Inventory Data Interface"; } + /// + /// Closes this DB provider + /// public void Close() { // Do nothing. } + /// + /// Returns the version of this DB provider + /// + /// A string containing the DB provider public string getVersion() { return "0.1"; } + /// + /// Returns a list of items in a specified folder + /// + /// The folder to search + /// A list containing inventory items public List getInventoryInFolder(LLUUID folderID) { try @@ -65,6 +116,11 @@ namespace OpenGrid.Framework.Data.MySQL } } + /// + /// Returns a list of the root folders within a users inventory + /// + /// The user whos inventory is to be searched + /// A list of folder objects public List getUserRootFolders(LLUUID user) { try @@ -94,6 +150,11 @@ namespace OpenGrid.Framework.Data.MySQL } } + /// + /// Returns a list of folders in a users inventory contained within the specified folder + /// + /// The folder to search + /// A list of inventory folders public List getInventoryFolders(LLUUID parentID) { try @@ -122,6 +183,11 @@ namespace OpenGrid.Framework.Data.MySQL } } + /// + /// Returns a specified inventory item + /// + /// The item to return + /// An inventory item public InventoryItemBase getInventoryItem(LLUUID item) { try @@ -157,6 +223,11 @@ namespace OpenGrid.Framework.Data.MySQL } } + /// + /// Returns a specified inventory folder + /// + /// The folder to return + /// A folder class public InventoryFolderBase getInventoryFolder(LLUUID folder) { try @@ -192,6 +263,10 @@ namespace OpenGrid.Framework.Data.MySQL } } + /// + /// Adds a specified item to the database + /// + /// The inventory item public void addInventoryItem(InventoryItemBase item) { lock (database) @@ -200,11 +275,19 @@ namespace OpenGrid.Framework.Data.MySQL } } + /// + /// Updates the specified inventory item + /// + /// Inventory item to update public void updateInventoryItem(InventoryItemBase item) { addInventoryItem(item); } + /// + /// Creates a new inventory folder + /// + /// Folder to create public void addInventoryFolder(InventoryFolderBase folder) { lock (database) @@ -213,6 +296,10 @@ namespace OpenGrid.Framework.Data.MySQL } } + /// + /// Updates an inventory folder + /// + /// Folder to update public void updateInventoryFolder(InventoryFolderBase folder) { addInventoryFolder(folder); -- cgit v1.1