From 018832522c3c5e37f027bade05c93b88d6ca3827 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Wed, 23 Apr 2014 08:17:25 +0300 Subject: [PATCH] Removed GetUserInventory(). It wasn't being used, and was creating warnings because it's Obsolete. --- .../Library/LocalInventoryService.cs | 16 ------ .../Inventory/HGInventoryBroker.cs | 23 -------- .../Inventory/InventoryCache.cs | 10 +--- .../LocalInventoryServiceConnector.cs | 10 ---- .../RemoteXInventoryServiceConnector.cs | 9 ---- .../Inventory/InventoryServerInConnector.cs | 10 ---- .../Inventory/XInventoryInConnector.cs | 41 -------------- .../Inventory/XInventoryServicesConnector.cs | 41 +------------- .../SimianInventoryServiceConnector.cs | 31 ----------- .../HypergridService/HGInventoryService.cs | 6 --- .../HGSuitcaseInventoryService.cs | 53 ------------------- .../Services/Interfaces/IInventoryService.cs | 17 ------ .../InventoryService/XInventoryService.cs | 28 ---------- 13 files changed, 2 insertions(+), 293 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs b/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs index 49589fd3c0..01814a15c6 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs @@ -141,22 +141,6 @@ namespace OpenSim.Region.CoreModules.Framework.Library /// public List GetInventorySkeleton(UUID userId) { return null; } - /// - /// Synchronous inventory fetch. - /// - /// - /// - public InventoryCollection GetUserInventory(UUID userID) { return null; } - - /// - /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the - /// inventory has been received - /// - /// - /// - public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) { } - - /// /// Gets the user folder for the given folder-type /// diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 77a3c82efb..fd41187ee8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs @@ -316,29 +316,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return connector.GetInventorySkeleton(userID); } - public InventoryCollection GetUserInventory(UUID userID) - { - string invURL = GetInventoryServiceURL(userID); - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetUserInventory for {0} {1}", userID, invURL); - - if (invURL == null) // not there, forward to local inventory connector to resolve - return m_LocalGridInventoryService.GetUserInventory(userID); - - InventoryCollection c = m_Cache.GetUserInventory(userID); - if (c != null) - return c; - - IInventoryService connector = GetConnector(invURL); - c = connector.GetUserInventory(userID); - - m_Cache.Cache(userID, c); - return c; - } - - public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) - { - } - public InventoryFolderBase GetRootFolder(UUID userID) { //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs index 2fc8ee361a..499ca5e3c5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -99,14 +99,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory m_Inventories.AddOrUpdate(userID, inv, 120); } - public InventoryCollection GetUserInventory(UUID userID) - { - InventoryCollection inv = null; - if (m_Inventories.TryGetValue(userID, out inv)) - return inv; - return null; - } - public InventoryCollection GetFolderContent(UUID userID, UUID folderID) { InventoryCollection inv = null; diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 6832b1f06d..f80fab3e1d 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs @@ -164,16 +164,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return m_InventoryService.GetInventorySkeleton(userId); } - public InventoryCollection GetUserInventory(UUID id) - { - return m_InventoryService.GetUserInventory(id); - } - - public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) - { - m_InventoryService.GetUserInventory(userID, callback); - } - public InventoryFolderBase GetRootFolder(UUID userID) { return m_InventoryService.GetRootFolder(userID); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index 7f78076335..166e4a15e8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs @@ -172,15 +172,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return m_RemoteConnector.GetInventorySkeleton(userId); } - public InventoryCollection GetUserInventory(UUID userID) - { - return m_RemoteConnector.GetUserInventory(userID); - } - - public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) - { - } - public InventoryFolderBase GetRootFolder(UUID userID) { return m_RemoteConnector.GetRootFolder(userID); diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs index 1d422a7fcc..b295446c19 100644 --- a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs @@ -85,10 +85,6 @@ namespace OpenSim.Server.Handlers.Inventory protected virtual void AddHttpHandlers(IHttpServer m_httpServer) { - m_httpServer.AddStreamHandler( - new RestDeserialiseSecureHandler( - "POST", "/GetInventory/", GetUserInventory, CheckAuthSession)); - m_httpServer.AddStreamHandler( new RestDeserialiseSecureHandler>( "POST", "/SystemFolders/", GetSystemFolders, CheckAuthSession)); @@ -178,12 +174,6 @@ namespace OpenSim.Server.Handlers.Inventory #region Wrappers for converting the Guid parameter - public InventoryCollection GetUserInventory(Guid guid) - { - UUID userID = new UUID(guid); - return m_InventoryService.GetUserInventory(userID); - } - public List GetSystemFolders(Guid guid) { UUID userID = new UUID(guid); diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index 5df3ddaee9..ce975a82e6 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs @@ -114,8 +114,6 @@ namespace OpenSim.Server.Handlers.Asset return HandleCreateUserInventory(request); case "GETINVENTORYSKELETON": return HandleGetInventorySkeleton(request); - case "GETUSERINVENTORY": - return HandleGetUserInventory(request); case "GETROOTFOLDER": return HandleGetRootFolder(request); case "GETFOLDERFORTYPE": @@ -250,45 +248,6 @@ namespace OpenSim.Server.Handlers.Asset return Util.UTF8NoBomEncoding.GetBytes(xmlString); } - byte[] HandleGetUserInventory(Dictionary request) - { - Dictionary result = new Dictionary(); - UUID principal = UUID.Zero; - UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); - - InventoryCollection icoll = m_InventoryService.GetUserInventory(principal); - if (icoll != null) - { - Dictionary folders = new Dictionary(); - int i = 0; - if (icoll.Folders != null) - { - foreach (InventoryFolderBase f in icoll.Folders) - { - folders["folder_" + i.ToString()] = EncodeFolder(f); - i++; - } - result["FOLDERS"] = folders; - } - if (icoll.Items != null) - { - i = 0; - Dictionary items = new Dictionary(); - foreach (InventoryItemBase it in icoll.Items) - { - items["item_" + i.ToString()] = EncodeItem(it); - i++; - } - result["ITEMS"] = items; - } - } - - string xmlString = ServerUtils.BuildXmlResponse(result); - - //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); - return Util.UTF8NoBomEncoding.GetBytes(xmlString); - } - byte[] HandleGetRootFolder(Dictionary request) { Dictionary result = new Dictionary(); diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs index 36d4ae25f0..d258293f11 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs @@ -484,45 +484,6 @@ namespace OpenSim.Services.Connectors return 0; } - public InventoryCollection GetUserInventory(UUID principalID) - { - InventoryCollection inventory = new InventoryCollection(); - inventory.Folders = new List(); - inventory.Items = new List(); - inventory.UserID = principalID; - - try - { - Dictionary ret = MakeRequest("GETUSERINVENTORY", - new Dictionary { - { "PRINCIPAL", principalID.ToString() } - }); - - if (!CheckReturn(ret)) - return null; - - Dictionary folders = - (Dictionary)ret["FOLDERS"]; - Dictionary items = - (Dictionary)ret["ITEMS"]; - - foreach (Object o in folders.Values) // getting the values directly, we don't care about the keys folder_i - inventory.Folders.Add(BuildFolder((Dictionary)o)); - foreach (Object o in items.Values) // getting the values directly, we don't care about the keys item_i - inventory.Items.Add(BuildItem((Dictionary)o)); - } - catch (Exception e) - { - m_log.Error("[XINVENTORY SERVICES CONNECTOR]: Exception in GetUserInventory: ", e); - } - - return inventory; - } - - public void GetUserInventory(UUID principalID, InventoryReceiptCallback callback) - { - } - public bool HasInventoryForUser(UUID principalID) { return false; @@ -607,4 +568,4 @@ namespace OpenSim.Services.Connectors return item; } } -} \ No newline at end of file +} diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index 97eaabe68a..9ded1c4d28 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs @@ -196,37 +196,6 @@ namespace OpenSim.Services.Connectors.SimianGrid } } - /// - /// Synchronous inventory fetch. - /// - /// - /// - [Obsolete] - public InventoryCollection GetUserInventory(UUID userID) - { - m_log.Error("[SIMIAN INVENTORY CONNECTOR]: Obsolete GetUserInventory called for " + userID); - - InventoryCollection inventory = new InventoryCollection(); - inventory.UserID = userID; - inventory.Folders = new List(); - inventory.Items = new List(); - - return inventory; - } - - /// - /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the - /// inventory has been received - /// - /// - /// - [Obsolete] - public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) - { - m_log.Error("[SIMIAN INVENTORY CONNECTOR]: Obsolete GetUserInventory called for " + userID); - callback(new List(0), new List(0)); - } - /// /// Retrieve the root inventory folder for the given user. /// diff --git a/OpenSim/Services/HypergridService/HGInventoryService.cs b/OpenSim/Services/HypergridService/HGInventoryService.cs index 3233caf704..2c63240476 100644 --- a/OpenSim/Services/HypergridService/HGInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGInventoryService.cs @@ -103,12 +103,6 @@ namespace OpenSim.Services.HypergridService return new List(); } - public override InventoryCollection GetUserInventory(UUID userID) - { - // NOGO for this inventory service - return null; - } - public override InventoryFolderBase GetRootFolder(UUID principalID) { //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetRootFolder for {0}", principalID); diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index 1608039517..8269d36dd9 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs @@ -137,59 +137,6 @@ namespace OpenSim.Services.HypergridService return folders; } - public override InventoryCollection GetUserInventory(UUID userID) - { - m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Get Suitcase inventory for user {0}", userID); - - InventoryCollection userInventory = new InventoryCollection(); - userInventory.UserID = userID; - userInventory.Folders = new List(); - userInventory.Items = new List(); - - XInventoryFolder suitcase = GetSuitcaseXFolder(userID); - - if (suitcase == null) - { - m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: Found no suitcase folder for user {0} when looking for user inventory", userID); - return null; - } - - List tree = GetFolderTree(userID, suitcase.folderID); - if (tree == null || (tree != null && tree.Count == 0)) - { - SetAsNormalFolder(suitcase); - userInventory.Folders.Add(ConvertToOpenSim(suitcase)); - return userInventory; - } - - List items; - foreach (XInventoryFolder f in tree) - { - // Add the items of this subfolder - items = GetFolderItems(userID, f.folderID); - if (items != null && items.Count > 0) - { - userInventory.Items.AddRange(items); - } - - // Add the folder itself - userInventory.Folders.Add(ConvertToOpenSim(f)); - } - - items = GetFolderItems(userID, suitcase.folderID); - if (items != null && items.Count > 0) - { - userInventory.Items.AddRange(items); - } - - SetAsNormalFolder(suitcase); - userInventory.Folders.Add(ConvertToOpenSim(suitcase)); - - m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetUserInventory for user {0} returning {1} folders and {2} items", - userID, userInventory.Folders.Count, userInventory.Items.Count); - return userInventory; - } - public override InventoryFolderBase GetRootFolder(UUID principalID) { m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetRootFolder for {0}", principalID); diff --git a/OpenSim/Services/Interfaces/IInventoryService.cs b/OpenSim/Services/Interfaces/IInventoryService.cs index 36634a379e..2805356cde 100644 --- a/OpenSim/Services/Interfaces/IInventoryService.cs +++ b/OpenSim/Services/Interfaces/IInventoryService.cs @@ -54,23 +54,6 @@ namespace OpenSim.Services.Interfaces /// List GetInventorySkeleton(UUID userId); - /// - /// Synchronous inventory fetch. - /// - /// - /// - [Obsolete] - InventoryCollection GetUserInventory(UUID userID); - - /// - /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the - /// inventory has been received - /// - /// - /// - [Obsolete] - void GetUserInventory(UUID userID, InventoryReceiptCallback callback); - /// /// Retrieve the root inventory folder for the given user. /// diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 7bad4b00ec..3bee4337ef 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -615,34 +615,6 @@ namespace OpenSim.Services.InventoryService return m_Database.GetAssetPermissions(principalID, assetID); } - public virtual InventoryCollection GetUserInventory(UUID userID) - { - InventoryCollection userInventory = new InventoryCollection(); - userInventory.UserID = userID; - userInventory.Folders = new List(); - userInventory.Items = new List(); - - List skel = GetInventorySkeleton(userID); - if (skel != null) - { - foreach (InventoryFolderBase f in skel) - { - InventoryCollection c = GetFolderContent(userID, f.ID); - if (c != null && c.Items != null && c.Items.Count > 0) - userInventory.Items.AddRange(c.Items); - if (c != null && c.Folders != null && c.Folders.Count > 0) - userInventory.Folders.AddRange(c.Folders); - } - } - m_log.DebugFormat("[XINVENTORY SERVICE]: GetUserInventory for user {0} returning {1} folders and {2} items", - userID, userInventory.Folders.Count, userInventory.Items.Count); - return userInventory; - } - - public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) - { - } - // Unused. // public bool HasInventoryForUser(UUID userID)