Package rocks.xmpp.im.chat
Class Chat
- java.lang.Object
-
- rocks.xmpp.im.chat.Chat
-
- Direct Known Subclasses:
ChatRoom
,ChatSession
public abstract class Chat extends Object
An abstract chat class, which represents either a one-to-one chat session or a group chat session.- See Also:
ChatSession
-
-
Constructor Summary
Constructors Constructor Description Chat()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addInboundMessageListener(Consumer<MessageEvent> messageListener)
Adds a message listener, which allows to listen for inbound messages.void
removeInboundMessageListener(Consumer<MessageEvent> messageListener)
Removes a previously added message listener.abstract SendTask<Message>
sendMessage(String message)
Sends a message to the chat.abstract SendTask<Message>
sendMessage(Message message)
Sends a message to the chat.
-
-
-
Method Detail
-
sendMessage
public abstract SendTask<Message> sendMessage(String message)
Sends a message to the chat.- Parameters:
message
- The message.- Returns:
- The message, which has been sent.
-
sendMessage
public abstract SendTask<Message> sendMessage(Message message)
Sends a message to the chat.- Parameters:
message
- The message.- Returns:
- The message, which has been sent.
-
addInboundMessageListener
public final void addInboundMessageListener(Consumer<MessageEvent> messageListener)
Adds a message listener, which allows to listen for inbound messages.- Parameters:
messageListener
- The listener.- See Also:
removeInboundMessageListener(Consumer)
-
removeInboundMessageListener
public final void removeInboundMessageListener(Consumer<MessageEvent> messageListener)
Removes a previously added message listener.- Parameters:
messageListener
- The listener.- See Also:
addInboundMessageListener(Consumer)
-
-