com.kremerk.commandprocessor
Class CommandServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.kremerk.commandprocessor.CommandServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class CommandServlet
extends javax.servlet.http.HttpServlet

See Also:
Serialized Form

Constructor Summary
CommandServlet(CommandProcessor processor)
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The CRUDServlet expects to take a command and a series of parameters.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 boolean isMockMode()
           
 java.lang.String[] parseCommandParts(javax.servlet.http.HttpServletRequest request)
           
 void setMockMode(boolean mockMode)
           
 void setMockRoot(java.lang.String commandRoot)
           
 void setMockRoot(java.lang.String rootDirectory, java.lang.String commandRoot)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandServlet

public CommandServlet(CommandProcessor processor)
Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException
The CRUDServlet expects to take a command and a series of parameters.

The url format is as follows:

http://server:port/CommandServletMapping/CommandSetName/CommandName/?type=json¶m=1¶m=2¶m=blah

The implementation of the MyCoolCommand class will need to appropriately handle the params passed in in the given order.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException,
                   java.io.IOException
Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

setMockMode

public void setMockMode(boolean mockMode)

isMockMode

public boolean isMockMode()

setMockRoot

public void setMockRoot(java.lang.String rootDirectory,
                        java.lang.String commandRoot)

setMockRoot

public void setMockRoot(java.lang.String commandRoot)

parseCommandParts

public java.lang.String[] parseCommandParts(javax.servlet.http.HttpServletRequest request)