All Classes Functions Variables Typedefs Friends Pages
Static Public Member Functions | List of all members
Glympse::GlympseFactory Class Reference

The GlympseFactory class provides factory methods for instantiating major Glympse API primitives and Glympse platform itself. More...

#include <GlympseFactory.h>

Static Public Member Functions

static GApiStatus createApiStatus (const GString &server)
 Creates an API status object that can be used to query the Glympse API availability. More...
 
static GGlympse createGlympse (const GString &server, const GString &apiKey)
 
static GGlympse createGlympse (const GString &server, const GString &apiKey, const GString &prefix)
 Prefix allows to instantiate multiple instances of Glympse platform within the same applocation bundle. More...
 
static GInvite createInvite (int32 type, const GString &name, const GString &address)
 Constructs invite object based on type, name and address of the recipient. More...
 
static GInvite createInvite (int32 type, const GString &subtype, const GString &name, const GString &address)
 Creates invite by specifying both type and subtype. More...
 
static GInvite createPublicInvite (const GString &name)
 Creates an invite to be sent to public group. More...
 
static GTicket createTicket (int64 duration, const GString &message, const GPlace &destination)
 Creates new ticket object, which is intended to be sent. More...
 
static GTicket createRequest (const GTicket &requestTicket, const GInvite &invite)
 Submits a request invite to the server with the given desired request ticket. More...
 
static GPlace createPlace (double latitude, double longitude, const GString &name)
 Creates place object.
 
static GAddress createAddress (const GString &line1, const GString &line2, const GString &city, const GString &state, const GString &zip, const GString &country)
 Creates new address object. More...
 
static GImage createImage (const GDrawable &drawable)
 Creates image object.
 
static GPrimitive createFacebookAccountProfile (const GString &token)
 Creates a Facebook account profile with the specified token. More...
 
static GPrimitive createTwitterAccountProfile (const GString &consumerKey, const GString &consumerSecret, const GString &oauthToken, const GString &oauthTokenSecret)
 Creates a Twitter account profile with the specified parameters. More...
 
static GPrimitive createEvernoteAccountProfile (const GString &token)
 Creates an Evernote account profile with the specified token. More...
 
static GPrimitive createGoogleAccountProfile (const GString &token)
 Creates a Google+ account profile with the specified token. More...
 
static GPrimitive createGoogleServerAuthorizationProfile (const GString &code)
 Creates a Google+ server authorization profile with the specified server authorization code. More...
 
static GPrimitive createPairingCodeProfile ()
 Creates a pairing code profile. More...
 
static GPrimitive createPhoneAccountProfile (const GString &phone)
 Creates phone account profile. More...
 
static GPrimitive createEmailAccountProfile (const GString &email)
 Creates email account profile. More...
 
static GTrackBuilder createTrackBuilder ()
 Creates an object intended to populate ITrack with location data. More...
 
static GGeoTrigger createGeoTrigger (const GString &name, bool autoSend, const GTicket &ticket, const GLatLng &center, double radius, int32 transition)
 Creates Geo trigger object. More...
 
static GChronoTrigger createChronoTrigger (const GString &name, bool autoSend, const GTicket &ticket, int64 fireTime)
 Creates Chrono trigger object. More...
 
static GEtaTrigger createEtaTrigger (const GString &name, bool autoSend, const GTicket &ticket, int64 threshold, int32 transition, const GTicket &etaTicket)
 Creates ETA trigger object. More...
 
static GArrivalTrigger createArrivalTrigger (const GString &name, bool autoSend, const GTicket &ticket, const GTicket &monitoredTicket, const GPrimitive &config)
 Creates Arrival trigger object. More...
 
static GDepartureTrigger createDepartureTrigger (const GString &name, bool autoSend, const GTicket &ticket, const GPlace &location, const GPrimitive &config)
 Creates Departure trigger object. More...
 
