* refactor: break out inter grid inventory services further
* more to follow0.6.0-stable
parent
1c9551eaae
commit
9af05d0bc3
|
@ -36,68 +36,77 @@ using OpenSim.Framework.Servers;
|
|||
|
||||
namespace OpenSim.Framework.Communications
|
||||
{
|
||||
/// <summary>
|
||||
/// This class manages references to OpenSim non-region services (asset, inventory, user, etc.)
|
||||
/// </summary>
|
||||
public class CommunicationsManager
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected IUserService m_userService;
|
||||
|
||||
protected Dictionary<LLUUID, string[]> m_nameRequestCache = new Dictionary<LLUUID, string[]>();
|
||||
|
||||
public IUserService UserService
|
||||
{
|
||||
get { return m_userService; }
|
||||
}
|
||||
|
||||
protected IGridServices m_gridService;
|
||||
protected IUserService m_userService;
|
||||
|
||||
public IGridServices GridService
|
||||
{
|
||||
get { return m_gridService; }
|
||||
}
|
||||
|
||||
|
||||
protected IInterRegionCommunications m_interRegion;
|
||||
|
||||
protected IGridServices m_gridService;
|
||||
|
||||
public IInterRegionCommunications InterRegion
|
||||
{
|
||||
get { return m_interRegion; }
|
||||
}
|
||||
|
||||
protected UserProfileCacheService m_userProfileCacheService;
|
||||
protected IInterRegionCommunications m_interRegion;
|
||||
|
||||
public UserProfileCacheService UserProfileCacheService
|
||||
{
|
||||
get { return m_userProfileCacheService; }
|
||||
}
|
||||
protected UserProfileCacheService m_userProfileCacheService;
|
||||
|
||||
// protected AgentAssetTransactionsManager m_transactionsManager;
|
||||
|
||||
// public AgentAssetTransactionsManager TransactionsManager
|
||||
// {
|
||||
// get { return m_transactionsManager; }
|
||||
// }
|
||||
|
||||
protected IAvatarService m_avatarService;
|
||||
// }
|
||||
|
||||
public IAvatarService AvatarService
|
||||
{
|
||||
get { return m_avatarService; }
|
||||
}
|
||||
|
||||
protected AssetCache m_assetCache;
|
||||
protected IAvatarService m_avatarService;
|
||||
|
||||
public AssetCache AssetCache
|
||||
{
|
||||
get { return m_assetCache; }
|
||||
}
|
||||
|
||||
protected NetworkServersInfo m_networkServersInfo;
|
||||
protected AssetCache m_assetCache;
|
||||
|
||||
public IInterGridInventoryServices InterGridInventoryService
|
||||
{
|
||||
get { return m_interGridInventoryService; }
|
||||
}
|
||||
protected IInterGridInventoryServices m_interGridInventoryService;
|
||||
|
||||
public NetworkServersInfo NetworkServersInfo
|
||||
{
|
||||
get { return m_networkServersInfo; }
|
||||
}
|
||||
protected NetworkServersInfo m_networkServersInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="serversInfo"></param>
|
||||
/// <param name="httpServer"></param>
|
||||
/// <param name="assetCache"></param>
|
||||
/// <param name="dumpAssetsToFile"></param>
|
||||
public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache,
|
||||
bool dumpAssetsToFile)
|
||||
{
|
||||
|
|
|
@ -34,12 +34,7 @@ namespace OpenSim.Framework.Communications
|
|||
/// Inventory operations used between grid services.
|
||||
/// </summary>
|
||||
public interface IInterGridInventoryServices
|
||||
{
|
||||
string Host
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a new inventory for the given user.
|
||||
/// </summary>
|
||||
|
|
|
@ -42,6 +42,11 @@ namespace OpenSim.Framework.Communications
|
|||
/// </summary>
|
||||
public interface IInventoryServices : IInterGridInventoryServices
|
||||
{
|
||||
string Host
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
|
||||
/// inventory has been received
|
||||
|
|
|
@ -31,7 +31,6 @@ using OpenSim.Framework.Communications.Cache;
|
|||
|
||||
namespace OpenSim.Framework.Communications
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Defines all the operations one can perform on a user's inventory.
|
||||
/// </summary>
|
||||
|
@ -41,6 +40,7 @@ namespace OpenSim.Framework.Communications
|
|||
{
|
||||
get;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
|
||||
/// inventory has been received
|
||||
|
@ -105,21 +105,11 @@ namespace OpenSim.Framework.Communications
|
|||
/// <returns>true if the inventory was successfully created, false otherwise</returns>
|
||||
bool CreateNewUserInventory(LLUUID user);
|
||||
|
||||
bool HasInventoryForUser(LLUUID userID);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve the root inventory folder for the given user.
|
||||
/// Does the given user have an inventory structure?
|
||||
/// </summary>
|
||||
/// <param name="userID"></param>
|
||||
/// <returns>null if no root folder was found</returns>
|
||||
InventoryFolderBase RequestRootFolder(LLUUID userID);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of all the folders in a given user's inventory.
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns>A flat list of the user's inventory folder tree,
|
||||
/// null if there is no inventory for this user</returns>
|
||||
List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId);
|
||||
/// <returns></returns>
|
||||
bool HasInventoryForUser(LLUUID userID);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace OpenSim.Framework.Communications
|
|||
/// <summary>
|
||||
/// Abstract base class used by local and grid implementations of an inventory service.
|
||||
/// </summary>
|
||||
public abstract class InventoryServiceBase : IInventoryServices
|
||||
public abstract class InventoryServiceBase : IInventoryServices, IInterGridInventoryServices
|
||||
{
|
||||
private static readonly ILog m_log
|
||||
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
|
|
@ -44,8 +44,9 @@ namespace OpenSim.Region.Communications.Local
|
|||
IGridServices gridService, bool dumpAssetsToFile)
|
||||
: base(serversInfo, httpServer, assetCache, dumpAssetsToFile)
|
||||
{
|
||||
AddInventoryService( inventoryService);
|
||||
AddInventoryService(inventoryService);
|
||||
m_defaultInventoryHost = inventoryService.Host;
|
||||
m_interGridInventoryService = inventoryService;
|
||||
m_userService = userService;
|
||||
m_avatarService = (IAvatarService)userService;
|
||||
m_gridService = gridService;
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace OpenSim.Region.Communications.Local
|
|||
profile = m_userManager.GetUserProfile(firstname, lastname);
|
||||
if (profile != null)
|
||||
{
|
||||
m_Parent.InventoryService.CreateNewUserInventory(profile.ID);
|
||||
m_Parent.InterGridInventoryService.CreateNewUserInventory(profile.ID);
|
||||
}
|
||||
|
||||
return profile;
|
||||
|
@ -260,13 +260,13 @@ namespace OpenSim.Region.Communications.Local
|
|||
// See LoginService
|
||||
protected override InventoryData GetInventorySkeleton(LLUUID userID, string serverUrl)
|
||||
{
|
||||
List<InventoryFolderBase> folders = m_Parent.InventoryService.GetInventorySkeleton(userID);
|
||||
List<InventoryFolderBase> folders = m_Parent.InterGridInventoryService.GetInventorySkeleton(userID);
|
||||
|
||||
// If we have user auth but no inventory folders for some reason, create a new set of folders.
|
||||
if (null == folders || 0 == folders.Count)
|
||||
{
|
||||
m_Parent.InventoryService.CreateNewUserInventory(userID);
|
||||
folders = m_Parent.InventoryService.GetInventorySkeleton(userID);
|
||||
m_Parent.InterGridInventoryService.CreateNewUserInventory(userID);
|
||||
folders = m_Parent.InterGridInventoryService.GetInventorySkeleton(userID);
|
||||
}
|
||||
|
||||
LLUUID rootID = LLUUID.Zero;
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace OpenSim.Region.Communications.Local
|
|||
// private readonly NetworkServersInfo m_serversInfo;
|
||||
private readonly uint m_defaultHomeX;
|
||||
private readonly uint m_defaultHomeY;
|
||||
private IInventoryServices m_inventoryService;
|
||||
private IInterGridInventoryServices m_interGridInventoryService;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -48,14 +48,14 @@ namespace OpenSim.Region.Communications.Local
|
|||
/// <param name="inventoryService"></param>
|
||||
/// <param name="statsCollector">Can be null if stats collection is not required.</param>
|
||||
public LocalUserServices(NetworkServersInfo serversInfo, uint defaultHomeLocX, uint defaultHomeLocY,
|
||||
IInventoryServices inventoryService)
|
||||
IInterGridInventoryServices interGridInventoryService)
|
||||
{
|
||||
// m_serversInfo = serversInfo;
|
||||
|
||||
m_defaultHomeX = defaultHomeLocX;
|
||||
m_defaultHomeY = defaultHomeLocY;
|
||||
|
||||
m_inventoryService = inventoryService;
|
||||
m_interGridInventoryService = interGridInventoryService;
|
||||
}
|
||||
|
||||
public override UserProfileData SetupMasterUser(string firstName, string lastName)
|
||||
|
@ -82,7 +82,7 @@ namespace OpenSim.Region.Communications.Local
|
|||
}
|
||||
else
|
||||
{
|
||||
m_inventoryService.CreateNewUserInventory(profile.ID);
|
||||
m_interGridInventoryService.CreateNewUserInventory(profile.ID);
|
||||
}
|
||||
|
||||
return profile;
|
||||
|
|
|
@ -39,7 +39,7 @@ using OpenSim.Framework.Statistics;
|
|||
|
||||
namespace OpenSim.Region.Communications.OGS1
|
||||
{
|
||||
public class OGS1InventoryService : IInventoryServices
|
||||
public class OGS1InventoryService : IInventoryServices, IInterGridInventoryServices
|
||||
{
|
||||
private static readonly ILog m_log
|
||||
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
|
|
@ -39,7 +39,7 @@ using OpenSim.Framework.Statistics;
|
|||
|
||||
namespace OpenSim.Region.Communications.OGS1
|
||||
{
|
||||
public class OGS1SecureInventoryService : ISecureInventoryService
|
||||
public class OGS1SecureInventoryService : ISecureInventoryService, IInterGridInventoryServices
|
||||
{
|
||||
private static readonly ILog m_log
|
||||
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
|
Loading…
Reference in New Issue