This class represents an actual received "Glympse" or sent "Glympse". More...
#include <ITicket.h>

Public Member Functions | |
| virtual GString | getId ()=0 |
| Gets the internal ticket identifier of this ticket. More... | |
| virtual bool | isWatching ()=0 |
| Indicates whether the ticket object refers to incoming or outgoing ticket. More... | |
| virtual bool | isMine ()=0 |
| Indicates whether ticket is controlled by this device (application or process). More... | |
| virtual bool | isSibling ()=0 |
| The method returns opposite value to what isMine() returns. More... | |
| virtual GPrimitive | getVisibility ()=0 |
| Returns the visibility of the ticket. More... | |
| virtual bool | isVisible ()=0 |
| Determines the visibility of the ticket. More... | |
| virtual GString | getCode ()=0 |
| Gets ticket code of the incoming Glympse. More... | |
| virtual GString | getReference ()=0 |
| Gets the reference code of the ticket. More... | |
| virtual int32 | getState ()=0 |
| Gets ticket state. More... | |
| virtual GAppProfile | getOwner ()=0 |
| Gets the ticket owner. More... | |
| virtual GUser | getUser ()=0 |
| Gets the user to whom this ticket belongs. More... | |
| virtual bool | isActive ()=0 |
| This method takes into account ticket state (getState()) and ownership (isMine()). More... | |
| virtual bool | isCompleted ()=0 |
| Checks whether ticket is marked as completed. More... | |
| virtual GArray< GInvite >::ptr | getInvites ()=0 |
| Returns the recipient list collection for this ticket as an array of IInvite objects. More... | |
| virtual int64 | getDuration ()=0 |
| Gets the duration of the ticket. More... | |
| virtual int64 | getStartTime ()=0 |
| Gets the epoch time (milliseconds since 1/1/1970) that the ticket was created. More... | |
| virtual int64 | getExpireTime ()=0 |
| Gets the epoch time (milliseconds since 1/1/1970) that the ticket will expire. More... | |
| virtual GString | getMessage ()=0 |
| Gets the optional message text associated with this ticket. More... | |
| virtual GPlace | getDestination ()=0 |
| Gets the optional destination that is associated with this ticket. More... | |
| virtual GTrack | getTrack ()=0 |
| Returns the historical track points for this ticket. More... | |
| virtual void | updateEta (int64 eta)=0 |
| This method remembers ETA value and transmits it to all viewers. More... | |
| virtual int64 | getEta ()=0 |
| Gets ETA (Estimated Time of Arrival) for the user API is watching. More... | |
| virtual void | updateRoute (const GTrack &route)=0 |
| This method remembers new predicted route and transmits it to all viewers. More... | |
| virtual GTrack | getRoute ()=0 |
| Gets predicted route for the user API is watching. More... | |
| virtual GTravelMode | getTravelMode ()=0 |
| Gets travel mode. More... | |
| virtual GInvite | findInviteByCode (const GString &code)=0 |
| Gets the IInvite object that matches the given invite code. | |
| virtual GInvite | findInviteByAddress (const GString &address)=0 |
| Gets the IInvite object that matches the given address. | |
| virtual GInvite | findInviteByType (int32 type)=0 |
| Gets the IInvite object that matches the given type. | |
| virtual bool | canAddInvite (const GInvite &invite)=0 |
| Runs a check to determine whether invite like that can be added to the ticket. More... | |
| virtual bool | addInvite (const GInvite &invite)=0 |
| Adds invite to the ticket. More... | |
| virtual bool | deleteInvite (const GInvite &invite)=0 |
| Removes invite from the ticket and invalidates associated invite code. More... | |
| virtual bool | isSomeoneWatching ()=0 |
| Determines whether ticket is currently being watched. More... | |
| virtual void | setRequestEndTime (int64 endTime)=0 |
| Specifies end time for Glympse request. More... | |
| virtual GTicket | getRequestTicket ()=0 |
| Gets the request ticket if there is one. More... | |
| virtual void | setRequestNoReply (bool requestNoReply)=0 |
| For request tickets sets the no reply flag. More... | |
| virtual bool | getRequestNoReply ()=0 |
| For request tickets, gets the no reply flag. More... | |
| virtual void | setRequestScenario (const GString &requestScenario)=0 |
| For request tickets, sets the request scenario. More... | |
| virtual GString | getRequestScenario ()=0 |
| For request tickets, gets the request scenario if there is one. More... | |
| virtual bool | setVisibility (const GString &visibility, const GString &context)=0 |
| Sets the visibility of the ticket. More... | |
| virtual bool | modify (int64 remaining, const GString &message, const GPlace &destination)=0 |
| Modifies an active sent Glympse, allowing you to add recipients, change the duration, expire the ticket, change the message, and/or change the destination. More... | |
| virtual bool | extend (int64 interval)=0 |
| Extends ticket for the amount of time specified by the argument. More... | |
| virtual void | setName (const GString &name)=0 |
| Sets the name of the ticket as specified. More... | |
| virtual GString | getName ()=0 |
| Gets the name of the ticket. More... | |
| virtual bool | clear (bool message, bool destination)=0 |
| Clears message or destination property of the ticket. More... | |
| virtual bool | expire ()=0 |
| Expires currently active ticket. More... | |
| virtual bool | appendData (int64 partnerId, const GString &name, const GPrimitive &value)=0 |
| Provides a chance to append custom property to the ticket. More... | |
| virtual GPrimitive | getProperty (int64 partnerId, const GString &name)=0 |
| Gets property associated with the ticket object. More... | |
| virtual GDataRow | getPropertyData (int64 partnerId, const GString &name)=0 |
| Gets property GDataRow associated with the ticket object. More... | |
| virtual GEnumeration< GLong >::ptr | getPartnerIds ()=0 |
| Returns a enumeration of all partner ids that have appened properties to this ticket. More... | |
| virtual GMap< GString, GDataRow >::ptr | getPartnerData (int64 partnerId)=0 |
| Returns a readonly GMap of all properties associated with this partner id. More... | |
| virtual bool | own ()=0 |
| Requests for ownership over this ticket to be passed to this device. More... | |
| virtual void | setOwnership (const GString &providerId, const GPrimitive &providerData)=0 |
| Begins the process of handing off this single ticket to new owner service (Mojio, another invite code, etc.). More... | |
| virtual bool | deleteTicket ()=0 |
| Delete this sent ticket. More... | |
| virtual GTicket | clone ()=0 |
| Clones ticket object including the following properties: More... | |
Public Member Functions inherited from Glympse::IEventSink | |
| virtual bool | addListener (const GEventListener &eventListener)=0 |
| Registeres event listener on the sink. More... | |
| virtual bool | removeListener (const GEventListener &eventListener)=0 |
| Unsubscribes listener from events coming from this sink. | |
| virtual GArray< GEventListener > ::ptr | getListeners ()=0 |
| Provides access to the collection of current listeners. More... | |
| virtual bool | hasContext (int64 key)=0 |
| Checks, where user context identified by key is already associated with the object. | |
| virtual void | associateContext (int64 key, const GCommonObj &value)=0 |
| Associates specific context (user data) with the sink. More... | |
| virtual GCommonObj | getContext (int64 key)=0 |
| Returns context associated with the sink, or NULL, if it is not found. | |
| virtual void | clearContext (int64 key)=0 |
| Clears context identified by key argument. | |
| virtual GEnumeration< GLong >::ptr | getContextKeys ()=0 |
| Gets enumeration of all context keys associated with the sink. | |
| virtual void | deriveContext (const GEventSink &sink)=0 |
| Derives context from another sink object. | |
Public Member Functions inherited from Glympse::IEventListener | |
| virtual void | eventsOccurred (const GGlympse &glympse, int32 listener, int32 events, const GCommonObj &obj)=0 |
| This method is invoked each time, when sink object notifies subscriber on an event. 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. | |
Public Member Functions inherited from Glympse::IComparable | |
| virtual bool | isEqual (const GCommon &o)=0 |
| Compares this instance with the specified object and indicates if they are equal. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Glympse::ICommon | |
| virtual | ~ICommon () |
| Destructor is protected to deny explicit object deallocation. More... | |
This class represents an actual received "Glympse" or sent "Glympse".
The term "Ticket" is synonymous with the term "Glympse" when referring to the object that is created and sent to recipients in order to share your location. A ticket contains recipients, start and end times (and thus duration), a message, and a destination. A ticket can be received from another Glympse user, allowing us to watch that user. A ticket can also be sent to recipients, allowing them to watch the local user.
Tickets are created by Users. When you receive a ticket from another user, that ticket grants you access to view that user for a specific amount of time. Tickets that are received can be watched by calling the IGlympse::viewTicket method. Once the ticket has been verified by the Glympse server, you will begin watching the user that sent the ticket. If you are not already watching this user from a previous ticket, the Glympse system will create a new IUser object in your IUserManager collection. The IUser object contains a list of tickets you are watching for this user. The ticket you are watching will be added to this list. You can call the IUser::getTickets method for a list of all tickets you have received from a given user.
When sending a ticket to another user, you will first create a new ITicket and then call IGlympse::sendTicket to send the ticket to the recipients you have chosen. The sent ticket will be transfered to your IHistoryManager collection. You can monitor this ticket collection and the list of recipients within each ticket for viewer activity.
|
pure virtual |
Adds invite to the ticket.
This leads to creating invite code (on server side) and delivering it to the recipient using mechanism conditioned by invite type.
The method can be called both before and after ticket is sent. It is only possible to add invites to active self outgoing tickets.
|
pure virtual |
Provides a chance to append custom property to the ticket.
| partnerId | Partner specific identifier. This value defines namespace for all partner properties. Value of 0 belongs to standard Glympse properties (like nickname, message, etc.). So partner id of 0 (as well as negative values) are considered to be incorrect. You should use other tools from Client API to modify standard properties. |
| name | Custom property name. |
| value | Object that represents property value. |
|
pure virtual |
Runs a check to determine whether invite like that can be added to the ticket.
The method validates invite consistency and looks for identical invites that are already registered.
Invite type and other properties are taken into account during comparison. The following rules are applied:
| invite | Invite object to be tested. |
|
pure virtual |
Clears message or destination property of the ticket.
| message | Specify true, if you want to clear the message. |
| destination | Specify true, if you want to clear the destination. |
|
pure virtual |
Clones ticket object including the following properties:
This method should be used to produce copy of any of existing tickets and store it for later use (save as a favorite or send).
It is not possible to reuse ticket objects. It is required to create a copy of ticket object to be able to resent outgoing ticket or reply to incoming ticket.
Once ticket object is cloned it is out of sync with its clone. None of the changes made to any of those objects are reflected into another.
|
pure virtual |
Removes invite from the ticket and invalidates associated invite code.
Ticket information will no longer be accessible through this invite.
|
pure virtual |
Delete this sent ticket.
Once a ticket is successfully deleted from the Glympse server, it will be removed from your sent ticket list ("Glympse history") and will not be viewable by any recipients of that ticket.
|
pure virtual |
Expires currently active ticket.
Once expiration is scheduled ticket remains in GC::TICKET_STATE_EXPIRING until response is received from the server.
Both self and sibling tickets can be expired. The method takes affect only if ticket is fully constructed and initialized.
|
pure virtual |
Extends ticket for the amount of time specified by the argument.
| interval | Amount of time in milliseconds to extend the ticket for. |
|
pure virtual |
Gets ticket code of the incoming Glympse.
This method returns ticket invite code, which was used to add this ticket for watching. The method always returns NULL for outgoing tickets.
|
pure virtual |
Gets the optional destination that is associated with this ticket.
|
pure virtual |
Gets the duration of the ticket.
This is essentially the difference between the start time and the expire time of the ticket.
For outgoing tickets, which are not yet sent, it returns current ticket duration for the ticket.
|
pure virtual |
Gets ETA (Estimated Time of Arrival) for the user API is watching.
The method performs required calculations to provide caller with correct value.
The following approach is used to determine returned value:
As it is seen from the explanation above, the value returned by this method changes over time, even if no updates are coming from sender.
Note that GE::TICKET_ETA_CHANGED is sent only, when ETA changes significantly (new value is received from sender).
|
pure virtual |
Gets the epoch time (milliseconds since 1/1/1970) that the ticket will expire.
This is a Glympse server time. If you need to compare it to the current system time, you should use the IGlympse::getTime method to obtain an accurate system time.
|
pure virtual |
Gets the internal ticket identifier of this ticket.
Returns the recipient list collection for this ticket as an array of IInvite objects.
You can only query the recipients for tickets you created (tickets you retrieve from the IHistoryManager::getTickets method). If you call this on a ticket you are watching (tickets you retrieve from the IUser::getTickets method), this method will simply return an empty list. Recipient information is private to the user that created the ticket they belong to.
|
pure virtual |
Gets the optional message text associated with this ticket.
|
pure virtual |
Gets the name of the ticket.
Used mainly for favorites to describe them.
|
pure virtual |
Gets the ticket owner.
Changes to ownership are propagated using the GE::TICKET_TRANSFERRED event.
|
pure virtual |
Returns a readonly GMap of all properties associated with this partner id.
| partnerId | Partner identifier. |
|
pure virtual |
Returns a enumeration of all partner ids that have appened properties to this ticket.
|
pure virtual |
Gets property associated with the ticket object.
| partnerId | Partner identifier. |
| name | Property name. |
|
pure virtual |
Gets property GDataRow associated with the ticket object.
| partnerId | Partner identifier. |
| name | Property name. |
|
pure virtual |
Gets the reference code of the ticket.
Normally this would be the invite code of an invite request that created the ticket or of a ticket invite with an attached reply request used to create this ticket.
|
pure virtual |
For request tickets, gets the no reply flag.
|
pure virtual |
For request tickets, gets the request scenario if there is one.
|
pure virtual |
Gets the request ticket if there is one.
|
pure virtual |
Gets predicted route for the user API is watching.
|
pure virtual |
Gets the epoch time (milliseconds since 1/1/1970) that the ticket was created.
This is a Glympse server time. If you need to compare it to the current system time, you should use the IGlympse::getTime method to obtain an accurate system time.
|
pure virtual |
|
pure virtual |
Returns the historical track points for this ticket.
These locations are locations that have been successfully transmitted to the Glympse server for this user.
The Glympse server and Glympse API will trim this list of points to a manageable duration. Currently, the list will contain a max of 10 minutes worth of data.
|
pure virtual |
Gets travel mode.
Ticket listeners are notified on changes in this property using GE::TICKET_TRAVEL_MODE_CHANGED event.
|
pure virtual |
Gets the user to whom this ticket belongs.
|
pure virtual |
Returns the visibility of the ticket.
Visibility is comprised of a location visibility value (GC::TICKET_VISIBILITY_KEY_LOCATION()) and an optional visibility context (GC::TICKET_VISIBILITY_KEY_CONTEXT()).
|
pure virtual |
This method takes into account ticket state (getState()) and ownership (isMine()).
|
pure virtual |
Checks whether ticket is marked as completed.
Completed tickets (both incoming and outgoing) are immutable from the perspective of host application. They cannot change their state on their own and cannot be changed from outside.
Platform broadcasts GE::TICKET_COMPLETED event to ticket subscribers, when transition happens.
Host application should not expect any events from incoming ticket since it turns into completed state. It is still allowed to delete outgoing ticket (using ITicket::deleteTicket()) from the history even after its completion.
|
pure virtual |
Indicates whether ticket is controlled by this device (application or process).
Ticket ownership only makes sense for outgoing tickets.
|
pure virtual |
The method returns opposite value to what isMine() returns.
This overridden method is provided for convenience.
|
pure virtual |
Determines whether ticket is currently being watched.
The method only makes sense for outgoing tickets.
|
pure virtual |
Determines the visibility of the ticket.
This is a convenience method for quick visibility checking. To retrieve the full visibility, use getVisibility().
|
pure virtual |
Indicates whether the ticket object refers to incoming or outgoing ticket.
|
pure virtual |
Modifies an active sent Glympse, allowing you to add recipients, change the duration, expire the ticket, change the message, and/or change the destination.
The modify method allows you to change the duration of the ticket. The duration parameter specifies how much time from 'now' you want the ticket to last. Therefore, passing a value of 0 will instantly expire the ticket. If you do not wish to change the ticket duration, you can pass the constant GC::DURATION_NO_CHANGE to the modify() method.
To modify the message, simply pass in a new message string. To not modify the message, you should pass in NULL.
To modify the destination, simply pass in a new IPlace object for the destination. To not modify the destination, you should pass in NULL.
| remaining | The duration in milliseconds from 'now' until the time when the ticket should expire. Pass 0 to expire now. Pass DURATION_NO_CHANGE to not modify. |
| message | The new message text. Pass NULL to not modify. |
| destination | The new destination. Pass NULL to not modify. |
|
pure virtual |
Requests for ownership over this ticket to be passed to this device.
Ticket ownership is not passed instantly. Round trip to the server is required for this purpose. See GE::TICKET_TRANSFERRED for more details.
The operation only makes sense for active (!) outgoing (!) sibling (!) tickets.
|
pure virtual |
Sets the name of the ticket as specified.
Used mainly for describing a favorite.
| name | Name of the ticket. |
|
pure virtual |
Begins the process of handing off this single ticket to new owner service (Mojio, another invite code, etc.).
If this ticket has already been created on the server, it will be handed off right away. If not, it will be handed off after it has been created on the server.
| providerId | The ID string that identifies the desired new owner to the server. |
| providerData | The GPrimitive of OBJECT type that provides the data required for handoff to the server. |
|
pure virtual |
Specifies end time for Glympse request.
End time means that requester expects for requestee to share his/her location till this point in the future. This property is optional and is only used as a recommendation (or even ignored) at the receiving end.
The method does not make any affect, if called against incoming or outgoing ticket.
| endTime | UTC time in milliseconds. |
|
pure virtual |
For request tickets sets the no reply flag.
| requestNoReply | true if requests should be ignored. |
|
pure virtual |
For request tickets, sets the request scenario.
| requestScenario | Description of request scenario. |
|
pure virtual |
Sets the visibility of the ticket.
Visibility is comprised of a location visibility specification (either GC::TICKET_VISIBILITY_LOCATION_HIDDEN() or GC::TICKET_VISIBILITY_LOCATION_VISIBLE()) and and optional context.
| visibility | The location visibility (visible or hidden). |
| context | An optional context string. |
|
pure virtual |
This method remembers ETA value and transmits it to all viewers.
Make sure that platform operates in GC::ETA_MODE_EXTERNAL mode. Otherwise external updates will interfere with the values calculated internally.
| eta | New ETA value in milliseconds. Pass 0 to clear ETA. |
|
pure virtual |
This method remembers new predicted route and transmits it to all viewers.
Make sure that platform operates in GC::ETA_MODE_EXTERNAL mode. Otherwise external updates will interfere with the values calculated internally.
| route | New route to be applied. Pass NULL to clear currently applied route. |
1.8.4