static GCard createCard (const GString &cardTypeId, const GString &name)
 Creates an empty card object.
 
static GCardObjectPoi createCardObjectPoi (const GPoi &poi)
 Creates a card object that wraps a POI.
 
static GCardObjectInvite createCardObjectInvite (const GString &inviteCode)
 Creates a card object that wraps a Invite Code.
 
static GCardTicketBuilder createCardTicketBuilder (int32 aspect)
 Creates an card ticket builder.
 
static GCardInvite createCardInvite (const GInvite &invite)
 Creates an card invite.
 
static GPoiBuilder createPoiBuilder ()
 Creates an object intended for building IPoi objects. More...
 
static GPoiBuilder createPoiBuilder (const GPoi &source)
 Creates an object intended for building a new POI based off of existing POI. More...
 

Detailed Description

The GlympseFactory class provides factory methods for instantiating major Glympse API primitives and Glympse platform itself.

Member Function Documentation

static GAddress Glympse::GlympseFactory::createAddress ( const GString line1,
const GString line2,
const GString city,
const GString state,
const GString zip,
const GString country 
)
static

Creates new address object.

Parameters
line1The first line of the street address.
line2The second line of the street address.
cityThe city in which this address is located.
stateThe state in which this address is located.
zipThe zip code of this address.
countryThe country in which the address is located.
Returns
Address object.
static GApiStatus Glympse::GlympseFactory::createApiStatus ( const GString server)
static

Creates an API status object that can be used to query the Glympse API availability.

Parameters
serverBase server URL.
static GArrivalTrigger Glympse::GlympseFactory::createArrivalTrigger ( const GString name,
bool  autoSend,
const GTicket ticket,
const GTicket monitoredTicket,
const GPrimitive config 
)
static

Creates Arrival trigger object.

This trigger fires when a the configured arrival provider detects that the user has arrived at the destination

Returns
GArrivalTrigger object.
static GChronoTrigger Glympse::GlympseFactory::createChronoTrigger ( const GString name,
bool  autoSend,
const GTicket ticket,
int64  fireTime 
)
static

Creates Chrono trigger object.

This trigger fires at a given point in time. Time is value is in reference to Glympse time (GGlympse::getTime())

Returns
Chrono trigger object.
static GDepartureTrigger Glympse::GlympseFactory::createDepartureTrigger ( const GString name,
bool  autoSend,
const GTicket ticket,
const GPlace location,
const GPrimitive config 
)
static

Creates Departure trigger object.

This trigger fires when a the configured sdk detects that the user has departed a given location

Returns
GDepartureTrigger object.
static GPrimitive Glympse::GlympseFactory::createEmailAccountProfile ( const GString email)
static

Creates email account profile.

Parameters
phoneEmail address to be confirmed.
Returns
Email account profile.
static GEtaTrigger Glympse::GlympseFactory::createEtaTrigger ( const GString name,
bool  autoSend,
const GTicket ticket,
int64  threshold,
int32  transition,
const GTicket etaTicket 
)
static

Creates ETA trigger object.

This trigger fires when a ticket's ETA drops below or rises above a given value

Returns
ETA trigger object.
static GPrimitive Glympse::GlympseFactory::createEvernoteAccountProfile ( const GString token)
static

Creates an Evernote account profile with the specified token.

Parameters
tokenThe Evernote access token.
Returns
An Evernote account profile.
static GPrimitive Glympse::GlympseFactory::createFacebookAccountProfile ( const GString token)
static

Creates a Facebook account profile with the specified token.

Parameters
tokenThe Facebook access token.
Returns
A Facebook account profile.
static GGeoTrigger Glympse::GlympseFactory::createGeoTrigger ( const GString name,
bool  autoSend,
const GTicket ticket,
const GLatLng center,
double  radius,
int32  transition 
)
static

Creates Geo trigger object.

