com.gisgraphy.servlet
Class GisgraphyServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.gisgraphy.servlet.GisgraphyServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
FulltextServlet, GeolocServlet, StreetServlet

public abstract class GisgraphyServlet
extends javax.servlet.http.HttpServlet

provides utility function for Gisgraphy Service

Author:
David Masclet
See Also:
GeolocServlet, FulltextServlet, Serialized Form

Field Summary
protected  boolean debugMode
           
static java.lang.String FORMAT_PARAMETER
           
static java.lang.String FROM_PARAMETER
           
static java.lang.String INDENT_PARAMETER
           
protected static org.slf4j.Logger logger
          The logger
static java.lang.String TO_PARAMETER
           
 
Constructor Summary
GisgraphyServlet()
           
 
Method Summary
protected  void doDelete(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  void doHead(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  void doOptions(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  void doPut(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  void doTrace(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
abstract  IoutputFormatVisitor getErrorVisitor(java.lang.String errorMessage)
           
abstract  GisgraphyServiceType getGisgraphyServiceType()
           
 boolean isDebugMode()
           
 void sendCustomError(java.lang.String errorMessage, Output.OutputFormat format, javax.servlet.http.HttpServletResponse resp, javax.servlet.http.HttpServletRequest req)
           
 void setDebugMode(boolean debugMode)
           
protected  Output.OutputFormat setResponseContentType(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doGet, getLastModified, service, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugMode

protected boolean debugMode

INDENT_PARAMETER

public static final java.lang.String INDENT_PARAMETER
See Also:
Constant Field Values

TO_PARAMETER

public static final java.lang.String TO_PARAMETER
See Also:
Constant Field Values

FROM_PARAMETER

public static final java.lang.String FROM_PARAMETER
See Also:
Constant Field Values

FORMAT_PARAMETER

public static final java.lang.String FORMAT_PARAMETER
See Also:
Constant Field Values

logger

protected static final org.slf4j.Logger logger
The logger

Constructor Detail

GisgraphyServlet

public GisgraphyServlet()
Method Detail

getGisgraphyServiceType

public abstract GisgraphyServiceType getGisgraphyServiceType()
Returns:
the GisgraphyServiceType that the servlet handle

getErrorVisitor

public abstract IoutputFormatVisitor getErrorVisitor(java.lang.String errorMessage)
Parameters:
errorMessage - the error message to be treated by the visitor
Returns:
an instance of the outputFormatVisitor for the servlet

setResponseContentType

protected Output.OutputFormat setResponseContentType(javax.servlet.http.HttpServletRequest req,
                                                     javax.servlet.http.HttpServletResponse resp)

sendCustomError

public void sendCustomError(java.lang.String errorMessage,
                            Output.OutputFormat format,
                            javax.servlet.http.HttpServletResponse resp,
                            javax.servlet.http.HttpServletRequest req)

doDelete

protected void doDelete(javax.servlet.http.HttpServletRequest req,
                        javax.servlet.http.HttpServletResponse resp)
                 throws javax.servlet.ServletException,
                        java.io.IOException
Overrides:
doDelete in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doHead

protected void doHead(javax.servlet.http.HttpServletRequest req,
                      javax.servlet.http.HttpServletResponse resp)
               throws javax.servlet.ServletException,
                      java.io.IOException
Overrides:
doHead in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doOptions

protected void doOptions(javax.servlet.http.HttpServletRequest req,
                         javax.servlet.http.HttpServletResponse resp)
                  throws javax.servlet.ServletException,
                         java.io.IOException
Overrides:
doOptions in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doPost

protected void doPost(javax.servlet.http.HttpServletRequest req,
                      javax.servlet.http.HttpServletResponse resp)
               throws javax.servlet.ServletException,
                      java.io.IOException
Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doPut

protected void doPut(javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse resp)
              throws javax.servlet.ServletException,
                     java.io.IOException
Overrides:
doPut in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doTrace

protected void doTrace(javax.servlet.http.HttpServletRequest req,
                       javax.servlet.http.HttpServletResponse resp)
                throws javax.servlet.ServletException,
                       java.io.IOException
Overrides:
doTrace in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

isDebugMode

public boolean isDebugMode()
Returns:
the debugMode

setDebugMode

public void setDebugMode(boolean debugMode)
Parameters:
debugMode - the debugMode to set


Copyright © 2010. All Rights Reserved.