Removed GetUserInventory(). It wasn't being used, and was creating warnings because it's Obsolete.

0.8.0.3
Oren Hurvitz 2014-04-23 08:17:25 +03:00
parent ca78c8326e
commit 018832522c
13 changed files with 2 additions and 293 deletions

View File

@ -141,22 +141,6 @@ namespace OpenSim.Region.CoreModules.Framework.Library
/// <returns></returns>
public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) { return null; }
/// <summary>
/// Synchronous inventory fetch.
/// </summary>
/// <param name="userID"></param>
/// <returns></returns>
public InventoryCollection GetUserInventory(UUID userID) { return null; }
/// <summary>
/// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
/// inventory has been received
/// </summary>
/// <param name="userID"></param>
/// <param name="callback"></param>
public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) { }
/// <summary>
/// Gets the user folder for the given folder-type
/// </summary>

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -85,10 +85,6 @@ namespace OpenSim.Server.Handlers.Inventory
protected virtual void AddHttpHandlers(IHttpServer m_httpServer)
{
m_httpServer.AddStreamHandler(
new RestDeserialiseSecureHandler<Guid, InventoryCollection>(
"POST", "/GetInventory/", GetUserInventory, CheckAuthSession));
m_httpServer.AddStreamHandler(
new RestDeserialiseSecureHandler<Guid, List<InventoryFolderBase>>(
"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<InventoryFolderBase> GetSystemFolders(Guid guid)
{
UUID userID = new UUID(guid);

View File

@ -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<string, object> request)
{
Dictionary<string, object> result = new Dictionary<string, object>();
UUID principal = UUID.Zero;
UUID.TryParse(request["PRINCIPAL"].ToString(), out principal);
InventoryCollection icoll = m_InventoryService.GetUserInventory(principal);
if (icoll != null)
{
Dictionary<string, object> folders = new Dictionary<string, object>();
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<string, object> items = new Dictionary<string, object>();
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<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();

View File

@ -484,45 +484,6 @@ namespace OpenSim.Services.Connectors
return 0;
}
public InventoryCollection GetUserInventory(UUID principalID)
{
InventoryCollection inventory = new InventoryCollection();
inventory.Folders = new List<InventoryFolderBase>();
inventory.Items = new List<InventoryItemBase>();
inventory.UserID = principalID;
try
{
Dictionary<string, object> ret = MakeRequest("GETUSERINVENTORY",
new Dictionary<string, object> {
{ "PRINCIPAL", principalID.ToString() }
});
if (!CheckReturn(ret))
return null;
Dictionary<string, object> folders =
(Dictionary<string, object>)ret["FOLDERS"];
Dictionary<string, object> items =
(Dictionary<string, object>)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<string, object>)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<string, object>)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;
}
}
}
}

View File

@ -196,37 +196,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
}
/// <summary>
/// Synchronous inventory fetch.
/// </summary>
/// <param name="userID"></param>
/// <returns></returns>
[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<InventoryFolderBase>();
inventory.Items = new List<InventoryItemBase>();
return inventory;
}
/// <summary>
/// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
/// inventory has been received
/// </summary>
/// <param name="userID"></param>
/// <param name="callback"></param>
[Obsolete]
public void GetUserInventory(UUID userID, InventoryReceiptCallback callback)
{
m_log.Error("[SIMIAN INVENTORY CONNECTOR]: Obsolete GetUserInventory called for " + userID);
callback(new List<InventoryFolderImpl>(0), new List<InventoryItemBase>(0));
}
/// <summary>
/// Retrieve the root inventory folder for the given user.
/// </summary>

View File

@ -103,12 +103,6 @@ namespace OpenSim.Services.HypergridService
return new List<InventoryFolderBase>();
}
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);

View File

@ -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<InventoryFolderBase>();
userInventory.Items = new List<InventoryItemBase>();
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<XInventoryFolder> tree = GetFolderTree(userID, suitcase.folderID);
if (tree == null || (tree != null && tree.Count == 0))
{
SetAsNormalFolder(suitcase);
userInventory.Folders.Add(ConvertToOpenSim(suitcase));
return userInventory;
}
List<InventoryItemBase> 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);

View File

@ -54,23 +54,6 @@ namespace OpenSim.Services.Interfaces
/// <returns></returns>
List<InventoryFolderBase> GetInventorySkeleton(UUID userId);
/// <summary>
/// Synchronous inventory fetch.
/// </summary>
/// <param name="userID"></param>
/// <returns></returns>
[Obsolete]
InventoryCollection GetUserInventory(UUID userID);
/// <summary>
/// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
/// inventory has been received
/// </summary>
/// <param name="userID"></param>
/// <param name="callback"></param>
[Obsolete]
void GetUserInventory(UUID userID, InventoryReceiptCallback callback);
/// <summary>
/// Retrieve the root inventory folder for the given user.
/// </summary>

View File

@ -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<InventoryFolderBase>();
userInventory.Items = new List<InventoryItemBase>();
List<InventoryFolderBase> 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)