|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.smackx.ping.PingManager
public class PingManager
Implements the XMPP Ping as defined by XEP-0199. The XMPP Ping protocol allows one entity to 'ping' any other entity by simply sending a ping to the appropriate JID.
NOTE: The KeepAliveManager
already provides a keepalive functionality
for regularly pinging the server to keep the underlying transport connection
alive. This class is specifically intended to do manual pings of other
entities.
Method Summary | |
---|---|
static PingManager |
getInstanceFor(Connection connection)
Retrieves a PingManager for the specified Connection , creating one if it doesn't already
exist. |
boolean |
isPingSupported(java.lang.String jid)
Query the specified entity to see if it supports the Ping protocol (XEP-0199) |
boolean |
ping(java.lang.String jid)
Same as calling ping(String, long) with the defaultpacket reply
timeout. |
boolean |
ping(java.lang.String jid,
long pingTimeout)
Pings the given jid. |
boolean |
pingMyServer()
Pings the server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static PingManager getInstanceFor(Connection connection)
PingManager
for the specified Connection
, creating one if it doesn't already
exist.
connection
- The connection the manager is attached to.
public boolean ping(java.lang.String jid, long pingTimeout)
Use isPingSupported(String)
to determine if XMPP Ping is supported
by the entity.
jid
- The id of the entity the ping is being sent topingTimeout
- The time to wait for a reply
public boolean ping(java.lang.String jid)
ping(String, long)
with the defaultpacket reply
timeout.
jid
- The id of the entity the ping is being sent to
public boolean isPingSupported(java.lang.String jid) throws XMPPException
jid
- The id of the entity the query is being sent to
XMPPException
- An XMPP related error occurred during the requestpublic boolean pingMyServer()
ping
with the XMPP domain.
Unlike the ping(String)
case, this method will return true even if
isPingSupported(String)
is false.
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |