ISessionAuthInventoryService.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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 OpenSimulator 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 OpenSim.Framework;
  29. using OpenSim.Services.Interfaces;
  30. using OpenMetaverse;
  31. namespace OpenSim.Services.Connectors
  32. {
  33. /// <summary>
  34. /// Defines all operations to access a remote inventory service
  35. /// using session authentication as a form of security.
  36. /// </summary>
  37. public interface ISessionAuthInventoryService
  38. {
  39. string Host
  40. {
  41. get;
  42. }
  43. /// <summary>
  44. /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
  45. /// inventory has been received
  46. /// </summary>
  47. /// <param name="userID"></param>
  48. /// <param name="callback"></param>
  49. void GetUserInventory(string userID, UUID session_id, InventoryReceiptCallback callback);
  50. /// <summary>
  51. /// Gets the user folder for the given folder-type
  52. /// </summary>
  53. /// <param name="userID"></param>
  54. /// <param name="type"></param>
  55. /// <returns></returns>
  56. Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(string userID, UUID session_id);
  57. /// <summary>
  58. /// Gets everything (folders and items) inside a folder
  59. /// </summary>
  60. /// <param name="userId"></param>
  61. /// <param name="folderID"></param>
  62. /// <returns></returns>
  63. InventoryCollection GetFolderContent(string userID, UUID folderID, UUID session_id);
  64. /// <summary>
  65. /// Add a new folder to the user's inventory
  66. /// </summary>
  67. /// <param name="folder"></param>
  68. /// <returns>true if the folder was successfully added</returns>
  69. bool AddFolder(string userID, InventoryFolderBase folder, UUID session_id);
  70. /// <summary>
  71. /// Update a folder in the user's inventory
  72. /// </summary>
  73. /// <param name="folder"></param>
  74. /// <returns>true if the folder was successfully updated</returns>
  75. bool UpdateFolder(string userID, InventoryFolderBase folder, UUID session_id);
  76. /// <summary>
  77. /// Move an inventory folder to a new location
  78. /// </summary>
  79. /// <param name="folder">A folder containing the details of the new location</param>
  80. /// <returns>true if the folder was successfully moved</returns>
  81. bool MoveFolder(string userID, InventoryFolderBase folder, UUID session_id);
  82. /// <summary>
  83. /// Delete a list of inventory folders (from trash)
  84. /// </summary>
  85. bool DeleteFolders(string userID, List<UUID> folders, UUID session_id);
  86. /// <summary>
  87. /// Purge an inventory folder of all its items and subfolders.
  88. /// </summary>
  89. /// <param name="folder"></param>
  90. /// <returns>true if the folder was successfully purged</returns>
  91. bool PurgeFolder(string userID, InventoryFolderBase folder, UUID session_id);
  92. /// <summary>
  93. /// Get items from a folder.
  94. /// </summary>
  95. /// <param name="folder"></param>
  96. /// <returns>true if the folder was successfully purged</returns>
  97. List<InventoryItemBase> GetFolderItems(string userID, UUID folderID, UUID session_id);
  98. /// <summary>
  99. /// Add a new item to the user's inventory
  100. /// </summary>
  101. /// <param name="item"></param>
  102. /// <returns>true if the item was successfully added</returns>
  103. bool AddItem(string userID, InventoryItemBase item, UUID session_id);
  104. /// <summary>
  105. /// Update an item in the user's inventory
  106. /// </summary>
  107. /// <param name="item"></param>
  108. /// <returns>true if the item was successfully updated</returns>
  109. bool UpdateItem(string userID, InventoryItemBase item, UUID session_id);
  110. bool MoveItems(string userID, List<InventoryItemBase> items, UUID session_id);
  111. /// <summary>
  112. /// Delete an item from the user's inventory
  113. /// </summary>
  114. /// <param name="item"></param>
  115. /// <returns>true if the item was successfully deleted</returns>
  116. bool DeleteItems(string userID, List<UUID> itemIDs, UUID session_id);
  117. InventoryItemBase QueryItem(string userID, InventoryItemBase item, UUID session_id);
  118. InventoryFolderBase QueryFolder(string userID, InventoryFolderBase item, UUID session_id);
  119. int GetAssetPermissions(string userID, UUID assetID, UUID session_id);
  120. }
  121. }