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 |
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.
|
void |
process(Message message)
Method for processing incoming stanza.
|
void |
sendMessage(Chat chat,
String body)
Sends message in passed chat.
|
void |
sendMessage(Chat chat,
String body,
List<? extends Element> additionalElems)
Sends message in passed chat.
|
void |
sendMessage(JID toJID,
String subject,
String message)
Sends message.
|
protected boolean |
update(Chat chat,
JID fromJid,
String threadId) |
void |
writeMessage(Message msg) |
addExtension, getExtensionChain, getFeaturesWithExtensions, removeExtension, write, write, write
afterRegister, beforeUnregister, fireEvent, getFirstChild, process, setContext
public MessageModule(AbstractChatManager chatManager)
public MessageModule()
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
protected Message executeBeforeMessageProcess(Message element, Chat chat)
public Chat createChatInstance(Message message, JID interlocutorJid) throws JaxmppException
JaxmppException
protected String generateThreadID()
public AbstractChatManager getChatManager()
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>
JaxmppException
public void sendMessage(JID toJID, String subject, String message) throws XMLException, JaxmppException
toJID
- recipient's JIDsubject
- subject of messagemessage
- messageXMLException
JaxmppException
public void sendMessage(Chat chat, String body) throws XMLException, JaxmppException
body
- message to send.XMLException
JaxmppException
public void sendMessage(Chat chat, String body, List<? extends Element> additionalElems) throws XMLException, JaxmppException
body
- message to send.XMLException
JaxmppException
protected boolean update(Chat chat, JID fromJid, String threadId) throws JaxmppException
JaxmppException
public void writeMessage(Message msg) throws JaxmppException
JaxmppException
Copyright © 2006–2015 Tigase. All rights reserved.