Previous Next Up FAQ Table of Contents

5.9 Listening for Events

Note: This feature is available only with VolanoChatPro.

You can write CGI scripts (in any programming language) or Java servlets that register with the VolanoChat server for event notifications. The scripts or servlets are not even required to run on the same machine as VolanoChat. They can be located on any machine on the Internet or your intranet that is accessible by the VolanoChat server.

You register to receive event notifications by invoking the COM.volano.RegisterServlet included with VolanoChat. (See the chapter [6.0] VolanoChat Servlets for information about the register servlet.) In order to prevent unauthorized access to the events from your VolanoChat server, you can specify which URLs can receive notifications with the event.callback.prefix server property. (See the section [5.2] Server Properties for information about the VolanoChat server properties.)

After registering for events, the script or servlet receives all events from the specified room in XML notation using an HTTP POST request. Each HTTP POST must return an HTTP response with status code of 200 (OK) if the program wants to continue receiving events. Any other status code terminates the event registration. The format of each XML document is shown below, where string is any text string.

<create>
<room>string</room>
</create>

<enter type="member|non-member">
<room>string</room>
<user>string</user>
<host>string</host>
<profile>string</profile>
</enter>

<chat>
<room>string</room>
<user>string</user>
<message>string</message>
</chat>

<ring>
<room>string</room>
<from>string</from>
<to>string</to>
</ring>

<kick type="remove|disconnect|ban">
<room>string</room>
<from>string</from>
<to>string</to>
</kick>

<exit>
<room>string</room>
<user>string</user>
</exit>

<delete>
<room>string</room>
</delete>

Programs can register for rooms that do not exist, in which case they will be notified with a create event when the room with the specified name is created. A delete event notifies the program that the room no longer exists.


Previous Next Up FAQ XHTML 1.0 Table of Contents

2014-07-11 — An updated version of the VOLANO chat server that supports the latest Java 8 Plug-in is now available. More…

The VOLANO® chat software for the Java™ platform lets you build on-line communities and add real-time social networking to your Web site. More…

John Neffenger <john@status6.com>
More…

A PROJECT OF STATUS:6®