IInventoryData.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSim Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System.Collections.Generic;
  28. using libsecondlife;
  29. namespace OpenSim.Framework
  30. {
  31. /// <summary>
  32. /// An interface for accessing inventory data from a storage server
  33. /// </summary>
  34. public interface IInventoryData
  35. {
  36. /// <summary>
  37. /// Initialises the interface
  38. /// </summary>
  39. void Initialise(string connect);
  40. /// <summary>
  41. /// Closes the interface
  42. /// </summary>
  43. void Close();
  44. /// <summary>
  45. /// The plugin being loaded
  46. /// </summary>
  47. /// <returns>A string containing the plugin name</returns>
  48. string getName();
  49. /// <summary>
  50. /// The plugins version
  51. /// </summary>
  52. /// <returns>A string containing the plugin version</returns>
  53. string getVersion();
  54. /// <summary>
  55. /// Returns all child folders in the hierarchy from the parent folder and down.
  56. /// Does not return the parent folder itself.
  57. /// </summary>
  58. /// <param name="parentID">The folder to get subfolders for</param>
  59. /// <returns>A list of inventory folders</returns>
  60. List<InventoryFolderBase> getFolderHierarchy(LLUUID parentID);
  61. /// <summary>
  62. /// Returns a list of inventory items contained within the specified folder
  63. /// </summary>
  64. /// <param name="folderID">The UUID of the target folder</param>
  65. /// <returns>A List of InventoryItemBase items</returns>
  66. List<InventoryItemBase> getInventoryInFolder(LLUUID folderID);
  67. /// <summary>
  68. /// Returns a list of the root folders within a users inventory
  69. /// </summary>
  70. /// <param name="user">The user whos inventory is to be searched</param>
  71. /// <returns>A list of folder objects</returns>
  72. List<InventoryFolderBase> getUserRootFolders(LLUUID user);
  73. /// <summary>
  74. /// Returns the users inventory root folder.
  75. /// </summary>
  76. /// <param name="user">The UUID of the user who is having inventory being returned</param>
  77. /// <returns>Root inventory folder, null if no root inventory folder was found</returns>
  78. InventoryFolderBase getUserRootFolder(LLUUID user);
  79. /// <summary>
  80. /// Returns a list of inventory folders contained in the folder 'parentID'
  81. /// </summary>
  82. /// <param name="parentID">The folder to get subfolders for</param>
  83. /// <returns>A list of inventory folders</returns>
  84. List<InventoryFolderBase> getInventoryFolders(LLUUID parentID);
  85. /// <summary>
  86. /// Returns an inventory item by its UUID
  87. /// </summary>
  88. /// <param name="item">The UUID of the item to be returned</param>
  89. /// <returns>A class containing item information</returns>
  90. InventoryItemBase getInventoryItem(LLUUID item);
  91. /// <summary>
  92. /// Returns a specified inventory folder by its UUID
  93. /// </summary>
  94. /// <param name="folder">The UUID of the folder to be returned</param>
  95. /// <returns>A class containing folder information</returns>
  96. InventoryFolderBase getInventoryFolder(LLUUID folder);
  97. /// <summary>
  98. /// Creates a new inventory item based on item
  99. /// </summary>
  100. /// <param name="item">The item to be created</param>
  101. void addInventoryItem(InventoryItemBase item);
  102. /// <summary>
  103. /// Updates an inventory item with item (updates based on ID)
  104. /// </summary>
  105. /// <param name="item">The updated item</param>
  106. void updateInventoryItem(InventoryItemBase item);
  107. /// <summary>
  108. ///
  109. /// </summary>
  110. /// <param name="item"></param>
  111. void deleteInventoryItem(LLUUID item);
  112. /// <summary>
  113. /// Adds a new folder specified by folder
  114. /// </summary>
  115. /// <param name="folder">The inventory folder</param>
  116. void addInventoryFolder(InventoryFolderBase folder);
  117. /// <summary>
  118. /// Updates a folder based on its ID with folder
  119. /// </summary>
  120. /// <param name="folder">The inventory folder</param>
  121. void updateInventoryFolder(InventoryFolderBase folder);
  122. /// <summary>
  123. /// Updates a folder based on its ID with folder
  124. /// </summary>
  125. /// <param name="folder">The inventory folder</param>
  126. void moveInventoryFolder(InventoryFolderBase folder);
  127. /// <summary>
  128. /// Deletes a folder. Thie will delete both the folder itself and its contents (items and descendent folders)
  129. /// </summary>
  130. /// <param name="folder">The id of the folder</param>
  131. void deleteInventoryFolder(LLUUID folder);
  132. }
  133. }