org.alicebot.server.core.responder
Class SmartResponder

java.lang.Object
  extended by org.alicebot.server.core.responder.SmartResponder

public class SmartResponder
extends java.lang.Object

The SmartResponder is a broker for requests coming into the server. Its goal is to accept and process a response and format it for the appropriate device, formatting the output as needed through other Responders. What makes it "smart" is its ability to parse the User-Agent and forward the request to the appropriate Responder.

In general a Responder must have:

  1. A method of output (text output, speech, XML)
  2. A method of input (text input, speech, XML)
  3. The main method of this class is doResponse(), which will redirects the HttpRequest as needed.

    Author:
    Jon Baer, Thomas Ringate/Pedro Colla

    Constructor Summary
    SmartResponder(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
              Constructs a new SmartResponder from a given servlet request, and given a servlet response object to send back.
     
    Method Summary
     void doResponse()
              Invokes a response.
     int getServiceType()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    SmartResponder

    public SmartResponder(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
    Constructs a new SmartResponder from a given servlet request, and given a servlet response object to send back.

    Parameters:
    request - the servlet request
    response - the response to modify and send back
    Method Detail

    doResponse

    public void doResponse()
    Invokes a response.


    getServiceType

    public int getServiceType()