org.vfny.geoserver.servlets
Class Dispatcher

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.vfny.geoserver.servlets.Dispatcher
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
WfsDispatcher, WmsDispatcher

public class Dispatcher
extends javax.servlet.http.HttpServlet

Routes requests made at the top-level URI to appropriate interface servlet. Note that the logic of this method could be generously described as 'loose.' It is not checking for request validity in any way (this is done by the reqeust- specific servlets). Rather, it is attempting to make a reasonable guess as to what servlet to call, given that the client is routing to the top level URI as opposed to the request-specific URI, as specified in the GetCapabilities response. Thus, this is a convenience method, which allows for some slight client laziness and helps explain to lost souls/spiders what lives at the URL. Due to the string parsing, it is much faster (and recommended) to use the URIs specified in the GetCapabablities response. Currently does not support post requests, but most requests for this will likely come with get.

See Also:
Serialized Form

Field Summary
static int DESCRIBE_FEATURE_TYPE_REQUEST
          Map describe feature type request type
static int ERROR
          Map get feature request type
static int GET_CAPABILITIES_REQUEST
          Map get capabilities request type
static int GET_FEATURE_LOCK_REQUEST
          Map get feature with lock request type
static int GET_FEATURE_REQUEST
          Map get feature request type
static int GET_MAP_REQUEST
          Map get capabilities request type
static int LOCK_REQUEST
          int representation of a lock request type
static java.lang.String META_REQUEST
          Map metadata request type
protected  javax.servlet.ServletConfig servletConfig
           
static int TRANSACTION_REQUEST
          Map get feature request type
static int UNKNOWN
          Map get feature request type
static short WFS_SERVICE
           
static short WMS_SERVICE
           
 
Constructor Summary
Dispatcher()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles all Get requests.
 void init(javax.servlet.ServletConfig config)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

META_REQUEST

public static java.lang.String META_REQUEST
Map metadata request type


GET_CAPABILITIES_REQUEST

public static final int GET_CAPABILITIES_REQUEST
Map get capabilities request type

See Also:
Constant Field Values

DESCRIBE_FEATURE_TYPE_REQUEST

public static final int DESCRIBE_FEATURE_TYPE_REQUEST
Map describe feature type request type

See Also:
Constant Field Values

GET_FEATURE_REQUEST

public static final int GET_FEATURE_REQUEST
Map get feature request type

See Also:
Constant Field Values

TRANSACTION_REQUEST

public static final int TRANSACTION_REQUEST
Map get feature request type

See Also:
Constant Field Values

GET_FEATURE_LOCK_REQUEST

public static final int GET_FEATURE_LOCK_REQUEST
Map get feature with lock request type

See Also:
Constant Field Values

LOCK_REQUEST

public static final int LOCK_REQUEST
int representation of a lock request type

See Also:
Constant Field Values

GET_MAP_REQUEST

public static final int GET_MAP_REQUEST
Map get capabilities request type

See Also:
Constant Field Values

WMS_SERVICE

public static final short WMS_SERVICE
See Also:
Constant Field Values

WFS_SERVICE

public static final short WFS_SERVICE
See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
Map get feature request type

See Also:
Constant Field Values

ERROR

public static final int ERROR
Map get feature request type

See Also:
Constant Field Values

servletConfig

protected javax.servlet.ServletConfig servletConfig
Constructor Detail

Dispatcher

public Dispatcher()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException
Handles all Get requests. This method implements the main matching logic for the class.

Parameters:
request - The servlet request object.
response - The servlet response object.
Throws:
javax.servlet.ServletException - For any servlet problems.
java.io.IOException - For any io problems.