aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/Communications/Tests/LoginServiceTests.cs10
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs26
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs11
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs38
-rw-r--r--OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs42
-rw-r--r--OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs17
-rw-r--r--OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs44
-rw-r--r--OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs10
-rw-r--r--OpenSim/Services/Interfaces/IInventoryService.cs30
-rw-r--r--OpenSim/Services/InventoryService/InventoryService.cs40
10 files changed, 261 insertions, 7 deletions
diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
index 373d7cf..17a3393 100644
--- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
@@ -497,6 +497,16 @@ namespace OpenSim.Framework.Communications.Tests
497 { 497 {
498 } 498 }
499 499
500 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
501 {
502 return null;
503 }
504
505 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
506 {
507 return null;
508 }
509
500 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) 510 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
501 { 511 {
502 return null; 512 return null;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index b3c5396..f5e6824 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -201,6 +201,32 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
201 } 201 }
202 } 202 }
203 203
204 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
205 {
206 if (IsLocalGridUser(userID))
207 return m_GridService.GetFolderForType(userID, type);
208 else
209 {
210 UUID sessionID = GetSessionID(userID);
211 string uri = GetUserInventoryURI(userID) + "/" + userID.ToString();
212 // !!!!!!
213 return null;
214 //return m_HGService.GetFolderForType(uri, sessionID, type);
215 }
216 }
217
218 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
219 {
220 if (IsLocalGridUser(userID))
221 return m_GridService.GetFolderContent(userID, folderID);
222 else
223 {
224 UUID sessionID = GetSessionID(userID);
225 string uri = GetUserInventoryURI(userID) + "/" + userID.ToString();
226 return m_HGService.GetFolderContent(uri, folderID, sessionID);
227 }
228 }
229
204 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) 230 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
205 { 231 {
206 return new List<InventoryItemBase>(); 232 return new List<InventoryItemBase>();
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
index cb20f35..bab0044 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
@@ -176,6 +176,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
176 m_InventoryService.GetUserInventory(userID, callback); 176 m_InventoryService.GetUserInventory(userID, callback);
177 } 177 }
178 178
179 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
180 {
181 return m_InventoryService.GetFolderForType(userID, type);
182 }
183
184 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
185 {
186 return m_InventoryService.GetFolderContent(userID, folderID);
187 }
188
189
179 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) 190 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
180 { 191 {
181 return m_InventoryService.GetFolderItems(userID, folderID); 192 return m_InventoryService.GetFolderItems(userID, folderID);
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
index b544138..2064558 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
@@ -168,6 +168,44 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
168 168
169 } 169 }
170 170
171 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
172 {
173 //UUID sessionID = GetSessionID(userID);
174 //List<InventoryFolderBase> sysFolders;
175 //try
176 //{
177 // sysFolders = m_RemoteConnector.GetSystemFolders(userID.ToString(), sessionID);
178 //}
179 //catch (Exception e)
180 //{
181 // m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderForType operation failed, {0} {1}",
182 // e.Source, e.Message);
183 //}
184
185 // PLACEHOLDER UNTIL CACHE IS DONE
186 return null;
187
188 }
189
190 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
191 {
192 UUID sessionID = GetSessionID(userID);
193 try
194 {
195 return m_RemoteConnector.GetFolderContent(userID.ToString(), folderID, sessionID);
196 }
197 catch (Exception e)
198 {
199 m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderContent operation failed, {0} {1}",
200 e.Source, e.Message);
201 }
202 InventoryCollection nullCollection = new InventoryCollection();
203 nullCollection.Folders = new List<InventoryFolderBase>();
204 nullCollection.Items = new List<InventoryItemBase>();
205 nullCollection.UserID = userID;
206 return nullCollection;
207 }
208
171 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) 209 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
172 { 210 {
173 return new List<InventoryItemBase>(); 211 return new List<InventoryItemBase>();
diff --git a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
index 01e517c..b168871 100644
--- a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
@@ -120,6 +120,48 @@ namespace OpenSim.Services.Connectors.Inventory
120 120
121 } 121 }
122 122
123 /// <summary>
124 /// Gets the user folder for the given folder-type
125 /// </summary>
126 /// <param name="userID"></param>
127 /// <param name="type"></param>
128 /// <returns></returns>
129 public List<InventoryFolderBase> GetSystemFolders(string id, UUID sessionID)
130 {
131 m_log.Debug("[HGInventory]: GetSystemFolders " + id);
132 string url = string.Empty;
133 string userID = string.Empty;
134
135 if (StringToUrlAndUserID(id, out url, out userID))
136 {
137 ISessionAuthInventoryService connector = GetConnector(url);
138 return connector.GetSystemFolders(userID, sessionID);
139 }
140
141 return new List<InventoryFolderBase>();
142 }
143
144 /// <summary>
145 /// Gets everything (folders and items) inside a folder
146 /// </summary>
147 /// <param name="userId"></param>
148 /// <param name="folderID"></param>
149 /// <returns></returns>
150 public InventoryCollection GetFolderContent(string id, UUID folderID, UUID sessionID)
151 {
152 m_log.Debug("[HGInventory]: GetSystemFolders " + id);
153 string url = string.Empty;
154 string userID = string.Empty;
155
156 if (StringToUrlAndUserID(id, out url, out userID))
157 {
158 ISessionAuthInventoryService connector = GetConnector(url);
159 return connector.GetFolderContent(userID, folderID, sessionID);
160 }
161
162 return null;
163 }
164
123 public bool AddFolder(string id, InventoryFolderBase folder, UUID sessionID) 165 public bool AddFolder(string id, InventoryFolderBase folder, UUID sessionID)
124 { 166 {
125 string url = string.Empty; 167 string url = string.Empty;
diff --git a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs
index 4fc4363..98fd680 100644
--- a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs
+++ b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs
@@ -25,6 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System.Collections.Generic;
28using OpenSim.Framework; 29using OpenSim.Framework;
29using OpenSim.Services.Interfaces; 30using OpenSim.Services.Interfaces;
30using OpenMetaverse; 31using OpenMetaverse;
@@ -51,6 +52,22 @@ namespace OpenSim.Services.Connectors
51 void GetUserInventory(string userID, UUID session_id, InventoryReceiptCallback callback); 52 void GetUserInventory(string userID, UUID session_id, InventoryReceiptCallback callback);
52 53
53 /// <summary> 54 /// <summary>
55 /// Gets the user folder for the given folder-type
56 /// </summary>
57 /// <param name="userID"></param>
58 /// <param name="type"></param>
59 /// <returns></returns>
60 List<InventoryFolderBase> GetSystemFolders(string userID, UUID session_id);
61
62 /// <summary>
63 /// Gets everything (folders and items) inside a folder
64 /// </summary>
65 /// <param name="userId"></param>
66 /// <param name="folderID"></param>
67 /// <returns></returns>
68 InventoryCollection GetFolderContent(string userID, UUID folderID, UUID session_id);
69
70 /// <summary>
54 /// Add a new folder to the user's inventory 71 /// Add a new folder to the user's inventory
55 /// </summary> 72 /// </summary>
56 /// <param name="folder"></param> 73 /// <param name="folder"></param>
diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
index ae15cfb..1a6826e 100644
--- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
@@ -155,6 +155,50 @@ namespace OpenSim.Services.Connectors
155 } 155 }
156 } 156 }
157 157
158 /// <summary>
159 /// Gets the user folder for the given folder-type
160 /// </summary>
161 /// <param name="userID"></param>
162 /// <param name="type"></param>
163 /// <returns></returns>
164 public List<InventoryFolderBase> GetSystemFolders(string userID, UUID sessionID)
165 {
166 try
167 {
168 return SynchronousRestSessionObjectPoster<string, List<InventoryFolderBase>>.BeginPostObject(
169 "GET", m_ServerURI + "/SystemFolders/", userID, sessionID.ToString(), userID.ToString());
170 }
171 catch (Exception e)
172 {
173 m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderForType operation failed, {0} {1}",
174 e.Source, e.Message);
175 }
176
177 return new List<InventoryFolderBase>();
178 }
179
180 /// <summary>
181 /// Gets everything (folders and items) inside a folder
182 /// </summary>
183 /// <param name="userId"></param>
184 /// <param name="folderID"></param>
185 /// <returns></returns>
186 public InventoryCollection GetFolderContent(string userID, UUID folderID, UUID sessionID)
187 {
188 try
189 {
190 return SynchronousRestSessionObjectPoster<UUID, InventoryCollection>.BeginPostObject(
191 "GET", m_ServerURI + "/GetFolderContents/", folderID, sessionID.ToString(), userID.ToString());
192 }
193 catch (Exception e)
194 {
195 m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderForType operation failed, {0} {1}",
196 e.Source, e.Message);
197 }
198
199 return null;
200 }
201
158 public bool AddFolder(string userID, InventoryFolderBase folder, UUID sessionID) 202 public bool AddFolder(string userID, InventoryFolderBase folder, UUID sessionID)
159 { 203 {
160 try 204 try
diff --git a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs
index a804973..22289aa 100644
--- a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs
@@ -106,6 +106,16 @@ namespace OpenSim.Services.Connectors
106 { 106 {
107 } 107 }
108 108
109 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
110 {
111 return null;
112 }
113
114 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
115 {
116 return null;
117 }
118
109 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) 119 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
110 { 120 {
111 return null; 121 return null;
diff --git a/OpenSim/Services/Interfaces/IInventoryService.cs b/OpenSim/Services/Interfaces/IInventoryService.cs
index 733cfd0..8058aa7 100644
--- a/OpenSim/Services/Interfaces/IInventoryService.cs
+++ b/OpenSim/Services/Interfaces/IInventoryService.cs
@@ -70,6 +70,29 @@ namespace OpenSim.Services.Interfaces
70 void GetUserInventory(UUID userID, InventoryReceiptCallback callback); 70 void GetUserInventory(UUID userID, InventoryReceiptCallback callback);
71 71
72 /// <summary> 72 /// <summary>
73 /// Retrieve the root inventory folder for the given user.
74 /// </summary>
75 /// <param name="userID"></param>
76 /// <returns>null if no root folder was found</returns>
77 InventoryFolderBase GetRootFolder(UUID userID);
78
79 /// <summary>
80 /// Gets the user folder for the given folder-type
81 /// </summary>
82 /// <param name="userID"></param>
83 /// <param name="type"></param>
84 /// <returns></returns>
85 InventoryFolderBase GetFolderForType(UUID userID, AssetType type);
86
87 /// <summary>
88 /// Gets everything (folders and items) inside a folder
89 /// </summary>
90 /// <param name="userId"></param>
91 /// <param name="folderID"></param>
92 /// <returns></returns>
93 InventoryCollection GetFolderContent(UUID userID, UUID folderID);
94
95 /// <summary>
73 /// Gets the items inside a folder 96 /// Gets the items inside a folder
74 /// </summary> 97 /// </summary>
75 /// <param name="userID"></param> 98 /// <param name="userID"></param>
@@ -138,13 +161,6 @@ namespace OpenSim.Services.Interfaces
138 bool HasInventoryForUser(UUID userID); 161 bool HasInventoryForUser(UUID userID);
139 162
140 /// <summary> 163 /// <summary>
141 /// Retrieve the root inventory folder for the given user.
142 /// </summary>
143 /// <param name="userID"></param>
144 /// <returns>null if no root folder was found</returns>
145 InventoryFolderBase GetRootFolder(UUID userID);
146
147 /// <summary>
148 /// Get the active gestures of the agent. 164 /// Get the active gestures of the agent.
149 /// </summary> 165 /// </summary>
150 /// <param name="userId"></param> 166 /// <param name="userId"></param>
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs
index 2b8ee0f..dd435c9 100644
--- a/OpenSim/Services/InventoryService/InventoryService.cs
+++ b/OpenSim/Services/InventoryService/InventoryService.cs
@@ -233,6 +233,46 @@ namespace OpenSim.Services.InventoryService
233 callback.BeginInvoke(folders, items, null, null); 233 callback.BeginInvoke(folders, items, null, null);
234 } 234 }
235 235
236 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
237 {
238 m_log.Info("[INVENTORY SERVICE]: Processing request for folder " + folderID);
239
240 // Uncomment me to simulate a slow responding inventory server
241 //Thread.Sleep(16000);
242
243 InventoryCollection invCollection = new InventoryCollection();
244
245 List<InventoryItemBase> items = GetFolderItems(userID, folderID);
246 List<InventoryFolderBase> folders = RequestSubFolders(folderID);
247
248 invCollection.UserID = userID;
249 invCollection.Folders = folders;
250 invCollection.Items = items;
251
252 m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders", items.Count, folders.Count);
253
254 return invCollection;
255 }
256
257 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
258 {
259 InventoryFolderBase root = m_Database.getUserRootFolder(userID);
260 if (root != null)
261 {
262 List<InventoryFolderBase> folders = RequestSubFolders(root.ID);
263
264 foreach (InventoryFolderBase folder in folders)
265 {
266 if (folder.Type == (short)type)
267 return folder;
268 }
269 }
270
271 // we didn't find any folder of that type. Return the root folder
272 // hopefully the root folder is not null. If it is, too bad
273 return root;
274 }
275
236 public List<InventoryItemBase> GetActiveGestures(UUID userId) 276 public List<InventoryItemBase> GetActiveGestures(UUID userId)
237 { 277 {
238 List<InventoryItemBase> activeGestures = new List<InventoryItemBase>(); 278 List<InventoryItemBase> activeGestures = new List<InventoryItemBase>();