aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2009-08-26 11:48:05 -0400
committerTeravus Ovares (Dan Olivares)2009-08-26 11:48:05 -0400
commit54e05a083d2aeb7a892647f64edfd52db80ce5ed (patch)
tree1fca51f8dd19c0f4871d8e1b875511c6087b3675 /OpenSim/Services
parent* It turns out that Physics heightmap values were being stored in managed mem... (diff)
parentAdd reference to OpenMetaverse.dll to UserServer.Modules to make MSVS happy (diff)
downloadopensim-SC-54e05a083d2aeb7a892647f64edfd52db80ce5ed.zip
opensim-SC-54e05a083d2aeb7a892647f64edfd52db80ce5ed.tar.gz
opensim-SC-54e05a083d2aeb7a892647f64edfd52db80ce5ed.tar.bz2
opensim-SC-54e05a083d2aeb7a892647f64edfd52db80ce5ed.tar.xz
Merge branch 'master' of ssh://MyConnection/var/git/opensim
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs13
-rw-r--r--OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs5
-rw-r--r--OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs49
-rw-r--r--OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs6
-rw-r--r--OpenSim/Services/Interfaces/IInventoryService.cs8
-rw-r--r--OpenSim/Services/InventoryService/InventoryService.cs20
6 files changed, 91 insertions, 10 deletions
diff --git a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
index 45e921a..1004fb9 100644
--- a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
@@ -201,6 +201,19 @@ namespace OpenSim.Services.Connectors.Inventory
201 return false; 201 return false;
202 } 202 }
203 203
204 public bool DeleteFolders(string id, List<UUID> folders, UUID sessionID)
205 {
206 string url = string.Empty;
207 string userID = string.Empty;
208
209 if (StringToUrlAndUserID(id, out url, out userID))
210 {
211 ISessionAuthInventoryService connector = GetConnector(url);
212 return connector.DeleteFolders(userID, folders, sessionID);
213 }
214 return false;
215 }
216
204 public bool PurgeFolder(string id, InventoryFolderBase folder, UUID sessionID) 217 public bool PurgeFolder(string id, InventoryFolderBase folder, UUID sessionID)
205 { 218 {
206 string url = string.Empty; 219 string url = string.Empty;
diff --git a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs
index c89c9b7..da8c7e2 100644
--- a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs
+++ b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs
@@ -89,6 +89,11 @@ namespace OpenSim.Services.Connectors
89 bool MoveFolder(string userID, InventoryFolderBase folder, UUID session_id); 89 bool MoveFolder(string userID, InventoryFolderBase folder, UUID session_id);
90 90
91 /// <summary> 91 /// <summary>
92 /// Delete a list of inventory folders (from trash)
93 /// </summary>
94 bool DeleteFolders(string userID, List<UUID> folders, UUID session_id);
95
96 /// <summary>
92 /// Purge an inventory folder of all its items and subfolders. 97 /// Purge an inventory folder of all its items and subfolders.
93 /// </summary> 98 /// </summary>
94 /// <param name="folder"></param> 99 /// <param name="folder"></param>
diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
index b573a06..a2261ba 100644
--- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
@@ -229,6 +229,11 @@ namespace OpenSim.Services.Connectors
229 return SynchronousRestSessionObjectPoster<Guid, InventoryCollection>.BeginPostObject( 229 return SynchronousRestSessionObjectPoster<Guid, InventoryCollection>.BeginPostObject(
230 "POST", m_ServerURI + "/GetFolderContent/", folderID.Guid, sessionID.ToString(), userID.ToString()); 230 "POST", m_ServerURI + "/GetFolderContent/", folderID.Guid, sessionID.ToString(), userID.ToString());
231 } 231 }
232 catch (TimeoutException e)
233 {
234 m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderContent operation to {0} timed out {0} {1}.", m_ServerURI,
235 e.Source, e.Message);
236 }
232 catch (Exception e) 237 catch (Exception e)
233 { 238 {
234 // Maybe we're talking to an old inventory server. Try this other thing. 239 // Maybe we're talking to an old inventory server. Try this other thing.
@@ -308,6 +313,25 @@ namespace OpenSim.Services.Connectors
308 return false; 313 return false;
309 } 314 }
310 315
316 public bool DeleteFolders(string userID, List<UUID> folderIDs, UUID sessionID)
317 {
318 try
319 {
320 List<Guid> guids = new List<Guid>();
321 foreach (UUID u in folderIDs)
322 guids.Add(u.Guid);
323 return SynchronousRestSessionObjectPoster<List<Guid>, bool>.BeginPostObject(
324 "POST", m_ServerURI + "/DeleteFolders/", guids, sessionID.ToString(), userID);
325 }
326 catch (Exception e)
327 {
328 m_log.ErrorFormat("[INVENTORY CONNECTOR]: Delete inventory folders operation failed, {0} {1}",
329 e.Source, e.Message);
330 }
331
332 return false;
333 }
334
311 public bool MoveFolder(string userID, InventoryFolderBase folder, UUID sessionID) 335 public bool MoveFolder(string userID, InventoryFolderBase folder, UUID sessionID)
312 { 336 {
313 try 337 try
@@ -397,13 +421,28 @@ namespace OpenSim.Services.Connectors
397 421
398 private void MoveItemsAsync(string userID, List<InventoryItemBase> items, UUID sessionID) 422 private void MoveItemsAsync(string userID, List<InventoryItemBase> items, UUID sessionID)
399 { 423 {
424 if (items == null)
425 {
426 m_log.WarnFormat("[INVENTORY CONNECTOR]: request to move items got a null list.");
427 return;
428 }
429
400 try 430 try
401 { 431 {
402 SynchronousRestSessionObjectPoster<List<InventoryItemBase>, bool>.BeginPostObject( 432 //SynchronousRestSessionObjectPoster<List<InventoryItemBase>, bool>.BeginPostObject(
403 "POST", m_ServerURI + "/MoveItems/", items, sessionID.ToString(), userID.ToString()); 433 // "POST", m_ServerURI + "/MoveItems/", items, sessionID.ToString(), userID.ToString());
434
435 //// Success
436 //return;
437 string uri = m_ServerURI + "/inventory/" + userID;
438 if (SynchronousRestObjectRequester.
439 MakeRequest<List<InventoryItemBase>, bool>("PUT", uri, items))
440 m_log.DebugFormat("[INVENTORY CONNECTOR]: move {0} items poster succeeded {1}", items.Count, uri);
441 else
442 m_log.DebugFormat("[INVENTORY CONNECTOR]: move {0} items poster failed {1}", items.Count, uri); ;
404 443
405 // Success
406 return; 444 return;
445
407 } 446 }
408 catch (Exception e) 447 catch (Exception e)
409 { 448 {
@@ -466,12 +505,12 @@ namespace OpenSim.Services.Connectors
466 return null; 505 return null;
467 } 506 }
468 507
469 public InventoryFolderBase QueryFolder(string userID, InventoryFolderBase item, UUID sessionID) 508 public InventoryFolderBase QueryFolder(string userID, InventoryFolderBase folder, UUID sessionID)
470 { 509 {
471 try 510 try
472 { 511 {
473 return SynchronousRestSessionObjectPoster<InventoryFolderBase, InventoryFolderBase>.BeginPostObject( 512 return SynchronousRestSessionObjectPoster<InventoryFolderBase, InventoryFolderBase>.BeginPostObject(
474 "POST", m_ServerURI + "/QueryFolder/", item, sessionID.ToString(), item.Owner.ToString()); 513 "POST", m_ServerURI + "/QueryFolder/", folder, sessionID.ToString(), userID);
475 } 514 }
476 catch (Exception e) 515 catch (Exception e)
477 { 516 {
diff --git a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs
index cd283ff..a7aa138 100644
--- a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs
@@ -136,6 +136,12 @@ namespace OpenSim.Services.Connectors
136 return false; 136 return false;
137 } 137 }
138 138
139 public bool DeleteFolders(UUID ownerID, List<UUID> folderIDs)
140 {
141 return false;
142 }
143
144
139 public bool PurgeFolder(InventoryFolderBase folder) 145 public bool PurgeFolder(InventoryFolderBase folder)
140 { 146 {
141 return false; 147 return false;
diff --git a/OpenSim/Services/Interfaces/IInventoryService.cs b/OpenSim/Services/Interfaces/IInventoryService.cs
index ebdb09a..c775090 100644
--- a/OpenSim/Services/Interfaces/IInventoryService.cs
+++ b/OpenSim/Services/Interfaces/IInventoryService.cs
@@ -122,6 +122,14 @@ namespace OpenSim.Services.Interfaces
122 bool MoveFolder(InventoryFolderBase folder); 122 bool MoveFolder(InventoryFolderBase folder);
123 123
124 /// <summary> 124 /// <summary>
125 /// Delete an item from the user's inventory
126 /// </summary>
127 /// <param name="item"></param>
128 /// <returns>true if the item was successfully deleted</returns>
129 //bool DeleteItem(InventoryItemBase item);
130 bool DeleteFolders(UUID userID, List<UUID> folderIDs);
131
132 /// <summary>
125 /// Purge an inventory folder of all its items and subfolders. 133 /// Purge an inventory folder of all its items and subfolders.
126 /// </summary> 134 /// </summary>
127 /// <param name="folder"></param> 135 /// <param name="folder"></param>
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs
index 6310254..19b1fd8 100644
--- a/OpenSim/Services/InventoryService/InventoryService.cs
+++ b/OpenSim/Services/InventoryService/InventoryService.cs
@@ -235,8 +235,6 @@ namespace OpenSim.Services.InventoryService
235 235
236 public InventoryCollection GetFolderContent(UUID userID, UUID folderID) 236 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
237 { 237 {
238 m_log.Info("[INVENTORY SERVICE]: Processing request for folder " + folderID);
239
240 // Uncomment me to simulate a slow responding inventory server 238 // Uncomment me to simulate a slow responding inventory server
241 //Thread.Sleep(16000); 239 //Thread.Sleep(16000);
242 240
@@ -249,7 +247,7 @@ namespace OpenSim.Services.InventoryService
249 invCollection.Folders = folders; 247 invCollection.Folders = folders;
250 invCollection.Items = items; 248 invCollection.Items = items;
251 249
252 m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders", items.Count, folders.Count); 250 m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders in folder {2}", items.Count, folders.Count, folderID);
253 251
254 return invCollection; 252 return invCollection;
255 } 253 }
@@ -427,15 +425,27 @@ namespace OpenSim.Services.InventoryService
427 return null; 425 return null;
428 } 426 }
429 427
430 public virtual InventoryFolderBase GetFolder(InventoryFolderBase item) 428 public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder)
431 { 429 {
432 InventoryFolderBase result = m_Database.getInventoryFolder(item.ID); 430 InventoryFolderBase result = m_Database.getInventoryFolder(folder.ID);
433 if (result != null) 431 if (result != null)
434 return result; 432 return result;
435 433
434 m_log.DebugFormat("[INVENTORY SERVICE]: GetFolder failed to find folder {0}", folder.ID);
436 return null; 435 return null;
437 } 436 }
438 437
438 public virtual bool DeleteFolders(UUID ownerID, List<UUID> folderIDs)
439 {
440 foreach (UUID id in folderIDs)
441 {
442 InventoryFolderBase folder = new InventoryFolderBase(id, ownerID);
443 PurgeFolder(folder);
444 m_Database.deleteInventoryFolder(id);
445 }
446 return true;
447 }
448
439 /// <summary> 449 /// <summary>
440 /// Purge a folder of all items items and subfolders. 450 /// Purge a folder of all items items and subfolders.
441 /// 451 ///