From 205b95f2e8b1f94379068c01c46777d7188fc2e5 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Fri, 11 Apr 2008 16:49:20 +0000
Subject: * minor documenting, cleanup, renaming in user profile cache service
---
.../Communications/Cache/CachedUserInfo.cs | 28 ++++++++++++++++------
.../Cache/UserProfileCacheService.cs | 13 ++++++----
2 files changed, 29 insertions(+), 12 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index 6e07e7c..9ece581 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -32,16 +32,24 @@ using libsecondlife;
namespace OpenSim.Framework.Communications.Cache
{
+ ///
+ /// Stores user profile and inventory data received from backend services for a particular user.
+ ///
public class CachedUserInfo
{
private static readonly log4net.ILog m_log
= log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
- private readonly CommunicationsManager m_parentCommsManager;
+ ///
+ /// The comms manager holds references to services (user, grid, inventory, etc.)
+ ///
+ private readonly CommunicationsManager m_commsManager;
+ private UserProfileData m_userProfile;
+ public UserProfileData UserProfile { get { return m_userProfile; } }
+
// FIXME: These need to be hidden behind accessors
public InventoryFolderImpl RootFolder = null;
- public UserProfileData UserProfile = null;
///
/// Stores received folders for which we have not yet received the parents.
@@ -49,9 +57,15 @@ namespace OpenSim.Framework.Communications.Cache
private IDictionary> pendingCategorizationFolders
= new Dictionary>();
- public CachedUserInfo(CommunicationsManager commsManager)
+ ///
+ /// Constructor
+ ///
+ ///
+ ///
+ public CachedUserInfo(CommunicationsManager commsManager, UserProfileData userProfile)
{
- m_parentCommsManager = commsManager;
+ m_commsManager = commsManager;
+ m_userProfile = userProfile;
}
///
@@ -197,7 +211,7 @@ namespace OpenSim.Framework.Communications.Cache
if ((userID == UserProfile.ID) && (RootFolder != null))
{
ItemReceive(userID, itemInfo);
- m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo);
+ m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo);
}
}
@@ -205,7 +219,7 @@ namespace OpenSim.Framework.Communications.Cache
{
if ((userID == UserProfile.ID) && (RootFolder != null))
{
- m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo);
+ m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo);
}
}
@@ -217,7 +231,7 @@ namespace OpenSim.Framework.Communications.Cache
result = RootFolder.DeleteItem(item.ID);
if (result)
{
- m_parentCommsManager.InventoryService.DeleteInventoryItem(userID, item);
+ m_commsManager.InventoryService.DeleteInventoryItem(userID, item);
}
}
return result;
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index 7178d2c..586c24e 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -35,12 +35,15 @@ using OpenSim.Framework.Console;
namespace OpenSim.Framework.Communications.Cache
{
+ ///
+ /// Holds user profile information and retrieves it from backend services.
+ ///
public class UserProfileCacheService
{
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
///
- /// The comms manager holds the reference to this service
+ /// The comms manager holds references to services (user, grid, inventory, etc.)
///
private readonly CommunicationsManager m_commsManager;
@@ -68,12 +71,12 @@ namespace OpenSim.Framework.Communications.Cache
{
if (!m_userProfiles.ContainsKey(userID))
{
- CachedUserInfo userInfo = new CachedUserInfo(m_commsManager);
- userInfo.UserProfile = m_commsManager.UserService.GetUserProfile(userID);
+ UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(userID);
+ CachedUserInfo userInfo = new CachedUserInfo(m_commsManager, userProfile);
if (userInfo.UserProfile != null)
{
- // The inventory will be populated when the user actually enters the scene
+ // The inventory for the user will be populated when they actually enter the scene
m_userProfiles.Add(userID, userInfo);
}
else
@@ -85,7 +88,7 @@ namespace OpenSim.Framework.Communications.Cache
}
///
- /// Request the inventory data for the given user. This will occur asynchronous if running on a grid
+ /// Request the inventory data for the given user. This will occur asynchronously if running on a grid
///
///
///
--
cgit v1.1