aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Interfaces/IInventoryService.cs
diff options
context:
space:
mode:
authordiva2009-06-07 19:00:55 +0000
committerdiva2009-06-07 19:00:55 +0000
commit1ad237a8a757a0e6074278aff76805d01abf0c0b (patch)
treee6a697dd113aeb90c7dd92ee4d07f278d7ebf8de /OpenSim/Services/Interfaces/IInventoryService.cs
parentSkip lone ident statments or for-loop assignments (diff)
downloadopensim-SC-1ad237a8a757a0e6074278aff76805d01abf0c0b.zip
opensim-SC-1ad237a8a757a0e6074278aff76805d01abf0c0b.tar.gz
opensim-SC-1ad237a8a757a0e6074278aff76805d01abf0c0b.tar.bz2
opensim-SC-1ad237a8a757a0e6074278aff76805d01abf0c0b.tar.xz
First draft of inventory service connectors, and service implementation. No handlers yet, this is just the OUT part for now. It's not active and nothing in the simulator uses this yet. Just checking it in to start sharing with others. There are a couple of interesting software design points that could use other devs opinions.
Hopefully I added all needed files.
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/Interfaces/IInventoryService.cs118
1 files changed, 118 insertions, 0 deletions
diff --git a/OpenSim/Services/Interfaces/IInventoryService.cs b/OpenSim/Services/Interfaces/IInventoryService.cs
new file mode 100644
index 0000000..9fe419f
--- /dev/null
+++ b/OpenSim/Services/Interfaces/IInventoryService.cs
@@ -0,0 +1,118 @@
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
28using System;
29using System.Collections.Generic;
30using OpenSim.Framework;
31using OpenMetaverse;
32
33namespace OpenSim.Services.Interfaces
34{
35 /// <summary>
36 /// Callback used when a user's inventory is received from the inventory service
37 /// </summary>
38 public delegate void InventoryReceiptCallback(
39 ICollection<InventoryFolderImpl> folders, ICollection<InventoryItemBase> items);
40
41 public interface IInventoryService
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(UUID userID, InventoryReceiptCallback callback);
50
51 /// <summary>
52 /// Add a new folder to the user's inventory
53 /// </summary>
54 /// <param name="folder"></param>
55 /// <returns>true if the folder was successfully added</returns>
56 bool AddFolder(InventoryFolderBase folder);
57
58 /// <summary>
59 /// Update a folder in the user's inventory
60 /// </summary>
61 /// <param name="folder"></param>
62 /// <returns>true if the folder was successfully updated</returns>
63 bool UpdateFolder(InventoryFolderBase folder);
64
65 /// <summary>
66 /// Move an inventory folder to a new location
67 /// </summary>
68 /// <param name="folder">A folder containing the details of the new location</param>
69 /// <returns>true if the folder was successfully moved</returns>
70 bool MoveFolder(InventoryFolderBase folder);
71
72 /// <summary>
73 /// Purge an inventory folder of all its items and subfolders.
74 /// </summary>
75 /// <param name="folder"></param>
76 /// <returns>true if the folder was successfully purged</returns>
77 bool PurgeFolder(InventoryFolderBase folder);
78
79 /// <summary>
80 /// Add a new item to the user's inventory
81 /// </summary>
82 /// <param name="item"></param>
83 /// <returns>true if the item was successfully added</returns>
84 bool AddItem(InventoryItemBase item);
85
86 /// <summary>
87 /// Update an item in the user's inventory
88 /// </summary>
89 /// <param name="item"></param>
90 /// <returns>true if the item was successfully updated</returns>
91 bool UpdateItem(InventoryItemBase item);
92
93 /// <summary>
94 /// Delete an item from the user's inventory
95 /// </summary>
96 /// <param name="item"></param>
97 /// <returns>true if the item was successfully deleted</returns>
98 bool DeleteItem(InventoryItemBase item);
99
100 InventoryItemBase QueryItem(InventoryItemBase item);
101
102 InventoryFolderBase QueryFolder(InventoryFolderBase folder);
103
104 /// <summary>
105 /// Does the given user have an inventory structure?
106 /// </summary>
107 /// <param name="userID"></param>
108 /// <returns></returns>
109 bool HasInventoryForUser(UUID userID);
110
111 /// <summary>
112 /// Retrieve the root inventory folder for the given user.
113 /// </summary>
114 /// <param name="userID"></param>
115 /// <returns>null if no root folder was found</returns>
116 InventoryFolderBase RequestRootFolder(UUID userID);
117 }
118}