OpenSim::Framework::Communications::Cache::CachedUserInfo Class Reference

Stores user profile and inventory data received from backend services for a particular user. More...

List of all members.

Public Member Functions

 CachedUserInfo (CommunicationsManager commsManager, UserProfileData userProfile)
 Constructor.
void DropInventory ()
 Drop all cached inventory.
void InventoryReceive (ICollection< InventoryFolderImpl > folders, ICollection< InventoryItemBase > items)
 Callback invoked when the inventory is received from an async request to the inventory service.
bool CreateFolder (string folderName, UUID folderID, ushort folderType, UUID parentID)
 Create a folder in this agent's inventory.
bool UpdateFolder (string name, UUID folderID, ushort type, UUID parentID)
 Handle a client request to update the inventory folder.
bool MoveFolder (UUID folderID, UUID parentID)
 Handle an inventory folder move request from the client.
bool PurgeFolder (UUID folderID)
 This method will delete all the items and folders in the given folder.
void AddItem (InventoryItemBase item)
 Add an item to the user's inventory.
void UpdateItem (InventoryItemBase item)
 Update an item in the user's inventory.
bool DeleteItem (UUID itemID)
 Delete an item from the user's inventory.
bool SendInventoryDecendents (IClientAPI client, UUID folderID, bool fetchFolders, bool fetchItems)
 Send details of the inventory items and/or folders in a given folder to the client.
InventoryFolderImpl FindFolderForType (int type)
 Find an appropriate folder for the given asset type.

Public Attributes

event OnItemReceivedDelegate OnItemReceived

Protected Member Functions

void AddRequest (IInventoryRequest request)
 This allows a request to be added to be processed once we receive a user's inventory from the inventory service. If we already have the inventory, the request is executed immediately instead.

Properties

UserProfileData UserProfile [get]
bool HasReceivedInventory [get]
 Have we received the user's inventory from the inventory service?
InventoryFolderImpl RootFolder [get]
 The root folder of this user's inventory. Returns null if the root folder has not yet been received.
UUID SessionID [get, set]


Detailed Description

Stores user profile and inventory data received from backend services for a particular user.


Constructor & Destructor Documentation

OpenSim::Framework::Communications::Cache::CachedUserInfo::CachedUserInfo ( CommunicationsManager  commsManager,
UserProfileData  userProfile 
) [inline]

Constructor.

Parameters:
commsManager 
userProfile 


Member Function Documentation

void OpenSim::Framework::Communications::Cache::CachedUserInfo::AddRequest ( IInventoryRequest  request  )  [inline, protected]

This allows a request to be added to be processed once we receive a user's inventory from the inventory service. If we already have the inventory, the request is executed immediately instead.

Parameters:
parent 

void OpenSim::Framework::Communications::Cache::CachedUserInfo::DropInventory (  )  [inline]

Drop all cached inventory.

void OpenSim::Framework::Communications::Cache::CachedUserInfo::InventoryReceive ( ICollection< InventoryFolderImpl folders,
ICollection< InventoryItemBase items 
) [inline]

Callback invoked when the inventory is received from an async request to the inventory service.

Parameters:
userID 
inventoryCollection 

bool OpenSim::Framework::Communications::Cache::CachedUserInfo::CreateFolder ( string  folderName,
UUID  folderID,
ushort  folderType,
UUID  parentID 
) [inline]

Create a folder in this agent's inventory.

If the inventory service has not yet delievered the inventory for this user then the request will be queued.

Parameters:
parentID 
Returns:

bool OpenSim::Framework::Communications::Cache::CachedUserInfo::UpdateFolder ( string  name,
UUID  folderID,
ushort  type,
UUID  parentID 
) [inline]

Handle a client request to update the inventory folder.

If the inventory service has not yet delievered the inventory for this user then the request will be queued.

FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE so this will work to rename an existing folder. Needless to say, to rely on this is very confusing, and needs to be changed.

Parameters:
folderID 
type 
name 
parentID 

bool OpenSim::Framework::Communications::Cache::CachedUserInfo::MoveFolder ( UUID  folderID,
UUID  parentID 
) [inline]

Handle an inventory folder move request from the client.

If the inventory service has not yet delievered the inventory for this user then the request will be queued.

Parameters:
folderID 
parentID 
Returns:
true if the delete was successful, or if it was queued pending folder receipt false if the folder to be deleted did not exist.

bool OpenSim::Framework::Communications::Cache::CachedUserInfo::PurgeFolder ( UUID  folderID  )  [inline]

This method will delete all the items and folders in the given folder.

If the inventory service has not yet delievered the inventory for this user then the request will be queued.

Parameters:
folderID 

void OpenSim::Framework::Communications::Cache::CachedUserInfo::AddItem ( InventoryItemBase  item  )  [inline]

Add an item to the user's inventory.

If the item has no folder set (i.e. it is UUID.Zero), then it is placed in the most appropriate folder for that type.

Parameters:
itemInfo 

void OpenSim::Framework::Communications::Cache::CachedUserInfo::UpdateItem ( InventoryItemBase  item  )  [inline]

Update an item in the user's inventory.

Parameters:
userID 
itemInfo 

bool OpenSim::Framework::Communications::Cache::CachedUserInfo::DeleteItem ( UUID  itemID  )  [inline]

Delete an item from the user's inventory.

If the inventory service has not yet delievered the inventory for this user then the request will be queued.

Parameters:
itemID 
Returns:
true on a successful delete or a if the request is queued. Returns false on an immediate failure

bool OpenSim::Framework::Communications::Cache::CachedUserInfo::SendInventoryDecendents ( IClientAPI  client,
UUID  folderID,
bool  fetchFolders,
bool  fetchItems 
) [inline]

Send details of the inventory items and/or folders in a given folder to the client.

Parameters:
client 
folderID 
fetchFolders 
fetchItems 
Returns:
true if the request was queued or successfully processed, false otherwise

InventoryFolderImpl OpenSim::Framework::Communications::Cache::CachedUserInfo::FindFolderForType ( int  type  )  [inline]

Find an appropriate folder for the given asset type.

Parameters:
type 
Returns:
null if no appropriate folder exists


Member Data Documentation

event OnItemReceivedDelegate OpenSim::Framework::Communications::Cache::CachedUserInfo::OnItemReceived


Property Documentation

UserProfileData OpenSim::Framework::Communications::Cache::CachedUserInfo::UserProfile [get]

bool OpenSim::Framework::Communications::Cache::CachedUserInfo::HasReceivedInventory [get]

Have we received the user's inventory from the inventory service?

InventoryFolderImpl OpenSim::Framework::Communications::Cache::CachedUserInfo::RootFolder [get]

The root folder of this user's inventory. Returns null if the root folder has not yet been received.

UUID OpenSim::Framework::Communications::Cache::CachedUserInfo::SessionID [get, set]


The documentation for this class was generated from the following file:
Generated on Fri Jan 9 01:00:46 2009 for OpenSim by  doxygen 1.5.1