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

Contains a collection of outgoing (sent) Ticket objects ("Glympse history"). More...

#include <IHistoryManager.h>

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

Public Member Functions

General

Tools for accessing underlying collection of tickets.

virtual bool isSynced ()=0
 Determines whether local list has already been synced with server. More...
 
virtual GArray< GTicket >::ptr getTickets ()=0
 Returns the sent ticket list collection ("Glympse history") as an array of ITicket objects. More...
 
virtual bool anyActive ()=0
 Determines whether there are any active tickets on the list. More...
 
virtual bool anyActive (bool siblings)=0
 Determines whether there are any active tickets on the list, optionally allowing sibling tickets to be considered. More...
 
virtual bool anyActive (bool siblings, bool visible)=0
 Determines whether there are any active tickets on the list, optionally allowing sibling tickets and hidden tickets to be considered. More...
 
virtual void refresh ()=0
 Forcibly pulls updates on last view time and view count for all outgoing tickets (including expired). More...
 
virtual void simulateAddedEvents (const GEventListener &listener)=0
 This helper method walks through the colleciton of outgoing tickets and sends GE::PLATFORM_TICKET_ADDED event to listener object for all active tickets found on the list. More...
 
virtual bool canSend (const GInvite &invite)=0
 Determines whether invite can be sent by the platform instance. More...
 
Configuration

Tools for adjusting manager's behavior.

virtual void enablePreSyncEvents (bool enable)=0
 Provides host application with an ability to minimize performance overhead caused by numerous events fired during startup and initialization. More...
 
virtual bool arePreSyncEventsEnabled ()=0
 Checks if events can be fired before platform is fully synchronized with server.
 
virtual void enableCancellationTimer (bool enable)=0
 Controls the behavior of automatic ticket cancellation. More...
 
virtual bool isCancellationTimerEnabled ()=0
 Determines whether ticket cancellation is enabled. More...
 
virtual void setCancellationTimeout (int32 timeout)=0
 Sets ticket cancellation timeout. More...
 
virtual int32 getCancellationTimeout ()=0
 Gets ticket cancellation timeout. More...
 
