diff options
author | diva | 2009-06-10 13:18:32 +0000 |
---|---|---|
committer | diva | 2009-06-10 13:18:32 +0000 |
commit | 0f367bd7bbc5d22d4834e1eb0f1671381485143e (patch) | |
tree | eeb4290f1146601f8fd97dc164e0a7f247a2fafb /OpenSim/Services/Connectors | |
parent | From: Alan Webb <alan_webb@us.ibm.com> (diff) | |
download | opensim-SC_OLD-0f367bd7bbc5d22d4834e1eb0f1671381485143e.zip opensim-SC_OLD-0f367bd7bbc5d22d4834e1eb0f1671381485143e.tar.gz opensim-SC_OLD-0f367bd7bbc5d22d4834e1eb0f1671381485143e.tar.bz2 opensim-SC_OLD-0f367bd7bbc5d22d4834e1eb0f1671381485143e.tar.xz |
Heart surgery no.2: the inventory service hooks.
Several improvements in the connectors themselves.
Several improvements in configurations.
Needed to add a hack in IUserService and UserManagerBase, to be removed when that service is refactored.
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r-- | OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs | 4 | ||||
-rw-r--r-- | OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs | 170 |
2 files changed, 172 insertions, 2 deletions
diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs index 34478ae..093ce92 100644 --- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs | |||
@@ -67,7 +67,7 @@ namespace OpenSim.Services.Connectors | |||
67 | IConfig inventoryConfig = source.Configs["InventoryService"]; | 67 | IConfig inventoryConfig = source.Configs["InventoryService"]; |
68 | if (inventoryConfig == null) | 68 | if (inventoryConfig == null) |
69 | { | 69 | { |
70 | m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpanSim.ini"); | 70 | m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); |
71 | throw new Exception("Inventory connector init error"); | 71 | throw new Exception("Inventory connector init error"); |
72 | } | 72 | } |
73 | 73 | ||
@@ -77,7 +77,7 @@ namespace OpenSim.Services.Connectors | |||
77 | if (serviceURI == String.Empty) | 77 | if (serviceURI == String.Empty) |
78 | { | 78 | { |
79 | m_log.Error("[INVENTORY CONNECTOR]: No Server URI named in section InventoryService"); | 79 | m_log.Error("[INVENTORY CONNECTOR]: No Server URI named in section InventoryService"); |
80 | throw new Exception("Inventory connector init error"); | 80 | throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); |
81 | } | 81 | } |
82 | m_ServerURI = serviceURI.TrimEnd('/'); | 82 | m_ServerURI = serviceURI.TrimEnd('/'); |
83 | } | 83 | } |
diff --git a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs new file mode 100644 index 0000000..3264f41 --- /dev/null +++ b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs | |||
@@ -0,0 +1,170 @@ | |||
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 | |||
28 | using log4net; | ||
29 | using System; | ||
30 | using System.Collections.Generic; | ||
31 | using System.IO; | ||
32 | using System.Reflection; | ||
33 | using Nini.Config; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Framework.Servers.HttpServer; | ||
36 | using OpenSim.Services.Interfaces; | ||
37 | using OpenMetaverse; | ||
38 | |||
39 | namespace OpenSim.Services.Connectors | ||
40 | { | ||
41 | /// <summary> | ||
42 | /// This connector is temporary. It's used by the user server, before that server is refactored. | ||
43 | /// </summary> | ||
44 | public class QuickAndDirtyInventoryServiceConnector : IInventoryService | ||
45 | { | ||
46 | private static readonly ILog m_log = | ||
47 | LogManager.GetLogger( | ||
48 | MethodBase.GetCurrentMethod().DeclaringType); | ||
49 | |||
50 | private string m_ServerURI = String.Empty; | ||
51 | |||
52 | private Dictionary<UUID, InventoryReceiptCallback> m_RequestingInventory = new Dictionary<UUID, InventoryReceiptCallback>(); | ||
53 | |||
54 | public QuickAndDirtyInventoryServiceConnector() | ||
55 | { | ||
56 | } | ||
57 | |||
58 | public QuickAndDirtyInventoryServiceConnector(string serverURI) | ||
59 | { | ||
60 | m_ServerURI = serverURI.TrimEnd('/'); | ||
61 | } | ||
62 | |||
63 | /// <summary> | ||
64 | /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/> | ||
65 | /// </summary> | ||
66 | /// <param name="userId"></param> | ||
67 | /// <returns></returns> | ||
68 | public bool CreateUserInventory(UUID userId) | ||
69 | { | ||
70 | return SynchronousRestObjectPoster.BeginPostObject<Guid, bool>( | ||
71 | "POST", m_ServerURI + "CreateInventory/", userId.Guid); | ||
72 | } | ||
73 | |||
74 | /// <summary> | ||
75 | /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/> | ||
76 | /// </summary> | ||
77 | /// <param name="userId"></param> | ||
78 | /// <returns></returns> | ||
79 | public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) | ||
80 | { | ||
81 | return SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( | ||
82 | "POST", m_ServerURI + "RootFolders/", userId.Guid); | ||
83 | } | ||
84 | |||
85 | /// <summary> | ||
86 | /// Returns a list of all the active gestures in a user's inventory. | ||
87 | /// </summary> | ||
88 | /// <param name="userId"> | ||
89 | /// The <see cref="UUID"/> of the user | ||
90 | /// </param> | ||
91 | /// <returns> | ||
92 | /// A flat list of the gesture items. | ||
93 | /// </returns> | ||
94 | public List<InventoryItemBase> GetActiveGestures(UUID userId) | ||
95 | { | ||
96 | return SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryItemBase>>( | ||
97 | "POST", m_ServerURI + "ActiveGestures/", userId.Guid); | ||
98 | } | ||
99 | |||
100 | public InventoryCollection GetUserInventory(UUID userID) | ||
101 | { | ||
102 | return null; | ||
103 | } | ||
104 | |||
105 | public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) | ||
106 | { | ||
107 | } | ||
108 | |||
109 | public List<InventoryItemBase> GetFolderItems(UUID folderID) | ||
110 | { | ||
111 | return null; | ||
112 | } | ||
113 | |||
114 | public bool AddFolder(InventoryFolderBase folder) | ||
115 | { | ||
116 | return false; | ||
117 | } | ||
118 | |||
119 | public bool UpdateFolder(InventoryFolderBase folder) | ||
120 | { | ||
121 | return false; | ||
122 | } | ||
123 | |||
124 | public bool MoveFolder(InventoryFolderBase folder) | ||
125 | { | ||
126 | return false; | ||
127 | } | ||
128 | |||
129 | public bool PurgeFolder(InventoryFolderBase folder) | ||
130 | { | ||
131 | return false; | ||
132 | } | ||
133 | |||
134 | public bool AddItem(InventoryItemBase item) | ||
135 | { | ||
136 | return false; | ||
137 | } | ||
138 | |||
139 | public bool UpdateItem(InventoryItemBase item) | ||
140 | { | ||
141 | return false; | ||
142 | } | ||
143 | |||
144 | public bool DeleteItem(InventoryItemBase item) | ||
145 | { | ||
146 | return false; | ||
147 | } | ||
148 | |||
149 | public InventoryItemBase QueryItem(InventoryItemBase item) | ||
150 | { | ||
151 | return null; | ||
152 | } | ||
153 | |||
154 | public InventoryFolderBase QueryFolder(InventoryFolderBase folder) | ||
155 | { | ||
156 | return null; | ||
157 | } | ||
158 | |||
159 | public bool HasInventoryForUser(UUID userID) | ||
160 | { | ||
161 | return false; | ||
162 | } | ||
163 | |||
164 | public InventoryFolderBase RequestRootFolder(UUID userID) | ||
165 | { | ||
166 | return null; | ||
167 | } | ||
168 | |||
169 | } | ||
170 | } | ||