29 using System.Collections.Generic;
30 using System.Threading;
31 using OpenSim.Framework;
34 namespace OpenSim.
Region.CoreModules.ServiceConnectorsOut.Inventory
41 private const double CACHE_EXPIRATION_SECONDS = 3600.0;
43 private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders =
new ExpiringCache<UUID, InventoryFolderBase>();
44 private static ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>> m_FolderTypes =
new ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>>();
45 private static ExpiringCache<UUID, InventoryCollection> m_Inventories =
new ExpiringCache<UUID, InventoryCollection>();
49 m_RootFolders.AddOrUpdate(userID, root, CACHE_EXPIRATION_SECONDS);
55 if (m_RootFolders.TryGetValue(userID, out root))
63 Dictionary<FolderType, InventoryFolderBase> ff = null;
64 if (!m_FolderTypes.TryGetValue(userID, out ff))
66 ff =
new Dictionary<FolderType, InventoryFolderBase>();
67 m_FolderTypes.Add(userID, ff, CACHE_EXPIRATION_SECONDS);
75 if (!ff.ContainsKey(type))
82 Dictionary<FolderType, InventoryFolderBase> ff = null;
83 if (m_FolderTypes.TryGetValue(userID, out ff))
89 if (ff.TryGetValue(type, out f))
99 m_Inventories.AddOrUpdate(userID, inv, 120);
106 if (m_Inventories.TryGetValue(userID, out inv))
113 return f.ParentID == folderID;
117 return i.Folder == folderID;
127 if (m_Inventories.TryGetValue(userID, out inv))
131 return i.Folder == folderID;
void Cache(UUID userID, FolderType type, InventoryFolderBase folder)
void Cache(UUID userID, InventoryFolderBase root)
Cache root and system inventory folders to reduce number of potentially remote inventory calls and as...
List< InventoryItemBase > GetFolderItems(UUID userID, UUID folderID)
void Cache(UUID userID, InventoryCollection inv)
InventoryFolderBase GetFolderForType(UUID userID, FolderType type)
Inventory Item - contains all the properties associated with an individual inventory piece...
InventoryCollection GetFolderContent(UUID userID, UUID folderID)
InventoryFolderBase GetRootFolder(UUID userID)
Used to serialize a whole inventory for transfer over the network.