The Jabber plugin enables the usage of the XMPP protocol to communicate with Jabber servers. Relies on the Xmlrpc Plugin and the Smack/Smackx libraries.
The current version of griffon-jabber-plugin is 0.5
To install just issue the following command
griffon install-plugin jabber |
The plugin will inject the following dynamic methods:
Where params may contain
Property |
Type |
Required |
Notes |
|---|---|---|---|
serviceName |
String |
|
|
host |
String |
|
|
port |
int |
|
|
username |
String |
|
|
password |
String |
|
|
proxy |
Map |
|
the following properties may be specified |
Any additional params will be set on org.jivesoftware.smack.ConnectionConfiguration directly.
A new method is added to XMPPConnection in order to establish a chat session and send messages
If you wish to listen for incoming messages then you'll need to add a closure property (or a method) with the following signature on the instance that established the Jabber connection
def onJabberMessage = { msg -> ... }
// or as a method
void onJabberMessage(msg) { ... }
|
The type of the msg argument is org.jivesoftware.smack.packet.Message
Connecting to Gtalk
class GtalkController {
def model
private conn
def connect = { evt = null ->
conn = jabberConnect(host: "talk.google.com", port: 5222i,
serviceName: "gmail.com",
username: model.username,
password: model.password)
}
def sendMessage = { evt = null ->
conn.chatWith(model.participant, model.message)
}
def onJabberMessage = { msg ->
model.chatText = "${msg.from} said: '${msg.body}'"
}
}
|
Dynamic methods will be added to controllers by default. You can change this setting by adding a configuration flag in Config.groovy
griffon.jabber.injectInto = ["controller", "service"] |
Version |
Date |
Notes |
|---|---|---|
0.5 |
12-21-10 |
Release sync with Griffon 0.9.2 |
0.4.1 |
11-08-10 |
Fix a metaclass problem when injecting dynamic methods |
0.4 |
10-27-10 |
Release sync with Griffon 0.9.1 |
0.3 |
07-22-10 |
Release sync with Griffon 0.9 |
0.2 |
03-01-10 |
Upgraded to Griffon 0.3 |
0.1 |
10-26-09 |
Initial release |