From 1de6cffa28348975a2492ce1e8a85c365df4dfaf Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 1 May 2008 20:47:33 +0000 Subject: * Refactor: Remove the unused userID parameter that was being passed into almost every inventory method * This allows lots of redundant inventory methods with only slightly different names to be eliminated. --- .../Communications/OGS1/OGS1InventoryService.cs | 54 +++++++++++----------- 1 file changed, 28 insertions(+), 26 deletions(-) (limited to 'OpenSim/Region/Communications/OGS1') diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index 8a35519..ba91f14 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs @@ -154,14 +154,12 @@ namespace OpenSim.Region.Communications.OGS1 /// /// - /// - /// - /// - public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder) + /// + public bool AddFolder(InventoryFolderBase folder) { try { - SynchronousRestObjectPoster.BeginPostObject( + return SynchronousRestObjectPoster.BeginPostObject( "POST", _inventoryServerUrl + "/NewFolder/", folder); } catch (WebException e) @@ -169,18 +167,19 @@ namespace OpenSim.Region.Communications.OGS1 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Add new inventory folder operation failed, {0} {1}", e.Source, e.Message); } + + return false; } /// /// /// - /// /// - public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder) + public bool MoveFolder(InventoryFolderBase folder) { try { - SynchronousRestObjectPoster.BeginPostObject( + return SynchronousRestObjectPoster.BeginPostObject( "POST", _inventoryServerUrl + "/MoveFolder/", folder); } catch (WebException e) @@ -188,19 +187,18 @@ namespace OpenSim.Region.Communications.OGS1 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Move inventory folder operation failed, {0} {1}", e.Source, e.Message); } + + return false; } /// /// /// - /// - /// - /// - public void PurgeInventoryFolder(LLUUID userID, InventoryFolderBase folder) + public bool PurgeFolder(InventoryFolderBase folder) { try { - SynchronousRestObjectPoster.BeginPostObject( + return SynchronousRestObjectPoster.BeginPostObject( "POST", _inventoryServerUrl + "/PurgeFolder/", folder); } catch (WebException e) @@ -208,33 +206,35 @@ namespace OpenSim.Region.Communications.OGS1 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Move inventory folder operation failed, {0} {1}", e.Source, e.Message); } + + return false; } /// /// - /// - /// - /// - public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) + /// + public bool AddItem(InventoryItemBase item) { try { - SynchronousRestObjectPoster.BeginPostObject( + return SynchronousRestObjectPoster.BeginPostObject( "POST", _inventoryServerUrl + "/NewItem/", item); } catch (WebException e) { m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Add new inventory item operation failed, {0} {1}", e.Source, e.Message); - } + } + + return false; } // TODO: this is a temporary workaround, the UpdateInventoryItem method need to be implemented - public void UpdateInventoryItem(LLUUID userID, InventoryItemBase item) + public bool UpdateItem(InventoryItemBase item) { try { - SynchronousRestObjectPoster.BeginPostObject( + return SynchronousRestObjectPoster.BeginPostObject( "POST", _inventoryServerUrl + "/NewItem/", item); } catch (WebException e) @@ -242,18 +242,18 @@ namespace OpenSim.Region.Communications.OGS1 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Update new inventory item operation failed, {0} {1}", e.Source, e.Message); } + + return false; } /// /// - /// - /// - /// - public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) + /// + public bool DeleteItem(InventoryItemBase item) { try { - SynchronousRestObjectPoster.BeginPostObject( + return SynchronousRestObjectPoster.BeginPostObject( "POST", _inventoryServerUrl + "/DeleteItem/", item); } catch (WebException e) @@ -261,6 +261,8 @@ namespace OpenSim.Region.Communications.OGS1 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Delete inventory item operation failed, {0} {1}", e.Source, e.Message); } + + return false; } public bool HasInventoryForUser(LLUUID userID) -- cgit v1.1