org.alicebot.server.core.responder
Interface Responder

All Known Implementing Classes:
AbstractMarkupResponder, AIMResponder, FlashResponder, HTMLResponder, TextResponder

public interface Responder

A Responder is an object that processes and logs input via a given channel (text, html, flash, etc.).

Author:
Jon Baer, Noel Bush

Method Summary
 java.lang.String append(java.lang.String input, java.lang.String reply, java.lang.String appendTo)
           Response by a Responder is considered an "append" to some previous string.
 void log(java.lang.String input, java.lang.String reply, java.lang.String hostname, java.lang.String userid, java.lang.String botid)
          Logs an input/response pair to the appropriate place.
 java.lang.String postprocess(java.lang.String reply)
           Postprocesses a message from a bot as appropriate for a given channel.
 java.lang.String preprocess(java.lang.String message, java.lang.String hostname)
           Preprocesses a message from a bot as appropriate for a given channel.
 

Method Detail

preprocess

java.lang.String preprocess(java.lang.String message,
                            java.lang.String hostname)

Preprocesses a message from a bot as appropriate for a given channel.

For some channels, this may involve doing substitutions on the message; for some channels this may mean formatting the message in a particular way, etc.

Parameters:
message - the message to be formatted
hostname - the name of the host that is generating the message
Returns:
the result of preprocessing the message

log

void log(java.lang.String input,
         java.lang.String reply,
         java.lang.String hostname,
         java.lang.String userid,
         java.lang.String botid)
Logs an input/response pair to the appropriate place.

Parameters:
input - the client's input
reply - the bot's response
hostname - the name of the host

append

java.lang.String append(java.lang.String input,
                        java.lang.String reply,
                        java.lang.String appendTo)

Response by a Responder is considered an "append" to some previous string. That string might be some form of the previous exchange, or it might be nothing.

Parameters:
input - an input from the client
reply - a reply from the bot
appendTo - the string to which the client of the Responder may expect the reply to be appended
Returns:
the reply, in whatever fashion the Responder has decided to modify it

postprocess

java.lang.String postprocess(java.lang.String reply)

Postprocesses a message from a bot as appropriate for a given channel.

For some channels, this may involve doing substitutions on the message; for some channels this may mean formatting the message in a particular way, etc.

Parameters:
message - the message to be formatted
hostname - the name of the host that is generating the message
Returns:
the result of postprocessing the message