|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet org.deegree.services.controller.OGCFrontController
public class OGCFrontController
Servlet that acts as single HTTP communication end point and dispatcher to the OWS instances configured in the
DeegreeWorkspace
.
Calls to doGet(HttpServletRequest, HttpServletResponse)
and
doPost(HttpServletRequest, HttpServletResponse)
are processed as follows:
OWS
instance is determined and one of the following methods is called:
OWS
,
Serialized FormConstructor Summary | |
---|---|
OGCFrontController()
|
Method Summary | |
---|---|
void |
destroy()
|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles HTTP GET requests. |
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles HTTP POST requests. |
static RequestContext |
getContext()
Returns the RequestContext associated with the calling thread. |
static String |
getHttpGetURL()
Returns the HTTP URL for communicating with the OGCFrontController over the web (for GET requests). |
static String |
getHttpPostURL()
Returns the HTTP URL for communicating with the OGCFrontController over the web (for POST requests). |
static OGCFrontController |
getInstance()
Returns the only instance of this class. |
static WebServicesConfiguration |
getServiceConfiguration()
|
static DeegreeWorkspace |
getServiceWorkspace()
|
void |
init(javax.servlet.ServletConfig config)
|
void |
reload()
Re-initializes the whole workspace, effectively reloading the whole configuration. |
void |
reload(String workspaceName)
Re-initializes the whole workspace, effectively reloading the whole configuration. |
static URL |
resolveFileLocation(String location,
javax.servlet.ServletContext context)
'Heuristical' method to retrieve the URL for a file referenced from an init-param of a webapp config file
which may be:
a (absolute) URL
a file location
a (relative) URL which in turn is resolved using ServletContext.getRealPath
|
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
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 |
Constructor Detail |
---|
public OGCFrontController()
Method Detail |
---|
public static OGCFrontController getInstance()
null
RuntimeException
- if GenericServlet.init()
has not been calledpublic static RequestContext getContext()
RequestContext
associated with the calling thread.
NOTE: This method will only return a correct result if the calling thread originated in the
doGet(HttpServletRequest, HttpServletResponse)
or
doPost(HttpServletRequest, HttpServletResponse)
of this class (or has been spawned as a child thread by
such a thread).
RequestContext
associated with the calling threadpublic static DeegreeWorkspace getServiceWorkspace()
public static WebServicesConfiguration getServiceConfiguration()
public static String getHttpPostURL()
NOTE: This method will only return a correct result if the calling thread originated in the
doGet(HttpServletRequest, HttpServletResponse)
or
doPost(HttpServletRequest, HttpServletResponse)
of this class (or has been spawned as a child thread by
such a thread).
public static String getHttpGetURL()
NOTE: This method will only return a correct result if the calling thread originated in the
doGet(HttpServletRequest, HttpServletResponse)
or
doPost(HttpServletRequest, HttpServletResponse)
of this class (or has been spawned as a child thread by
such a thread).
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
An HTTP GET request implies that input parameters are specified as key-value pairs. However, at least one OGC
service specification allows the sending of XML requests via GET (see WCS 1.0.0 specification, section 6.3.3). In
this case, the query string contains no key=value
pairs, but the (URL encoded) xml. The encoding
ensures that no =
char (parameter/value delimiters) occur in the string.
doGet
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
An HTTP POST request specifies parameters in the request body. OGC service specifications use three different ways to encode the parameters:
key=value
pairs which are separated using the &
character. This is equivalent to standard HTTP GET requests, except that the parameters are not part of the query
string, but the POST body. In this case, the content-type
field in the header must be
application/x-www-form-urlencoded
.content-type
field in the
header has to be text/xml
, but the implementation does not rely on this in order to be more tolerant
to clients.
doPost
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void reload() throws IOException, URISyntaxException, javax.servlet.ServletException
URISyntaxException
IOException
javax.servlet.ServletException
public void reload(String workspaceName) throws IOException, URISyntaxException, javax.servlet.ServletException
workspaceName
- if not null, the specified workspace will be started after shutting down the currently running one
URISyntaxException
IOException
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
public static URL resolveFileLocation(String location, javax.servlet.ServletContext context) throws MalformedURLException
URL
for a file referenced from an init-param of a webapp config file
which may be:
URL
ServletContext.getRealPath
location
- context
-
MalformedURLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |