Package rocks.xmpp.extensions.rtt
Class RealTimeTextManager
- java.lang.Object
-
- rocks.xmpp.extensions.rtt.RealTimeTextManager
-
- All Implemented Interfaces:
ExtensionProtocol,InboundMessageHandler,DiscoverableInfo
public final class RealTimeTextManager extends Object implements InboundMessageHandler, ExtensionProtocol, DiscoverableInfo
Manages In-Band Real Time Text.- See Also:
- XEP-0301: In-Band Real Time Text
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(Chat chat)Activates real-time text for a chat session.voidaddRealTimeMessageListener(Consumer<RealTimeMessageEvent> realTimeMessageListener)Adds a real-time message listener, which allows to listen for new inbound real-time messages.voidaddRealTimeTextActivationListener(Consumer<RealTimeTextActivationEvent> realTimeTextListener)Adds a real-time text listener, which allows to listen for real-time text.OutboundRealTimeMessagecreateRealTimeMessage(Chat chat)Creates a new real-time message for sending real-time text.OutboundRealTimeMessagecreateRealTimeMessage(Chat chat, String id)Creates a new real-time message for sending real-time text.voiddeactivate(Chat chat)Deactivates real-time text for a chat session.Set<String>getFeatures()Gets the features.StringgetNamespace()The protocol's main namespace.voidhandleInboundMessage(MessageEvent e)Handles an inbound message.booleanisEnabled()Indicates whether this protocol is enabled.voidremoveRealTimeTextActivationListener(Consumer<RealTimeTextActivationEvent> realTimeTextListener)Removes a previously added real-time text listener.-
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
-
createRealTimeMessage
public final OutboundRealTimeMessage createRealTimeMessage(Chat chat, String id)
Creates a new real-time message for sending real-time text. This method is intended for creating a new message, when editing an existing message, when used in concert with XEP-0308: Last Message Correction.- Parameters:
chat- The chat to send real-time text with.id- The id of the message, which is edited with a real-time message.- Returns:
- The real-time message.
- See Also:
Replace
-
createRealTimeMessage
public final OutboundRealTimeMessage createRealTimeMessage(Chat chat)
Creates a new real-time message for sending real-time text.- Parameters:
chat- The chat to send real-time text with.- Returns:
- The real-time message.
-
addRealTimeMessageListener
public final void addRealTimeMessageListener(Consumer<RealTimeMessageEvent> realTimeMessageListener)
Adds a real-time message listener, which allows to listen for new inbound real-time messages.- Parameters:
realTimeMessageListener- The listener.
-
addRealTimeTextActivationListener
public final void addRealTimeTextActivationListener(Consumer<RealTimeTextActivationEvent> realTimeTextListener)
Adds a real-time text listener, which allows to listen for real-time text.- Parameters:
realTimeTextListener- The listener.- See Also:
removeRealTimeTextActivationListener(Consumer)
-
removeRealTimeTextActivationListener
public final void removeRealTimeTextActivationListener(Consumer<RealTimeTextActivationEvent> realTimeTextListener)
Removes a previously added real-time text listener.- Parameters:
realTimeTextListener- The listener.- See Also:
addRealTimeTextActivationListener(Consumer)
-
activate
public final void activate(Chat chat)
Activates real-time text for a chat session.- Parameters:
chat- The chat.- See Also:
- 6.1 Activating Real-Time Text
-
deactivate
public final void deactivate(Chat chat)
Deactivates real-time text for a chat session.- Parameters:
chat- The chat.- See Also:
- 6.2 Deactivating Real-Time Text
-
handleInboundMessage
public final void handleInboundMessage(MessageEvent e)
Description copied from interface:InboundMessageHandlerHandles an inbound message.- Specified by:
handleInboundMessagein interfaceInboundMessageHandler- Parameters:
e- The message event.
-
getNamespace
public final String getNamespace()
The protocol's main namespace. This is used to uniquely identify the extension protocol.- Specified by:
getNamespacein interfaceExtensionProtocol- Returns:
- "urn:xmpp:rtt:0"
-
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.
-
-