Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber
Class OperationSetGeolocationJabberImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.OperationSetGeolocationJabberImpl
All Implemented Interfaces:
OperationSet, OperationSetGeolocation

public class OperationSetGeolocationJabberImpl
extends Object
implements OperationSetGeolocation

The Jabber implementation of an OperationSetGeolocation done with the XEP-0080: User Geolocation. This class broadcast our own geolocation and manage the geolocation status of our buddies. Currently, we send geolocation message in presence. We passively listen to buddies geolocation when their presence are updated.

Author:
Guillaume Schreiner

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.protocol.OperationSetGeolocation
ALT, AREA, BEARING, BUILDING, COUNTRY, DATUM, DESCRIPTION, ERROR, FLOOR, LAT, LOCALITY, LON, POSTALCODE, REGION, ROOM, STREET, TEXT, TIMESTAMP
 
Constructor Summary
OperationSetGeolocationJabberImpl(ProtocolProviderServiceJabberImpl provider)
          Constuctor
 
Method Summary
 void addGeolocationListener(GeolocationListener listener)
          Registers a listener that would get notifications any time a contact refreshed its geolocation via Presence.
 void publishGeolocation(Map<String,String> geolocation)
          Broadcast our current Geolocation trough this provider using a Jabber presence message.
 Map<String,String> queryContactGeolocation(String contactIdentifier)
          Retrieve the geolocation of the given contact.
 void removeGeolocationListener(GeolocationListener listener)
          Remove a listener that would get notifications any time a contact refreshed its geolocation via Presence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationSetGeolocationJabberImpl

public OperationSetGeolocationJabberImpl(ProtocolProviderServiceJabberImpl provider)
Constuctor

Parameters:
provider - ProtocolProviderServiceJabberImpl
Method Detail

publishGeolocation

public void publishGeolocation(Map<String,String> geolocation)
Broadcast our current Geolocation trough this provider using a Jabber presence message.

Specified by:
publishGeolocation in interface OperationSetGeolocation
Parameters:
geolocation - our current Geolocation ready to be sent

queryContactGeolocation

public Map<String,String> queryContactGeolocation(String contactIdentifier)
Retrieve the geolocation of the given contact.

Note: Currently not implemented because we can not actively poll the server for the presence of a given contact ?

Specified by:
queryContactGeolocation in interface OperationSetGeolocation
Parameters:
contactIdentifier - the Contact we want to retrieve its geolocation by its identifier.
Returns:
the Geolocation of the contact.

addGeolocationListener

public void addGeolocationListener(GeolocationListener listener)
Registers a listener that would get notifications any time a contact refreshed its geolocation via Presence.

Specified by:
addGeolocationListener in interface OperationSetGeolocation
Parameters:
listener - the ContactGeolocationPresenceListener to register

removeGeolocationListener

public void removeGeolocationListener(GeolocationListener listener)
Remove a listener that would get notifications any time a contact refreshed its geolocation via Presence.

Specified by:
removeGeolocationListener in interface OperationSetGeolocation
Parameters:
listener - the ContactGeolocationPresenceListener to register

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.