MockInventoryService.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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;
  28. using System.Collections.Generic;
  29. using System.Text;
  30. using OpenSim.Framework;
  31. using OpenMetaverse;
  32. using OpenSim.Services.Interfaces;
  33. using Nini.Config;
  34. namespace OpenSim.Tests.Common.Mock
  35. {
  36. public class MockInventoryService : IInventoryService
  37. {
  38. public MockInventoryService() {}
  39. public MockInventoryService(IConfigSource config) {}
  40. /// <summary>
  41. /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
  42. /// </summary>
  43. /// <param name="userId"></param>
  44. /// <returns></returns>
  45. public bool CreateUserInventory(UUID userId)
  46. {
  47. return false;
  48. }
  49. /// <summary>
  50. /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
  51. /// </summary>
  52. /// <param name="userId"></param>
  53. /// <returns></returns>
  54. public List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
  55. {
  56. List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
  57. InventoryFolderBase folder = new InventoryFolderBase();
  58. folder.ID = UUID.Random();
  59. folder.Owner = userId;
  60. folders.Add(folder);
  61. return folders;
  62. }
  63. public InventoryFolderBase GetRootFolder(UUID userID)
  64. {
  65. return new InventoryFolderBase();
  66. }
  67. public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
  68. {
  69. return null;
  70. }
  71. public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
  72. {
  73. return null;
  74. }
  75. /// <summary>
  76. /// Returns a list of all the active gestures in a user's inventory.
  77. /// </summary>
  78. /// <param name="userId">
  79. /// The <see cref="UUID"/> of the user
  80. /// </param>
  81. /// <returns>
  82. /// A flat list of the gesture items.
  83. /// </returns>
  84. public List<InventoryItemBase> GetActiveGestures(UUID userId)
  85. {
  86. return null;
  87. }
  88. public InventoryCollection GetUserInventory(UUID userID)
  89. {
  90. return null;
  91. }
  92. public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback)
  93. {
  94. }
  95. public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
  96. {
  97. return null;
  98. }
  99. public bool AddFolder(InventoryFolderBase folder)
  100. {
  101. return false;
  102. }
  103. public bool UpdateFolder(InventoryFolderBase folder)
  104. {
  105. return false;
  106. }
  107. public bool MoveFolder(InventoryFolderBase folder)
  108. {
  109. return false;
  110. }
  111. public bool DeleteFolders(UUID ownerID, List<UUID> ids)
  112. {
  113. return false;
  114. }
  115. public bool PurgeFolder(InventoryFolderBase folder)
  116. {
  117. return false;
  118. }
  119. public bool AddItem(InventoryItemBase item)
  120. {
  121. return true;
  122. }
  123. public bool UpdateItem(InventoryItemBase item)
  124. {
  125. return false;
  126. }
  127. public bool MoveItems(UUID ownerID, List<InventoryItemBase> items)
  128. {
  129. return false;
  130. }
  131. public bool DeleteItems(UUID ownerID, List<UUID> itemIDs)
  132. {
  133. return false;
  134. }
  135. public InventoryItemBase GetItem(InventoryItemBase item)
  136. {
  137. return null;
  138. }
  139. public InventoryFolderBase GetFolder(InventoryFolderBase folder)
  140. {
  141. return null;
  142. }
  143. public bool HasInventoryForUser(UUID userID)
  144. {
  145. return false;
  146. }
  147. public InventoryFolderBase RequestRootFolder(UUID userID)
  148. {
  149. InventoryFolderBase root = new InventoryFolderBase();
  150. root.ID = UUID.Random();
  151. root.Owner = userID;
  152. root.ParentID = UUID.Zero;
  153. return root;
  154. }
  155. public int GetAssetPermissions(UUID userID, UUID assetID)
  156. {
  157. return 1;
  158. }
  159. }
  160. }