C++ API Library Reference  4.3.2-74-ge1d4cca
Public Functions | List of all members
ResourceManager Class Referenceabstract

The ResourceManager class provides methods for publishing and managing resources (binary objects) that are addressable by path. The data, which is stored on the service machine, can be anything that the service can copy as a byte array. This feature is commonly used in collaborative sessions, when multiple users are connected to the same PureWeb session. ResourceManager is primarily intended to facilitate the transfer of service-side data to the client. Data storage and retrieval is based on the unique identifier (GUID) key, which the store function automatically assigns to each resource.

Public Functions

virtual void Clear ()
 
virtual bool Contains (Guid key)
 
virtual int GetCount ()
 
virtual Collections::List< ResponseInfo > GetNextResponses (Guid sessionId)=0
 
virtual void Initialize (StateManager *pStateManager)=0
 
virtual bool Remove (Guid key)
 
virtual ContentInfo const & Retrieve (Guid key)
 
virtual void SessionConnected (Guid sessionId, Typeless const &command)=0
 
virtual void SessionDisconnected (Guid sessionId, Typeless const &command)=0
 
virtual Guid Store (ContentInfo const &resource)
 
virtual void Store (Guid key, ContentInfo const &resource)
 
virtual bool TryRetrieve (Guid key, ContentInfo &content)
 
virtual void Uninitialize ()=0
 
Constructors and Destructors
 ResourceManager ()
 
 ~ResourceManager ()
 

Usage Description

void Clear ( )
virtual

Clears all stored resources.

Implements IResourceManager.

bool Contains ( Guid  key)
virtual

Indicates whether an item with the specifed key already exists. Returns true if it does, or false otherwise.

Implements IResourceManager.

int GetCount ( )
virtual

Returns the count of items currently stored in the ResourceManager.

Implements IResourceManager.

virtual Collections::List<ResponseInfo> GetNextResponses ( Guid  sessionId)
pure virtualinherited

Gets the next responses for the specified session.

Parameters
sessionIDThe session's unique identifer.
virtual void Initialize ( StateManager pStateManager)
pure virtualinherited

Initializes the plugin with the specified StateManager.

Parameters
stateManagerThe StateManager.

Implemented in ViewManager.

bool Remove ( Guid  key)
virtual

Attempts to remove the specified key. If the key exists, will return true and remove the resource. Otherwise, returns false.

Implements IResourceManager.

ContentInfo const & Retrieve ( Guid  key)
virtual

Retrieves the resource currently stored at the specified key. If there are no resource at that key, will return an empty ContentInfo object.

Implements IResourceManager.

virtual void SessionConnected ( Guid  sessionId,
Typeless const &  command 
)
pure virtualinherited

Indicates that the specified session is connected.

Parameters
sessionIdThe session's unique identifier.
commandThe command that was received causing the session to connect.
virtual void SessionDisconnected ( Guid  sessionId,
Typeless const &  command 
)
pure virtualinherited

Indicates that the specified session is disconnected.

Parameters
sessionIdThe session's unique identifier.
commandThe command that was received causing the session to disconnect.
Guid Store ( ContentInfo const &  resource)
virtual

Adds the specified resource, returning a key that can be used later to retrieve it. Before you can use this method, the resource must have already been saved as a ContentInfo object.

You can use this function to save the same data in several different formats. This would be useful, for instance, to handle operating system differences. Consider for example the case of a collaborative text editing application. Let's say that you need to save a Windows-targeted .docx file, and a .pages file for iOS-based clients. You would call the store method twice, once for each format, and this way each format of the file would be assigned its own GUID key.

Implements IResourceManager.

void Store ( Guid  key,
ContentInfo const &  resource 
)
virtual

Stores the specified resource using the specified key. Any existing resource at that key will be replaced.

Parameters
keyThe key.
resourceThe resource.

Implements IResourceManager.

bool TryRetrieve ( Guid  key,
ContentInfo content 
)
virtual

Attempts to retrieve the specified resource. If the resource exists, will return true and retrieve the resource. Otherwise, returns false.

Implements IResourceManager.

virtual void Uninitialize ( )
pure virtualinherited

Uninitializes the plugin.

Implemented in ViewManager.