aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-07-23 22:18:09 +0000
committerJustin Clarke Casey2008-07-23 22:18:09 +0000
commit9af05d0bc3253376cecb7cf6586c53e8067bb2a4 (patch)
tree385327503fe674b34b5a10d585b199da7cc7cbbb /OpenSim
parentfew additional fixed to get prim inventory up on nhibernate (diff)
downloadopensim-SC_OLD-9af05d0bc3253376cecb7cf6586c53e8067bb2a4.zip
opensim-SC_OLD-9af05d0bc3253376cecb7cf6586c53e8067bb2a4.tar.gz
opensim-SC_OLD-9af05d0bc3253376cecb7cf6586c53e8067bb2a4.tar.bz2
opensim-SC_OLD-9af05d0bc3253376cecb7cf6586c53e8067bb2a4.tar.xz
* refactor: break out inter grid inventory services further
* more to follow
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs43
-rw-r--r--OpenSim/Framework/Communications/IInterGridInventoryServices.cs7
-rw-r--r--OpenSim/Framework/Communications/IInventoryServices.cs5
-rw-r--r--OpenSim/Framework/Communications/ISecureInventoryService.cs18
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs2
-rw-r--r--OpenSim/Region/Communications/Local/CommunicationsLocal.cs3
-rw-r--r--OpenSim/Region/Communications/Local/LocalLoginService.cs8
-rw-r--r--OpenSim/Region/Communications/Local/LocalUserServices.cs8
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs2
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1SecureInvenotryService.cs2
10 files changed, 49 insertions, 49 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index 80dfa2c..6272872 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -36,68 +36,77 @@ using OpenSim.Framework.Servers;
36 36
37namespace OpenSim.Framework.Communications 37namespace OpenSim.Framework.Communications
38{ 38{
39 /// <summary>
40 /// This class manages references to OpenSim non-region services (asset, inventory, user, etc.)
41 /// </summary>
39 public class CommunicationsManager 42 public class CommunicationsManager
40 { 43 {
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 45
43 protected IUserService m_userService;
44 protected Dictionary<LLUUID, string[]> m_nameRequestCache = new Dictionary<LLUUID, string[]>(); 46 protected Dictionary<LLUUID, string[]> m_nameRequestCache = new Dictionary<LLUUID, string[]>();
45 47
46 public IUserService UserService 48 public IUserService UserService
47 { 49 {
48 get { return m_userService; } 50 get { return m_userService; }
49 } 51 }
50 52 protected IUserService m_userService;
51 protected IGridServices m_gridService;
52 53
53 public IGridServices GridService 54 public IGridServices GridService
54 { 55 {
55 get { return m_gridService; } 56 get { return m_gridService; }
56 } 57 }
57 58 protected IGridServices m_gridService;
58 59
59 protected IInterRegionCommunications m_interRegion;
60
61 public IInterRegionCommunications InterRegion 60 public IInterRegionCommunications InterRegion
62 { 61 {
63 get { return m_interRegion; } 62 get { return m_interRegion; }
64 } 63 }
65 64 protected IInterRegionCommunications m_interRegion;
66 protected UserProfileCacheService m_userProfileCacheService;
67 65
68 public UserProfileCacheService UserProfileCacheService 66 public UserProfileCacheService UserProfileCacheService
69 { 67 {
70 get { return m_userProfileCacheService; } 68 get { return m_userProfileCacheService; }
71 } 69 }
70 protected UserProfileCacheService m_userProfileCacheService;
72 71
73 // protected AgentAssetTransactionsManager m_transactionsManager; 72 // protected AgentAssetTransactionsManager m_transactionsManager;
74 73
75 // public AgentAssetTransactionsManager TransactionsManager 74 // public AgentAssetTransactionsManager TransactionsManager
76 // { 75 // {
77 // get { return m_transactionsManager; } 76 // get { return m_transactionsManager; }
78 // } 77 // }
79
80 protected IAvatarService m_avatarService;
81 78
82 public IAvatarService AvatarService 79 public IAvatarService AvatarService
83 { 80 {
84 get { return m_avatarService; } 81 get { return m_avatarService; }
85 } 82 }
86 83 protected IAvatarService m_avatarService;
87 protected AssetCache m_assetCache;
88 84
89 public AssetCache AssetCache 85 public AssetCache AssetCache
90 { 86 {
91 get { return m_assetCache; } 87 get { return m_assetCache; }
92 } 88 }
93 89 protected AssetCache m_assetCache;
94 protected NetworkServersInfo m_networkServersInfo; 90
91 public IInterGridInventoryServices InterGridInventoryService
92 {
93 get { return m_interGridInventoryService; }
94 }
95 protected IInterGridInventoryServices m_interGridInventoryService;
95 96
96 public NetworkServersInfo NetworkServersInfo 97 public NetworkServersInfo NetworkServersInfo
97 { 98 {
98 get { return m_networkServersInfo; } 99 get { return m_networkServersInfo; }
99 } 100 }
101 protected NetworkServersInfo m_networkServersInfo;
100 102
103 /// <summary>
104 /// Constructor
105 /// </summary>
106 /// <param name="serversInfo"></param>
107 /// <param name="httpServer"></param>
108 /// <param name="assetCache"></param>
109 /// <param name="dumpAssetsToFile"></param>
101 public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, 110 public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache,
102 bool dumpAssetsToFile) 111 bool dumpAssetsToFile)
103 { 112 {
diff --git a/OpenSim/Framework/Communications/IInterGridInventoryServices.cs b/OpenSim/Framework/Communications/IInterGridInventoryServices.cs
index 1ef1452..e820c5e 100644
--- a/OpenSim/Framework/Communications/IInterGridInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInterGridInventoryServices.cs
@@ -34,12 +34,7 @@ namespace OpenSim.Framework.Communications
34 /// Inventory operations used between grid services. 34 /// Inventory operations used between grid services.
35 /// </summary> 35 /// </summary>
36 public interface IInterGridInventoryServices 36 public interface IInterGridInventoryServices
37 { 37 {
38 string Host
39 {
40 get;
41 }
42
43 /// <summary> 38 /// <summary>
44 /// Create a new inventory for the given user. 39 /// Create a new inventory for the given user.
45 /// </summary> 40 /// </summary>
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index 18e1a2d..bb16a49 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -42,6 +42,11 @@ namespace OpenSim.Framework.Communications
42 /// </summary> 42 /// </summary>
43 public interface IInventoryServices : IInterGridInventoryServices 43 public interface IInventoryServices : IInterGridInventoryServices
44 { 44 {
45 string Host
46 {
47 get;
48 }
49
45 /// <summary> 50 /// <summary>
46 /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the 51 /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
47 /// inventory has been received 52 /// inventory has been received
diff --git a/OpenSim/Framework/Communications/ISecureInventoryService.cs b/OpenSim/Framework/Communications/ISecureInventoryService.cs
index 0e7861a..1da3115 100644
--- a/OpenSim/Framework/Communications/ISecureInventoryService.cs
+++ b/OpenSim/Framework/Communications/ISecureInventoryService.cs
@@ -31,7 +31,6 @@ using OpenSim.Framework.Communications.Cache;
31 31
32namespace OpenSim.Framework.Communications 32namespace OpenSim.Framework.Communications
33{ 33{
34
35 /// <summary> 34 /// <summary>
36 /// Defines all the operations one can perform on a user's inventory. 35 /// Defines all the operations one can perform on a user's inventory.
37 /// </summary> 36 /// </summary>
@@ -41,6 +40,7 @@ namespace OpenSim.Framework.Communications
41 { 40 {
42 get; 41 get;
43 } 42 }
43
44 /// <summary> 44 /// <summary>
45 /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the 45 /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
46 /// inventory has been received 46 /// inventory has been received
@@ -105,21 +105,11 @@ namespace OpenSim.Framework.Communications
105 /// <returns>true if the inventory was successfully created, false otherwise</returns> 105 /// <returns>true if the inventory was successfully created, false otherwise</returns>
106 bool CreateNewUserInventory(LLUUID user); 106 bool CreateNewUserInventory(LLUUID user);
107 107
108 bool HasInventoryForUser(LLUUID userID);
109
110 /// <summary> 108 /// <summary>
111 /// Retrieve the root inventory folder for the given user. 109 /// Does the given user have an inventory structure?
112 /// </summary> 110 /// </summary>
113 /// <param name="userID"></param> 111 /// <param name="userID"></param>
114 /// <returns>null if no root folder was found</returns> 112 /// <returns></returns>
115 InventoryFolderBase RequestRootFolder(LLUUID userID); 113 bool HasInventoryForUser(LLUUID userID);
116
117 /// <summary>
118 /// Returns a list of all the folders in a given user's inventory.
119 /// </summary>
120 /// <param name="userId"></param>
121 /// <returns>A flat list of the user's inventory folder tree,
122 /// null if there is no inventory for this user</returns>
123 List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId);
124 } 114 }
125} 115}
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index d26a3bb..fd2e6b1 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Framework.Communications
38 /// <summary> 38 /// <summary>
39 /// Abstract base class used by local and grid implementations of an inventory service. 39 /// Abstract base class used by local and grid implementations of an inventory service.
40 /// </summary> 40 /// </summary>
41 public abstract class InventoryServiceBase : IInventoryServices 41 public abstract class InventoryServiceBase : IInventoryServices, IInterGridInventoryServices
42 { 42 {
43 private static readonly ILog m_log 43 private static readonly ILog m_log
44 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
index 5fd5524..3bc3f9a 100644
--- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
+++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
@@ -44,8 +44,9 @@ namespace OpenSim.Region.Communications.Local
44 IGridServices gridService, bool dumpAssetsToFile) 44 IGridServices gridService, bool dumpAssetsToFile)
45 : base(serversInfo, httpServer, assetCache, dumpAssetsToFile) 45 : base(serversInfo, httpServer, assetCache, dumpAssetsToFile)
46 { 46 {
47 AddInventoryService( inventoryService); 47 AddInventoryService(inventoryService);
48 m_defaultInventoryHost = inventoryService.Host; 48 m_defaultInventoryHost = inventoryService.Host;
49 m_interGridInventoryService = inventoryService;
49 m_userService = userService; 50 m_userService = userService;
50 m_avatarService = (IAvatarService)userService; 51 m_avatarService = (IAvatarService)userService;
51 m_gridService = gridService; 52 m_gridService = gridService;
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index 30a639a..98672c2 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Communications.Local
85 profile = m_userManager.GetUserProfile(firstname, lastname); 85 profile = m_userManager.GetUserProfile(firstname, lastname);
86 if (profile != null) 86 if (profile != null)
87 { 87 {
88 m_Parent.InventoryService.CreateNewUserInventory(profile.ID); 88 m_Parent.InterGridInventoryService.CreateNewUserInventory(profile.ID);
89 } 89 }
90 90
91 return profile; 91 return profile;
@@ -260,13 +260,13 @@ namespace OpenSim.Region.Communications.Local
260 // See LoginService 260 // See LoginService
261 protected override InventoryData GetInventorySkeleton(LLUUID userID, string serverUrl) 261 protected override InventoryData GetInventorySkeleton(LLUUID userID, string serverUrl)
262 { 262 {
263 List<InventoryFolderBase> folders = m_Parent.InventoryService.GetInventorySkeleton(userID); 263 List<InventoryFolderBase> folders = m_Parent.InterGridInventoryService.GetInventorySkeleton(userID);
264 264
265 // If we have user auth but no inventory folders for some reason, create a new set of folders. 265 // If we have user auth but no inventory folders for some reason, create a new set of folders.
266 if (null == folders || 0 == folders.Count) 266 if (null == folders || 0 == folders.Count)
267 { 267 {
268 m_Parent.InventoryService.CreateNewUserInventory(userID); 268 m_Parent.InterGridInventoryService.CreateNewUserInventory(userID);
269 folders = m_Parent.InventoryService.GetInventorySkeleton(userID); 269 folders = m_Parent.InterGridInventoryService.GetInventorySkeleton(userID);
270 } 270 }
271 271
272 LLUUID rootID = LLUUID.Zero; 272 LLUUID rootID = LLUUID.Zero;
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index 798dd24..76791f1 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -37,7 +37,7 @@ namespace OpenSim.Region.Communications.Local
37 // private readonly NetworkServersInfo m_serversInfo; 37 // private readonly NetworkServersInfo m_serversInfo;
38 private readonly uint m_defaultHomeX; 38 private readonly uint m_defaultHomeX;
39 private readonly uint m_defaultHomeY; 39 private readonly uint m_defaultHomeY;
40 private IInventoryServices m_inventoryService; 40 private IInterGridInventoryServices m_interGridInventoryService;
41 41
42 /// <summary> 42 /// <summary>
43 /// 43 ///
@@ -48,14 +48,14 @@ namespace OpenSim.Region.Communications.Local
48 /// <param name="inventoryService"></param> 48 /// <param name="inventoryService"></param>
49 /// <param name="statsCollector">Can be null if stats collection is not required.</param> 49 /// <param name="statsCollector">Can be null if stats collection is not required.</param>
50 public LocalUserServices(NetworkServersInfo serversInfo, uint defaultHomeLocX, uint defaultHomeLocY, 50 public LocalUserServices(NetworkServersInfo serversInfo, uint defaultHomeLocX, uint defaultHomeLocY,
51 IInventoryServices inventoryService) 51 IInterGridInventoryServices interGridInventoryService)
52 { 52 {
53 // m_serversInfo = serversInfo; 53 // m_serversInfo = serversInfo;
54 54
55 m_defaultHomeX = defaultHomeLocX; 55 m_defaultHomeX = defaultHomeLocX;
56 m_defaultHomeY = defaultHomeLocY; 56 m_defaultHomeY = defaultHomeLocY;
57 57
58 m_inventoryService = inventoryService; 58 m_interGridInventoryService = interGridInventoryService;
59 } 59 }
60 60
61 public override UserProfileData SetupMasterUser(string firstName, string lastName) 61 public override UserProfileData SetupMasterUser(string firstName, string lastName)
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Communications.Local
82 } 82 }
83 else 83 else
84 { 84 {
85 m_inventoryService.CreateNewUserInventory(profile.ID); 85 m_interGridInventoryService.CreateNewUserInventory(profile.ID);
86 } 86 }
87 87
88 return profile; 88 return profile;
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 05ecfcc..b86d9ea 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -39,7 +39,7 @@ using OpenSim.Framework.Statistics;
39 39
40namespace OpenSim.Region.Communications.OGS1 40namespace OpenSim.Region.Communications.OGS1
41{ 41{
42 public class OGS1InventoryService : IInventoryServices 42 public class OGS1InventoryService : IInventoryServices, IInterGridInventoryServices
43 { 43 {
44 private static readonly ILog m_log 44 private static readonly ILog m_log
45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
diff --git a/OpenSim/Region/Communications/OGS1/OGS1SecureInvenotryService.cs b/OpenSim/Region/Communications/OGS1/OGS1SecureInvenotryService.cs
index 61c4e06..fbfc680 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1SecureInvenotryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1SecureInvenotryService.cs
@@ -39,7 +39,7 @@ using OpenSim.Framework.Statistics;
39 39
40namespace OpenSim.Region.Communications.OGS1 40namespace OpenSim.Region.Communications.OGS1
41{ 41{
42 public class OGS1SecureInventoryService : ISecureInventoryService 42 public class OGS1SecureInventoryService : ISecureInventoryService, IInterGridInventoryServices
43 { 43 {
44 private static readonly ILog m_log 44 private static readonly ILog m_log
45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);