A transport-agnostic Java service bot implements the informal org.coweb.bots.Bot interface to receive data from users in a coweb session. The bot uses a org.coweb.bots.Proxy implementation to send data back to a coweb session. The bot configuration determines what transport the server uses to communicate with the bot.
A Java bot must meet these criteria:
Bots declare their metadata and configuration in standard Java properties file. The property file resides with the deployed coweb server and describes how the server should expect to communicate with the bot.
The following are the known properties. Any property except those noted as required may be omitted.
Formal interface for a service bot with callbacks for session events.
A bot proxy invokes this method upon the first message delivered to the bot (i.e., when it joins the session).
A bot proxy calls this method when a coweb application posts a private request to the bot.
| Parameters: |
|
|---|
A bot proxy calls this method when the coweb server is about to shutdown the bot. The bot should cleanup its resources gracefully.
A bot proxy calls this method when a coweb application subscribes to messages published by this bot.
| Parameters: | username – Authenticated username of the subscriber |
|---|
A bot proxy calls this method when a coweb application publishes a cooperative event to the session.
| Parameters: |
|
|---|
A bot proxy calls this method when a coweb application unsubscribes from messages published by this bot or when a user leaves the session.
| Parameters: | username – Authenticated username of the unsubscriber |
|---|
A bot proxy calls this method to provide the bot with a reference to itself for sending broadcasts and responses.
| Parameters: | proxy – org.coweb.bots.Proxy instance |
|---|
Formal interface for a service bot with methods for sending public and private messages back to a coweb server for delivery to a session.
A bot delegate calls this method to send a private response to an application that previously sent it a request.
| Parameters: |
|
|---|