public final class GeoLocationManager
extends org.jivesoftware.smack.Manager
publishGeoLocation(GeoLocation) method. This will publish the node.
stopPublishingGeolocation() method. This will send a disble publishing signal.
PepEventListener in order to remain updated with other users GeoLocation, use addGeoLocationListener(PepEventListener) method.
Message, use `message.addExtension(geoLocation)`.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
GEOLOCATION_NODE |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addGeoLocationListener(PepEventListener<GeoLocation> listener) |
static GeoLocationManager |
getInstanceFor(org.jivesoftware.smack.XMPPConnection connection)
Retrieves a
GeoLocationManager for the specified XMPPConnection, creating one if it doesn't
already exist. |
static boolean |
isGeoLocationMessage(org.jivesoftware.smack.packet.Message message)
Returns true if the message contains a GeoLocation extension.
|
void |
publishGeoLocation(GeoLocation geoLocation)
Publish the user's geographic location through the Personal Eventing Protocol (PEP).
|
boolean |
removeGeoLocationListener(PepEventListener<GeoLocation> listener) |
void |
sendGeoLocationToJid(GeoLocation geoLocation,
org.jxmpp.jid.Jid jid) |
void |
stopPublishingGeolocation()
Send empty geolocation through the PubSub node.
|
public static final java.lang.String GEOLOCATION_NODE
public static GeoLocationManager getInstanceFor(org.jivesoftware.smack.XMPPConnection connection)
GeoLocationManager for the specified XMPPConnection, creating one if it doesn't
already exist.connection - The connection the manager is attached to.public void sendGeoLocationToJid(GeoLocation geoLocation, org.jxmpp.jid.Jid jid) throws java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedExceptionorg.jivesoftware.smack.SmackException.NotConnectedExceptionpublic static boolean isGeoLocationMessage(org.jivesoftware.smack.packet.Message message)
message - the message to check if contains a GeoLocation extension or notpublic void publishGeoLocation(GeoLocation geoLocation) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, PubSubException.NotALeafNodeException
geoLocation - the geographic location to publish.java.lang.InterruptedException - if the calling thread was interrupted.org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.org.jivesoftware.smack.XMPPException.XMPPErrorException - if there was an XMPP error returned.org.jivesoftware.smack.SmackException.NoResponseException - if there was no response from the remote entity.PubSubException.NotALeafNodeException - if a PubSub leaf node operation was attempted on a non-leaf node.public void stopPublishingGeolocation()
throws org.jivesoftware.smack.SmackException.NoResponseException,
org.jivesoftware.smack.XMPPException.XMPPErrorException,
org.jivesoftware.smack.SmackException.NotConnectedException,
java.lang.InterruptedException,
PubSubException.NotALeafNodeException
java.lang.InterruptedException - if the calling thread was interrupted.org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.org.jivesoftware.smack.XMPPException.XMPPErrorException - if there was an XMPP error returned.org.jivesoftware.smack.SmackException.NoResponseException - if there was no response from the remote entity.PubSubException.NotALeafNodeException - if a PubSub leaf node operation was attempted on a non-leaf node.public boolean addGeoLocationListener(PepEventListener<GeoLocation> listener)
public boolean removeGeoLocationListener(PepEventListener<GeoLocation> listener)