Class Attention
- java.lang.Object
-
- rocks.xmpp.extensions.attention.model.Attention
-
public final class Attention extends Object
The implementation of the<attention/>
element in theurn:xmpp:attention:0
namespace.This feature is known as 'nudge' or 'buzz' in some non-XMPP IM protocols.
Listening for Attention Requests
If you want to listen for inbound attention requests, listen for inbound messages and check if they have the
Attention
extension.xmppClient.addInboundMessageListener(e -> { if (e.getMessage().hasExtension(Attention.class)) { // Handle attention request. } });
You should also enable this feature (preferably before login), in order to register this extension in service discovery:
xmppClient.enableFeature(Attention.NAMESPACE);
Requesting Attention
Attention requests are sent via a 'headline' message:
Message message = new Message(jid, Message.Type.HEADLINE); message.addExtension(Attention.INSTANCE); xmppClient.send(message);
This class is immutable.
- See Also:
- XEP-0224: Attention, XML Schema
-
-
Field Detail
-
INSTANCE
public static final Attention INSTANCE
The<attention/>
element.
-
NAMESPACE
public static final String NAMESPACE
"urn:xmpp:attention:0"- See Also:
- Constant Field Values
-
-