I'm working towards putting together a notification system with Smack/OpenFire/Railo and am having issues with createChat. So far I've been able to do the following - create a connection / connect / login / getChatManager. I can dump out the methods for ChatManager, Chat, XMPPConnection, Message, and MessageListener all with no problem and a local Psi client sees my "Railo" user everytime I hit my page (it immediately says "Railo is Offline" followed by "Railo is Online" which is what I'm expecting).
My problem is with createChat. I've found older samples that have a seemingly simpler method of sending a message but none of those match the methods as I see them dumped out with the current version of Smack. The current examples show something like:
connection setup stuff ...
ChatManager chatmanager = connection.getChatManager();
********* my Coldfusion version of above runs to here **************
******* sample directly from tutorial **********
Chat newChat = chatmanager.createChat("jsmith@jivesoftware.com", new MessageListener() {
public void processMessage(Chat chat, Message message) {
System.out.println("Received message: " + message);
}
});
******* /sample directly from tutorial **********
I know nothing of Java but if I translate the above to longhand english would it translate to something like -
New_Chat_var = chatmanager_obj.createChat("to_string", New_MessageListener_obj(
chat_var = New_Chat_obj,
message_var = New_Message_obj)
??
If so what I've been trying to do is create those objects just prior to calling "createChat" and passing them in. No dice so far and honestly I'm not sure I'm even looking at it right. I've found old references (some revolving around Coldfusion) that show message creation in a much simpler format without this MessageListener but those seem to be from versions in the past and no longer apply.
Can anyone tell me if I'm even reading the createChat method correctly? It seems like it's creating an object (newChat) that needs the creation of an object (MessageListener) that needs two more objects created (chat and message), all on the fly. Obviously I'm completely illiterate as to Java but is this right?
Thank you!