Returns
Geo trigger object.
static GGlympse Glympse::GlympseFactory::createGlympse ( const GString server,
const GString apiKey 
)
static
Parameters
serverBase server URL.
apiKeyPartner specific API key.
static GGlympse Glympse::GlympseFactory::createGlympse ( const GString server,
const GString apiKey,
const GString prefix 
)
static

Prefix allows to instantiate multiple instances of Glympse platform within the same applocation bundle.

Prefix is required to serialize configuration and credentials of each Glympse insatnce separately.

Prefix is not serialized locally. It should be specified each time, when paltform is instantiated. Moreover, the same prefix value should be used during each next run.

Parameters
serverBase server URL.
apiKeyPartner specific API key.
prefixFile system friendly unique instance identifier.
static GPrimitive Glympse::GlympseFactory::createGoogleAccountProfile ( const GString token)
static

Creates a Google+ account profile with the specified token.

Note
Logging in or linking with this type of Google+ account profile will, if successful, properly result in associating the identity of the user on the third-party service with a Glympse user account. However, because it does not authorize the Glympse server to refresh the provided access token for subsequent use, this will result in the Google+ linked account immediately and permanently being marked as GC::LINKED_ACCOUNT_STATUS_REFRESH_NEEDED.
Parameters
tokenThe Google+ access token.
Returns
A Google+ account profile.
static GPrimitive Glympse::GlympseFactory::createGoogleServerAuthorizationProfile ( const GString code)
static

Creates a Google+ server authorization profile with the specified server authorization code.

Note
Logging in or linking with this type of Google+ account profile will, if successful, properly result in associating the identity of the user on the third-party service with a Glympse user account. Furthermore, because it authorizes the Glympse server to act on behalf of the user in the background and grants the server the ability to extend the lifetime of access tokens, the Google+ linked account will remain in the GC::LINKED_ACCOUNT_STATUS_OK state unless the user manually revokes access. However, in order to perform this authorization, both the client application and the Glympse server must be "siblings" belonging to the same Google developer console project. Generally speaking, therefore, logging in or linking with this type of Google+ account profile will perpetually fail except for approved and properly configured Glympse partners.
Parameters
codeThe Google+ server authorization code.
Returns
A Google+ server authorization profile.
static GInvite Glympse::GlympseFactory::createInvite ( int32  type,
const GString name,
const GString address 
)
static

Constructs invite object based on type, name and address of the recipient.

Type is intended to identify delivery mechanism and pick appropriate side to schedule invite delivery (client or server). Invite name should provide human-readable invite information (like person name). Address should uniquely identify recipient within type namespace (examples: phone number, email, etc).

It is required to specify invite type explicitly in the following cases:

  • GC::INVITE_TYPE_ACCOUNT
  • GC::INVITE_TYPE_TWITTER
  • GC::INVITE_TYPE_FACEBOOK
  • GC::INVITE_TYPE_LINK
  • GC::INVITE_TYPE_SHARE
  • GC::INVITE_TYPE_CLIPBOARD
  • GC::INVITE_TYPE_EVERNOTE
  • GC::INVITE_TYPE_GROUP (when raw group name is specified or invite is sent to a private group).

It is only possible to pass GC::INVITE_TYPE_UNKNOWN, if address field contains

  • phone number,
  • email address or
  • public group name (with leading '!' or '#'). In this case invite type will be determined by the library.

Group invite is marked visible automatically, if address starts with '#'.

