30 using System.Collections.Generic;
31 using System.Reflection;
34 using OpenSim.Framework;
35 using OpenSim.Framework.Monitoring;
36 using OpenSim.Services.Connectors;
37 using OpenSim.Region.Framework.Interfaces;
38 using OpenSim.Region.Framework.Scenes;
39 using OpenSim.Services.Interfaces;
42 namespace OpenSim.
Region.CoreModules.ServiceConnectorsOut.Inventory
44 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"RemoteXInventoryServicesConnector")]
47 private static readonly ILog m_log =
48 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55 private bool m_Enabled;
63 if (m_UserManager == null)
67 if (m_UserManager == null)
69 "[XINVENTORY CONNECTOR]: Could not retrieve IUserManagement module from {0}",
70 Scene.RegionInfo.RegionName);
77 public Type ReplaceableInterface
84 get {
return "RemoteXInventoryServicesConnector"; }
101 protected void Init(IConfigSource source)
106 #region ISharedRegionModule
110 IConfig moduleConfig = source.Configs[
"Modules"];
111 if (moduleConfig != null)
113 string name = moduleConfig.GetString(
"InventoryServices",
"");
119 m_log.Info(
"[XINVENTORY CONNECTOR]: Remote XInventory enabled");
157 m_log.InfoFormat(
"[XINVENTORY CONNECTOR]: Enabled remote XInventory for region {0}", scene.RegionInfo.RegionName);
161 #endregion ISharedRegionModule
163 #region IInventoryService
172 return m_RemoteConnector.GetInventorySkeleton(userId);
177 return m_RemoteConnector.GetRootFolder(userID);
182 return m_RemoteConnector.GetFolderForType(userID, type);
209 return m_RemoteConnector.GetMultipleFoldersContent(principalID, folderIDs);
214 return m_RemoteConnector.GetFolderItems(userID, folderID);
222 return m_RemoteConnector.AddFolder(folder);
230 return m_RemoteConnector.UpdateFolder(folder);
238 return m_RemoteConnector.MoveFolder(folder);
243 if (folderIDs == null)
245 if (folderIDs.Count == 0)
248 return m_RemoteConnector.DeleteFolders(ownerID, folderIDs);
257 return m_RemoteConnector.PurgeFolder(folder);
265 return m_RemoteConnector.AddItem(item);
273 return m_RemoteConnector.UpdateItem(item);
276 public bool MoveItems(UUID ownerID, List<InventoryItemBase> items)
281 return m_RemoteConnector.MoveItems(ownerID, items);
289 if (itemIDs.Count == 0)
292 return m_RemoteConnector.DeleteItems(ownerID, itemIDs);
301 if (m_RemoteConnector == null)
302 m_log.DebugFormat(
"[XINVENTORY CONNECTOR]: connector stub is null!!!");
303 return m_RemoteConnector.GetItem(item);
311 return m_RemoteConnector.GetMultipleItems(userID, itemIDs);
320 return m_RemoteConnector.GetFolder(folder);
330 return new List<InventoryItemBase>();
335 return m_RemoteConnector.GetAssetPermissions(userID, assetID);
bool HasInventoryForUser(UUID userID)
Does the given user have an inventory structure?
RemoteXInventoryServicesConnector(string url)
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
int GetAssetPermissions(UUID userID, UUID assetID)
Get the union of permissions of all inventory items that hold the given assetID.
InventoryFolderBase GetFolder(InventoryFolderBase folder)
Get a folder, given by its UUID
bool DeleteItems(UUID ownerID, List< UUID > itemIDs)
Delete an item from the user's inventory
RemoteXInventoryServicesConnector()
bool PurgeFolder(InventoryFolderBase folder)
Purge an inventory folder of all its items and subfolders.
bool AddFolder(InventoryFolderBase folder)
Add a new folder to the user's inventory
RemoteXInventoryServicesConnector(IConfigSource source)
bool DeleteFolders(UUID ownerID, List< UUID > folderIDs)
Delete an item from the user's inventory
bool CreateUserInventory(UUID user)
Create the entire inventory for a given user
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
InventoryCollection GetFolderContent(UUID userID, UUID folderID)
Gets everything (folders and items) inside a folder
bool UpdateItem(InventoryItemBase item)
Update an item in the user's inventory
bool UpdateFolder(InventoryFolderBase folder)
Update a folder in the user's inventory
List< InventoryItemBase > GetFolderItems(UUID userID, UUID folderID)
Gets the items inside a folder
InventoryFolderBase GetFolderForType(UUID userID, FolderType type)
Gets the user folder for the given folder-type
void PostInitialise()
This is called exactly once after all the shared region-modules have been instanciated and IRegionMod...
InventoryItemBase GetItem(InventoryItemBase item)
Get an item, given by its UUID
Inventory Item - contains all the properties associated with an individual inventory piece...
bool MoveItems(UUID ownerID, List< InventoryItemBase > items)
InventoryItemBase[] GetMultipleItems(UUID userID, UUID[] itemIDs)
Get multiple items, given by their UUIDs
List< InventoryItemBase > GetActiveGestures(UUID userId)
Get the active gestures of the agent.
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
bool MoveFolder(InventoryFolderBase folder)
Move an inventory folder to a new location
void Initialise(IConfigSource source)
This is called to initialize the region module. For shared modules, this is called exactly once...
void Init(IConfigSource source)
InventoryFolderBase GetRootFolder(UUID userID)
Retrieve the root inventory folder for the given user.
bool AddItem(InventoryItemBase item)
Add a new item to the user's inventory
virtual InventoryCollection[] GetMultipleFoldersContent(UUID principalID, UUID[] folderIDs)
Gets everything (folders and items) inside a folder
This maintains the relationship between a UUID and a user name.
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
Used to serialize a whole inventory for transfer over the network.
List< InventoryFolderBase > GetInventorySkeleton(UUID userId)
Gets the skeleton of the inventory – folders only