virtual void setExpirationMode (int32 mode)=0
 Ticket expiration mode defines the way platform determines its state (sharing vs. More...
 
virtual int32 getExpirationMode ()=0
 Gets currently applied ticket expiration mode. More...
 
virtual void setXoAListener (const GXoAListener &listener)=0
 Sets callback listener to enable per-ticket control of XoA logic. More...
 
virtual void triggerXoAUpdate ()=0
 Triggers XoAManager to requery Ticket XoA status for each ticket it is listening to, through its IXoAListener. More...
 
Properties

Methods for accessing the most commonly used properties of the manager.

virtual int64 getLastViewTime ()=0
 Gets the time of when any of outgoing tickets was last viewed. More...
 
virtual bool isSomeoneWatching ()=0
 
Lookup Tools

Set of convenience helpers for finding tickets.

virtual GTicket findTicketByTicketId (const GString &ticketId)=0
 Gets the ITicket object that matches the given ticket ID. More...
 
virtual GTicket findTicketByInviteCode (const GString &code)=0
 Gets the ITicket object that matches the given ticket 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

Contains a collection of outgoing (sent) Ticket objects ("Glympse history").

The sent ticket list contains all of the tickets you have created and sent. This includes tickets that are still active as well as one that have expired.

The list of outgoing tickets is always restored from server upon successful authentication and is never cached locally to provide the most reliable and consisten behavior.

See Also
ITicket

Member Function Documentation

virtual bool Glympse::IHistoryManager::anyActive ( )
pure virtual

Determines whether there are any active tickets on the list.

Note
Only visible tickets owned by this device are considered.
Returns
true if there are any active, visible outgoing tickets owned by this device.
virtual bool Glympse::IHistoryManager::anyActive ( bool  siblings)
pure virtual

Determines whether there are any active tickets on the list, optionally allowing sibling tickets to be considered.

Note
Only visible tickets are considered.
Parameters
siblingsIndicates whether sibling tickets should be considered.
Returns
true if there are any active, visible outgoing tickets that match the sibling condition.
virtual bool Glympse::IHistoryManager::anyActive ( bool  siblings,
bool  visible 
)
pure virtual

Determines whether there are any active tickets on the list, optionally allowing sibling tickets and hidden tickets to be considered.

Parameters
siblingsIndicates whether sibling tickets should be considered.
visibleIndicates whether tickets must be visible to be considered.
Returns
true if there are any active outgoing tickets that match the sibling and visibility conditions.
virtual bool Glympse::IHistoryManager::canSend ( const GInvite invite)
pure virtual

Determines whether invite can be sent by the platform instance.

Platform checks invite type, host OS and installed 3rd party applications into account when preparing the result.

The method does not perform any kind of address validation. It only checks hypotetical possibility of sending the invite using any of client or server side delivery mechanisms.

Parameters
inviteInvite object to be analyzed.
Returns
true if platform is capable of sending the invite.
virtual void Glympse::IHistoryManager::enableCancellationTimer ( bool  enable)
pure virtual

Controls the behavior of automatic ticket cancellation.

Ticket cancellation is a mechanism that if enabled prevents platform from retrying ticket creation forever when device loses network connectivity.

Ticket cancellation is disabled by default.

Parameters
enablePass true to enable the timer.
virtual void Glympse::IHistoryManager::enablePreSyncEvents ( bool  enable)
pure virtual

Provides host application with an ability to minimize performance overhead caused by numerous events fired during startup and initialization.

The delivery of the following events is controlled by this method.

  • GE::PLATFORM_TICKET_ADDED
  • GE::PLATFORM_TICKET_REMOVED
  • GE::PLATFORM_TICKET_CHANGED
  • GE::PLATFORM_TICKET_LIST_REORDERED

If this feature is disabled, none of the events above will be fired until GE::PLATFORM_SYNCED_WITH_SERVER is fired.

Pre sync events are enabled by default. The method is supposed to be called synchronously after platform startup in order to make affect.

Parameters
enableTells whether pre sync events should be enabled or not.
virtual GTicket Glympse::IHistoryManager::findTicketByInviteCode ( const GString code)
pure virtual

Gets the ITicket object that matches the given ticket invite code.

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

Gets the ITicket object that matches the given ticket ID.

Parameters
ticketIdTicket ID of the ticket you would like to find.
Returns
The ITicket object that matches the given ticket ID, or NULL if the ticket ID was not found.
virtual int32 Glympse::IHistoryManager::getCancellationTimeout ( )
pure virtual

Gets ticket cancellation timeout.

Returns
Ticket cancellation timeout in milliseconds.
virtual int32 Glympse::IHistoryManager::getExpirationMode ( )
pure virtual

Gets currently applied ticket expiration mode.

Returns
The ticket expiration mode, which will be one of the GC::EXPIRATION_MODE constants.
virtual int64 Glympse::IHistoryManager::getLastViewTime ( )
pure virtual

Gets the time of when any of outgoing tickets was last viewed.

Invite creation is also considered as view.

Returns
The most recent moment in the past, when one of tickets was viewed.
virtual GArray<GTicket>::ptr Glympse::IHistoryManager::getTickets ( )
pure virtual

Returns the sent ticket list collection ("Glympse history") as an array of ITicket objects.

The sent ticket list contains all the ticket you have created and sent. This includes tickets that are still active as well as one that have expired.

This list will initially be empty. Once the Glympse API has communicated with the server, the list will be populated to include the complete list of tickets you have sent.

To be notified when the list is first populated, you can register a IEventListener and capture the GE::PLATFORM_SYNCED_WITH_SERVER event.

Returns
An array of sent tickets in the Glympse system.
See Also
ITicket
IEventListener
GlympseEvents::PLATFORM_SYNCED_WITH_SERVER
virtual bool Glympse::IHistoryManager::isCancellationTimerEnabled ( )
pure virtual

Determines whether ticket cancellation is enabled.

Returns
true if ticket cancellation is enabled.
virtual bool Glympse::IHistoryManager::isSomeoneWatching ( )
pure virtual
Returns
Returns true, if any of active tickets is currently being watched.
virtual bool Glympse::IHistoryManager::isSynced ( )
pure virtual

Determines whether local list has already been synced with server.

It might be useful to differenciate "empty history" case from "not yet synched" case. Platform sends GE::PLATFORM_SYNCED_WITH_SERVER event, when this list is synced with server.

Returns
Returns true, if local list has already been synced with server.
virtual void Glympse::IHistoryManager::refresh ( )
pure virtual

Forcibly pulls updates on last view time and view count for all outgoing tickets (including expired).

The method is mostly intended to refresh stats of expired tickets. Client API pulls updates for active tickets automatically. Client api will also prevent redundant requests to server, so it is not required to check for active tickets before making this call.

virtual void Glympse::IHistoryManager::setCancellationTimeout ( int32  timeout)
pure virtual

Sets ticket cancellation timeout.

Platform uses this value to determine when to stop ticket creation attemps, if device is experiencing continuous network outage.

Parameters
timeoutAmount of time in milliseconds during which platform will try to create a ticket.
virtual void Glympse::IHistoryManager::setExpirationMode ( int32  mode)
pure virtual

Ticket expiration mode defines the way platform determines its state (sharing vs.

not sharing). Major differences between currently supported modes are focused on synchronizing platform state with the server. Depending on applied mode platform can exclusively rely on properties which are synchronized with server (GC::EXPIRATION_MODE_SYNCHRONIZED - default) or take into accounts local modifications that are not synchronized yet (GC::EXPIRATION_MODE_DETACHED).

The method has to be called before platform completes original synchronization with server (see isSynced()).

Parameters
modeTicket expiration mode to be applied.
virtual void Glympse::IHistoryManager::setXoAListener ( const GXoAListener listener)
pure virtual

Sets callback listener to enable per-ticket control of XoA logic.

Parameters
listenerAn implementation of IXoAListener
virtual void Glympse::IHistoryManager::simulateAddedEvents ( const GEventListener listener)
pure virtual

This helper method walks through the colleciton of outgoing tickets and sends GE::PLATFORM_TICKET_ADDED event to listener object for all active tickets found on the list.

Note
The method does nothing if events preceeding synchronization are enabled (see enablePreSyncEvents() for details).
Parameters
listsnerEvent listener tht is to be notified on requested events.
virtual void Glympse::IHistoryManager::triggerXoAUpdate ( )
pure virtual

Triggers XoAManager to requery Ticket XoA status for each ticket it is listening to, through its IXoAListener.

If no XoAListener has been set, this is call is ignored.


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