Each invite type has specific requirements for name and address arguments.

  • GC::INVITE_TYPE_ACCOUNT
    • name (optional): Recipient Glympse nickname
    • address (required): Glympse user id
  • GC::INVITE_TYPE_EMAIL
    • name (optional): Recipient name
    • address (required): Email address
  • GC::INVITE_TYPE_SMS
    • name (optional): Recipient name
    • address (required): Phone number
  • GC::INVITE_TYPE_TWITTER
    • name (optional): Twitter name of signed in user with leading @
    • address (optional): Twitter user id or Twitter name with leading @
  • GC::INVITE_TYPE_FACEBOOK
    • name (optional): Facebook name of signed in user
    • address (optional): Facebook user id
  • GC::INVITE_TYPE_LINK
    • name (optional): Application specific invite display name
    • address (optional): Application specific invite address
  • GC::INVITE_TYPE_GROUP
    • name (optional): Application specific invite display name
    • address (required): Glympse private group id, or Glympse public group name
  • GC::INVITE_TYPE_SHARE
    • name (optional): Name of application
    • address (required): Signature of application
  • GC::INVITE_TYPE_CLIPBOARD
    • name : none
    • address : none
  • GC::INVITE_TYPE_EVERNOTE
    • name : none
    • address : none
Returns
Invite object or NULL, if invite cannot be constructed.
static GInvite Glympse::GlympseFactory::createInvite ( int32  type,
const GString subtype,
const GString name,
const GString address 
)
static

Creates invite by specifying both type and subtype.

This override should be used for creating invites of type GC::INVITE_TYPE_APP for which subtype must be specified and identifies receiving application.

Returns
Invite object or NULL, if invite cannot be constructed.
static GPrimitive Glympse::GlympseFactory::createPairingCodeProfile ( )
static

Creates a pairing code profile.

Note
Logging in with this type of profile will, if successful provide a pairing code which must be passed to another logged in device. Account login will be completed once the other device enters the pairing code.
static GPrimitive Glympse::GlympseFactory::createPhoneAccountProfile ( const GString phone)
static

Creates phone account profile.

Parameters
phonePhone number to be confirmed.
Returns
Phone account profile.
static GPoiBuilder Glympse::GlympseFactory::createPoiBuilder ( )
static

Creates an object intended for building IPoi objects.

Returns
PoiBuilder object.
static GPoiBuilder Glympse::GlympseFactory::createPoiBuilder ( const GPoi source)
static

Creates an object intended for building a new POI based off of existing POI.

Parameters
sourceThe source POI from which to draw initial values.
Returns
PoiBuilder object.
static GInvite Glympse::GlympseFactory::createPublicInvite ( const GString name)
static

Creates an invite to be sent to public group.

Constructs invite of GC::INVITE_TYPE_GROUP type. Provided for convenience.

Group invite is marked visible automatically, if address starts with '#'.

Parameters
namePublic group name.
Returns
Invite object or NULL, if invite cannot be constructed.
static GTicket Glympse::GlympseFactory::createRequest ( const GTicket requestTicket,
const GInvite invite 
)
static

Submits a request invite to the server with the given desired request ticket.

Parameters
requestTicketSample ticket that the request receiver will use to fill in ticket details.
inviteInvite information to be used in creating the invite.
Returns
ticket sink which can be used to subscribe to invte created events.
static GTicket Glympse::GlympseFactory::createTicket ( int64  duration,
const GString message,
const GPlace destination 
)
static

Creates new ticket object, which is intended to be sent.

Parameters
durationTicket duration in milliseconds.
messageTicket message (optional).
destinationTicket destination (optional).
Returns
Returns ticket object, which is ready to be sent.
static GTrackBuilder Glympse::GlympseFactory::createTrackBuilder ( )
static

Creates an object intended to populate ITrack with location data.

Returns
Track builder object.
static GPrimitive Glympse::GlympseFactory::createTwitterAccountProfile ( const GString consumerKey,
const GString consumerSecret,
const GString oauthToken,
const GString oauthTokenSecret 
)
static

Creates a Twitter account profile with the specified parameters.

Parameters
consumerKeyThe Twitter consumer key associated with the application.
consumerSecretThe Twitter consumer secret associated with the application.
oauthTokenThe Twitter oAuth token.
oauthTokenSecretThe Twitter oAuth token secret.
Returns
A Twitter account profile.

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