Package rocks.xmpp.extensions.reach
Class ReachabilityManager
- java.lang.Object
-
- rocks.xmpp.core.stanza.AbstractIQHandler
-
- rocks.xmpp.extensions.reach.ReachabilityManager
-
- All Implemented Interfaces:
ExtensionProtocol,InboundMessageHandler,InboundPresenceHandler,IQHandler,OutboundPresenceHandler,DiscoverableInfo
public final class ReachabilityManager extends AbstractIQHandler implements InboundPresenceHandler, OutboundPresenceHandler, InboundMessageHandler, ExtensionProtocol, DiscoverableInfo
Allows to query for reachability addresses of another contact, automatically responds to reachability queries and notifies Consumers, when the reachability of a contact has changed either via presence or PEP.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddReachabilityAddress(Address address)Adds a reachability address.voidaddReachabilityListener(Consumer<ReachabilityEvent> reachabilityListener)Adds a reachability listener, which allows to listen for reachability updates.Set<String>getFeatures()Gets the features.StringgetNamespace()The protocol's main namespace.List<Address>getReachabilityAddresses()Gets the reachability address as unmodifiable list.voidhandleInboundMessage(MessageEvent e)Handles an inbound message.voidhandleInboundPresence(PresenceEvent e)Handles an inbound presence.voidhandleOutboundPresence(PresenceEvent e)Handles an outbound presence.booleanisEnabled()Indicates whether this protocol is enabled.booleanremoveReachabilityAddress(Address address)Removes a reachability address.voidremoveReachabilityListener(Consumer<ReachabilityEvent> reachabilityListener)Removes a previously added reachability listener.AsyncResult<List<Address>>requestReachabilityAddresses(Jid contact)Requests the reachability addresses of a contact.-
Methods inherited from class rocks.xmpp.core.stanza.AbstractIQHandler
getPayloadClass, handleRequest
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface rocks.xmpp.extensions.disco.model.info.DiscoverableInfo
getExtensions, getIdentities
-
-
-
-
Method Detail
-
getReachabilityAddresses
public List<Address> getReachabilityAddresses()
Gets the reachability address as unmodifiable list.- Returns:
- The reachability addresses.
-
addReachabilityAddress
public boolean addReachabilityAddress(Address address)
Adds a reachability address.- Parameters:
address- The reachability address.- Returns:
- True, if the address was added.
- See Also:
removeReachabilityAddress(Address)
-
removeReachabilityAddress
public boolean removeReachabilityAddress(Address address)
Removes a reachability address.- Parameters:
address- The reachability address.- Returns:
- True, if the address was removed.
- See Also:
addReachabilityAddress(Address)
-
addReachabilityListener
public void addReachabilityListener(Consumer<ReachabilityEvent> reachabilityListener)
Adds a reachability listener, which allows to listen for reachability updates.- Parameters:
reachabilityListener- The listener.- See Also:
removeReachabilityListener(Consumer)
-
removeReachabilityListener
public void removeReachabilityListener(Consumer<ReachabilityEvent> reachabilityListener)
Removes a previously added reachability listener.- Parameters:
reachabilityListener- The listener.- See Also:
addReachabilityListener(Consumer)
-
requestReachabilityAddresses
public AsyncResult<List<Address>> requestReachabilityAddresses(Jid contact)
Requests the reachability addresses of a contact.- Parameters:
contact- The contact.- Returns:
- The async result with the reachability addresses.
-
handleInboundPresence
public final void handleInboundPresence(PresenceEvent e)
Description copied from interface:InboundPresenceHandlerHandles an inbound presence.- Specified by:
handleInboundPresencein interfaceInboundPresenceHandler- Parameters:
e- The presence event.
-
handleInboundMessage
public final void handleInboundMessage(MessageEvent e)
Description copied from interface:InboundMessageHandlerHandles an inbound message.- Specified by:
handleInboundMessagein interfaceInboundMessageHandler- Parameters:
e- The message event.
-
handleOutboundPresence
public final void handleOutboundPresence(PresenceEvent e)
Description copied from interface:OutboundPresenceHandlerHandles an outbound presence.- Specified by:
handleOutboundPresencein interfaceOutboundPresenceHandler- Parameters:
e- The presence event.
-
getNamespace
public final String getNamespace()
Description copied from interface:ExtensionProtocolThe protocol's main namespace. This is used to uniquely identify the extension protocol.- Specified by:
getNamespacein interfaceExtensionProtocol- Returns:
- The main namespace.
-
isEnabled
public final boolean isEnabled()
Description copied from interface:ExtensionProtocolIndicates whether this protocol is enabled.- Specified by:
isEnabledin interfaceExtensionProtocol- Returns:
- true, if enabled; false if disabled.
-
getFeatures
public final Set<String> getFeatures()
Description copied from interface:DiscoverableInfoGets the features.- Specified by:
getFeaturesin interfaceDiscoverableInfo- Returns:
- The features.
-
-