public class MessageModule extends AbstractStanzaExtendableModule<Message>
Modifier and Type | Class and Description |
---|---|
static interface |
MessageModule.ChatClosedHandler |
static interface |
MessageModule.ChatCreatedHandler |
static interface |
MessageModule.ChatUpdatedHandler |
static interface |
MessageModule.MessageReceivedHandler |
context, log
Constructor and Description |
---|
MessageModule() |
MessageModule(AbstractChatManager chatManager) |
Modifier and Type | Method and Description |
---|---|
void |
afterRegister()
Called when module is registered.
|
void |
beforeRegister()
Called just before registration module in XmppModulesManager
.
|
void |
close(Chat chat)
Destroy chat object.
|
Chat |
createChat(JID jid)
Creates new chat object.
|
Chat |
createChatInstance(Message message,
JID interlocutorJid) |
protected Message |
executeBeforeMessageProcess(Message element,
Chat chat) |
protected String |
generateThreadID() |
AbstractChatManager |
getChatManager() |
List<Chat> |
getChats()
Returns all chat objects.
|
Criteria |
getCriteria()
Criteria
|
String[] |
getFeatures()
Returns features what are implemented by Module.
|
protected boolean |
isMessageHandledByMUC(JID from) |
void |
process(Message message)
Method for processing incoming stanza.
|
Message |
sendMessage(Chat chat,
String body)
Sends message in passed chat.
|
Message |
sendMessage(Chat chat,
String body,
List<? extends Element> additionalElems)
Sends message in passed chat.
|
Message |
sendMessage(JID toJID,
String subject,
String message)
Sends message.
|
Message |
sendMessage(Message msg)
Sends message in passed chat.
|
protected boolean |
update(Chat chat,
JID fromJid,
String threadId) |
Message |
writeMessage(Message msg) |
addExtension, getExtensionChain, getFeaturesWithExtensions, removeExtension, write, write, write
beforeUnregister, fireEvent, getFirstChild, process, setContext
public MessageModule()
public MessageModule(AbstractChatManager chatManager)
public void afterRegister()
InitializingModule
afterRegister
in interface InitializingModule
afterRegister
in class AbstractStanzaModule<Message>
public void beforeRegister()
InitializingModule
beforeRegister
in interface InitializingModule
beforeRegister
in class AbstractStanzaModule<Message>
public void close(Chat chat) throws JaxmppException
chat
- chat objectJaxmppException
public Chat createChat(JID jid) throws JaxmppException
jid
- destination JIDJaxmppException
public Chat createChatInstance(Message message, JID interlocutorJid) throws JaxmppException
JaxmppException
public AbstractChatManager getChatManager()
public List<Chat> getChats()
public Criteria getCriteria()
public String[] getFeatures()
Returns features what are implemented by Module.
public void process(Message message) throws JaxmppException
process
in class AbstractStanzaModule<Message>
message
- incoming stanzaJaxmppException
public Message sendMessage(Chat chat, String body) throws JaxmppException
body
- message to send.JaxmppException
public Message sendMessage(Message msg) throws JaxmppException
msg
- message stanza to send.JaxmppException
public Message sendMessage(Chat chat, String body, List<? extends Element> additionalElems) throws JaxmppException
body
- message to send.JaxmppException
public Message sendMessage(JID toJID, String subject, String message) throws JaxmppException
toJID
- recipient's JIDsubject
- subject of messagemessage
- messageJaxmppException
public Message writeMessage(Message msg) throws JaxmppException
JaxmppException
protected Message executeBeforeMessageProcess(Message element, Chat chat)
protected String generateThreadID()
protected boolean isMessageHandledByMUC(JID from)
protected boolean update(Chat chat, JID fromJid, String threadId) throws JaxmppException
JaxmppException
Copyright © 2006–2023 Tigase. All rights reserved.