All Classes Functions Variables Typedefs Friends Pages
List of all members
Glympse::IUserManager Struct Referenceabstract

Operates with users, whos tickets are currently watched. More...

#include <IUserManager.h>

Inheritance diagram for Glympse::IUserManager:
Inheritance graph
[legend]

Public Member Functions

General

Overall user management.

virtual GUser getSelf ()=0
 Provides a shortcut to self user.
 
virtual GTrack getSelfTrack ()=0
 Provides a shortcut to self track.
 
virtual GArray< GUser >::ptr getUsers ()=0
 Returns the list of all users currently registered on the system.
 
virtual void enableSorting (bool enable)=0
 Controls whether uber collection of users (returned by getUsers()) is sorted.
 
Standalone Users Manipulation

The section provides access to standalone users.

virtual bool anyActive ()=0
 
virtual GArray< GUser >::ptr getStandaloneUsers ()=0
 Returns the list of all standalone users.
 
virtual void enablePersistence (bool enable)=0
 Specifies whether the list of standalone users should be persisted across application sessions. More...
 
virtual void setUserTrackingMode (int32 mode)=0
 Dictates the way platform handles multiple tickets received from a user being tracked. More...
 
virtual int32 getUserTrackingMode ()=0
 Gets currently set tracking mode.
 
virtual int32 startTracking (const GUser &user)=0
 Start pulling updates for the user (its active standalone tickets) on regular basis. More...
 
virtual int32 stopTracking (const GUser &user)=0
 Stop pulling updates for the user. More...
 
virtual int32 getNumTrackers (const GUser &user)=0
 Returns a number of application components that are currently tracking the user. More...
 
virtual GEnumeration< GUser >::ptr getTracking ()=0
 Returns the subset of standalone users, whos information is pulled from server on regular basis.
 
virtual void startTrackingAll ()=0
 Start pulling updates for all active standalone tickets currently registered on the system. More...
 
virtual void stopTrackingAll (bool forced)=0
 This method is provided for convenience. More...
 
virtual bool anyActiveTracked ()=0
 
Lookup Tools

Set of convenience helpers for finding users and tickets on the system.

virtual GUser findOrCreateUserByUserId (const GString &userId)=0
 Find user by user ID or creates new user and registers it on the list. More...
 
virtual GUser findUserByUserId (const GString &userId)=0
 Gets the user object that matches the given user ID. More...
 
virtual GUser findUserByInviteCode (const GString &code)=0
 Gets the user object that matches the given invite code. More...
 
virtual GTicket findTicketByInviteCode (const GString &code)=0
 Gets the ticket object that matches the given invite code. More...
 
- Public Member Functions inherited from Glympse::ICommon
virtual int32 retain ()=0
 Add a reference to our object in a COM-like way.
 
virtual int32 release ()=0
 Release a reference to our object in a COM-like way.
 
virtual int32 hold ()=0
 Add a reference to our object in a COM-like way.
 
virtual int32 unhold ()=0
 Release a reference to our object in a COM-like way.
 
virtual int32 hashCode ()=0
 Returns an integer hash code for this object.
 
virtual bool equals (const GCommonObj &o)=0
 Compares this instance with the specified object and indicates if they are equal. More...
 
virtual GString toString ()=0
 Returns a string containing a concise, human-readable description of this object. More...
 
virtual void attachObject (const GCommon &obj)=0
 Asociates arbitrary object with the instance.
 
virtual GCommon extractObject ()=0
 Extracts associated object or NULL if no association is established.
 

Additional Inherited Members

- Protected Member Functions inherited from Glympse::ICommon
virtual ~ICommon ()
 Destructor is protected to deny explicit object deallocation. More...
 

Detailed Description

Operates with users, whos tickets are currently watched.

Two major types of users can be defined:

Standalone users have tickets that does not belong to any group (imported by means of http://glympse.com/XXX-XXX URLs). It is possible that user has tickets of both types (belonging to group and not). Standalone users (returned by getStandaloneUsers()) are always a subset of regular users (returned by getUsers()).

Member Function Documentation

virtual bool Glympse::IUserManager::anyActive ( )
pure virtual
Returns
true, if there are any standalone users.
virtual bool Glympse::IUserManager::anyActiveTracked ( )
pure virtual
Returns
true, if there are any active standalone users being tracked.
virtual void Glympse::IUserManager::enablePersistence ( bool  enable)
pure virtual

Specifies whether the list of standalone users should be persisted across application sessions.

Note
Disabling this will wipe local on-disk DB, but will not touch object model. All currnetly watched users will remain registered on the system till library the restart.

The list of standalone users is persisted locally by default.

virtual GUser Glympse::IUserManager::findOrCreateUserByUserId ( const GString userId)
pure virtual

Find user by user ID or creates new user and registers it on the list.

Parameters
userIdGlympse user identifier.
Returns
User object found on the list or newly created user.
virtual GTicket Glympse::IUserManager::findTicketByInviteCode ( const GString code)
pure virtual

Gets the ticket object that matches the given invite code.

Parameters
codeInvite code of the ticket you would like to find.
Returns
The ticket object that matches the given invite code, or NULL if the ticket was not found.
virtual GUser Glympse::IUserManager::findUserByInviteCode ( const GString code)
pure virtual

Gets the user object that matches the given invite code.

User object is not associated with any invite codes directly. The lookup is made against tickets received from a user.

Parameters
codeInvite code of the ticket you would like to find.
Returns
The user object that contains the ticket with such invite code, or NULL if the ticket was not found.
virtual GUser Glympse::IUserManager::findUserByUserId ( const GString userId)
pure virtual

Gets the user object that matches the given user ID.

Parameters
userIdUser ID of the user you would like to find.
Returns
The user object that matches the given ID, or NULL if the user was not found.
virtual int32 Glympse::IUserManager::getNumTrackers ( const GUser user)
pure virtual

Returns a number of application components that are currently tracking the user.

Each of such components called startTracking(GUser) or startTrackingAll(), but has not called stopTracking(GUser) or stopTrackingAll() yet. In other words returned value says how many times stopTracking(GUser) needs to be called in order to stop pulling updates for this user.

Parameters
userStandalone user object that is potentially being tracked.
Returns
One of the following values is returned:
  • Positive integer value indicates how many components of host application are still tracking the user.
  • -1 means that the user is not tracked at the moment.
virtual void Glympse::IUserManager::setUserTrackingMode ( int32  mode)
pure virtual

Dictates the way platform handles multiple tickets received from a user being tracked.

Platform operates in GC::USER_TRACKING_MODE_ACTIVE mode by default.

Parameters
modeThe mode that needs to be set.
See Also
GC::USER_TRACKING_MODE_*
virtual int32 Glympse::IUserManager::startTracking ( const GUser user)
pure virtual

Start pulling updates for the user (its active standalone tickets) on regular basis.

The logic behind startTracking()/stopTracking() is back ended by reference conuter (not a boolean flag), which allows multiple components of the same application to start and stop tracking independently.

Returns
A number of components currently tracking the user (including the one that has just made the call).
virtual void Glympse::IUserManager::startTrackingAll ( )
pure virtual

Start pulling updates for all active standalone tickets currently registered on the system.

This method is provided for convenience. Under the covers it invokes startTracking(GUser) for each standalone user.

virtual int32 Glympse::IUserManager::stopTracking ( const GUser user)
pure virtual

Stop pulling updates for the user.

This actually decrements a counter associated with particular user. Platform stops pulling updates, when the counter goes down to 0.

Returns
A number of components that are still tracking the user (excluding the one that has just made the call). One of the following values can also be returned:
  • 0 means that user manager was tracking the user before this method was invoked, and now the user is not tracked anymore.
  • -1 means that user was not tracked even before the method was invoked.
virtual void Glympse::IUserManager::stopTrackingAll ( bool  forced)
pure virtual

This method is provided for convenience.

Under the covers it invokes stopTracking(GUser) for each user whos updates are currently pulled from server on regular basis.

Parameters
forcedAllows to stop all pulling updates forcibly (no matter how many times startTracking(GUser) was previously called).

The documentation for this struct was generated from the following file: