Skip to content

Home

Introduction

Development

Overview

IDEs

Services

Service manager

API Explorer

JabberMethods

JabberMethods contains one-liners for sending messages to users and receiving messages in a Jabber endpoint. Methods of the methods in this class can be used in both Gloop and Groovy.

Below are some examples on how to use the methods in JabberMethods:

Sample Gloop service showing how to use the `JabberMethods` one-liners

 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()