Esri Geoportal Server
1.0

com.esri.gpt.control.rest
Class ManageDocumentServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.esri.gpt.framework.context.BaseServlet
              extended by com.esri.gpt.control.rest.ManageDocumentServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class ManageDocumentServlet
extends BaseServlet

Provides an HTTP REST interface for the management of an XML based metadata document.

The URL pattern for this end-point is:
http://host:port/application/rest/manage/document

Four HTTP methods are supported:

The subject document can be specified within the URL as follows: Attributes applicable for resource registration: Exceptions applicable to all methods: Exceptions applicable to GET/DETETE: Exceptions applicable to PUT/POST:

See Also:
Serialized Form

Constructor Summary
ManageDocumentServlet()
           
 
Method Summary
protected  void doDelete(HttpServletRequest request, HttpServletResponse response)
          Deletes a document from the catalog.
protected  void doGet(HttpServletRequest request, HttpServletResponse response)
          Gets an XML document from the catalog.
protected  void doPost(HttpServletRequest request, HttpServletResponse response)
          Handles a POST request.
protected  void doPut(HttpServletRequest request, HttpServletResponse response)
          Publishes an XML document to the catalog.
protected  void execute(HttpServletRequest request, HttpServletResponse response, RequestContext context)
          Provides a concrete executeUpdate() method to fulfill the sub-class requirement of the parent BaseServlet class.
 
Methods inherited from class com.esri.gpt.framework.context.BaseServlet
authenticate, getCredentials, getLogger, getParameterValue, getRealm, readInputCharacters, writeCharacterResponse, writeHtmlResponse, writeXmlResponse
 
Methods inherited from class javax.servlet.http.HttpServlet
doHead, doOptions, doTrace, 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
 

Constructor Detail

ManageDocumentServlet

public ManageDocumentServlet()
Method Detail

doDelete

protected void doDelete(HttpServletRequest request,
                        HttpServletResponse response)
                 throws ServletException,
                        IOException
Deletes a document from the catalog.
An HTTP 200 response code is set when a document is successfully deleted.

Overrides:
doDelete in class HttpServlet
Parameters:
request - the servlet request
response - the servlet response
Throws:
ServletException - if the request cannot be handled
IOException - if an I/O error occurs while handling the request

doGet

protected void doGet(HttpServletRequest request,
                     HttpServletResponse response)
              throws ServletException,
                     IOException
Gets an XML document from the catalog.
The XML is returned within the body of the HTTP response.

Overrides:
doGet in class BaseServlet
Parameters:
request - the servlet request
response - the servlet response
Throws:
ServletException - if the request cannot be handled
IOException - if an I/O error occurs while handling the request

doPost

protected void doPost(HttpServletRequest request,
                      HttpServletResponse response)
               throws ServletException,
                      IOException
Handles a POST request.
Same as doPut().

Overrides:
doPost in class BaseServlet
Parameters:
request - the servlet request
response - the servlet response
Throws:
ServletException - if the request cannot be handled
IOException - if an I/O error occurs while handling the request

doPut

protected void doPut(HttpServletRequest request,
                     HttpServletResponse response)
              throws ServletException,
                     IOException
Publishes an XML document to the catalog.
The XML must be supplied within the body of the HTTP request.
An HTTP 200 response code is set when a document is successfully replaced.
An HTTP 201 response code is set when a document is successfully created.

Overrides:
doPut in class HttpServlet
Parameters:
request - the servlet request
response - the servlet response
Throws:
ServletException - if the request cannot be handled
IOException - if an I/O error occurs while handling the request

execute

protected void execute(HttpServletRequest request,
                       HttpServletResponse response,
                       RequestContext context)
                throws Exception
Provides a concrete executeUpdate() method to fulfill the sub-class requirement of the parent BaseServlet class. This method is never invoked, all work is handled through doGet(), doPut(), doPost() and doDelete().

Specified by:
execute in class BaseServlet
Parameters:
request - the HTTP request
response - HTTP response
context - request context
Throws:
Exception - if an exception occurs

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.