|Description:||Jabber XMPP symmetric peer transport/accessor|
The JabberEndpoint prototype has the following initialisation parameters:
|config||Mandatory||Identifier or XML||(none)|
XML configuration resource
An identifier for created logical endpoint, if omitted a unique auto-generated value it will be used.
If included this parameter will mark the endpoint as private and it will not be exposed outside module.
Here is an auto-generated example of how to instantiate an instance of JabberEndpoint:
To use JabberEndpoint accessor prototype you must import the module urn:org:netkernel:mod:jabber:
JabberEndpoint is a symmetric XMPP peer. It implements both a NetKernel transport to receive messages and and accessor to send messages. When configured it will listen for messages from a XMPP server and can also initiate conversations by sending messages. As a peer-to-peer endpoint, receiving and sending messages may occur completely independently.
The JabberEndpoint must be provided with a config parameter. This has the form...
When the endpoint is commissioned it will listen for messages for the configured user@server identity. When a message is received the endpoint issues a SOURCE request into the host address space. The request has the following form...
The message argument is of type org.jivesoftware.smack.packet.Message
A handler of the jabber:message request may source the message argument and call getBody() to receive the message body as a String.
When the JabberEndpoint issues a jabber:message request into the host address space it also dynamically constructs a transient space which implements the resource jabber:reply. The transient space is inserted into the request scope superstack and is accessible in the context of the message request.
A message handler can reply directly to the sender of the message by SINK ing either a java.lang.String or org.jivesoftware.smack.packet.Message to jabber:reply
context.sink("jabber:reply", "Message received - thanks very much");
The JabberEndpoint implements the active:jabberSend accessor with syntax...
Message may be either java.lang.String or org.jivesoftware.smack.packet.Message
Note: the JabberEndpoint must be instantiated and connected to the XMPP server for it to be able to send messages.
The following code fragment shows how to send a message...
//Send a message with active:jabberSend req=context.createRequest("active:jabberSend"); req.addArgument("to", "email@example.com"); req.addArgumentByValue("message", "Hello XMPP World"); context.issueRequest(req);
The following mapper endpoint declaration shows how you might use the mapper to route received messages to a handler script...