Skip to content

Toro Cloud Dev Center


JabberFunctions

Jabber class contains functions for sending messages to users and receiving messages in a Jabber endpoint. Functions of the functions in this class can be used in both Gloop and Groovy.

Below are some examples on how to use the functions in JabberFunctions:

Sample service showing how to use the `Jabber` functions

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
// Create a Jabber connection from scratch
def configuration = [ "host": "localhost", "serviceName": "Home" ]
def jabberConnection = "jabberConnection".createJabberConnection(configuration)

// Send an IM to a Jabber user
'jabberEndpoint'.sendMessage("john@localhost", "What's up?!" );

// Establishes a connection to the Jabber server
jabberConnection.connect()

// Login as a certain Jabber user
jabberConnection.login( "jane@localhost", "pa\$\$w0rd" )

// Send a Jabber message to another Jabber user
jabberConnection.sendMessage("john@localhost", "So far, so good!" );

// Disconnect to the Jabber server
jabberConnection.disconnect()