ArcGIS Server Geoportal extension
10

com.esri.gpt.control.harvest.servlets.service
Class HarvesterServlet

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.harvest.servlets.service.HarvesterServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

Deprecated. since 10.0 with no intent to replace

public class HarvesterServlet
extends BaseServlet

Handles HTTP requests.

Intercepts and parses command camming from Harvester Service. Any command has a form of XML string stored in the HTTP request parameter called: "xml_data_post". There are three commands available:

This class has to be registered as a legal servlet. Refer to your web server documentation for further instructions. For Tomcat Web Application Deployment Descriptor see: http://tomcat.apache.org/tomcat-5.0-doc/appdev/deployment.html

Command Quick Reference

This reference describes formats of XML requests and XML responses as a part of Harvester Command Parser.

authenticateAdministrator

Authenticate is a first command 'Harvester Service' should invoke to obtain authorization token. This token comes back as a cookie stored in request. Information stored in this cookie should be just included in further requests submited to Harvester Servlet.

Query:

<?xml version="1.0" encoding="UTF-8" ?>
<request>
<authenticateAdministrator>
</authenticateAdministrator>
</request>

Response:

If authentication succeeded (credentials and access rights confirmed):
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<authenticateAdministrator>
<status>1 (NUMERIC)</status>
<maxThreads>maximum threads (NUMERIC)</maxThreads>
</authenticateAdministrator>
</response>

If authentication failed (invalid user id or password):
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<authenticateAdministrator>
<status>0 (NUMERIC)</status>
<error>error message</error>
</authenticateAdministrator>
</response>

nextJob

Retrieves next job. Job contains information about site to harvest, job id, and job type.
Job type could be 'full harvest' (1) or 'harvest' (0).

Query:

<?xml version="1.0" encoding="UTF-8" ?>
<request>
<nextJob>
</nextJob>
</request>

Response:

If next job exists:
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<nextJob>
<jobId>job identifier (NUMERIC)</jobId>
<siteId>site identifier (NUMERIC)</siteId>
<fullHarvest>1 - for full harvest, otherwise 0</fullHarvest>
</nextJob>
</response>

If next job doesn't exists:
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<nextJob>
<error>error message</error>
</nextJob>
</response>

setJob

Changes job's status. Job status could be: pending, running, or completed.

Query:

<?xml version="1.0" encoding="UTF-8" ?>
<request>
<setJob>
<jobId>job identifier (NUMERIC)</jobId>
<jobStatus>job status: 0-pending, 1-running, 2-completed(NUMERIC)</jobStatus>
</setJob>
</request>

Response:

If operation succeeded:
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<setJob>
<jobId>job identifier (NUMERIC)</jobId>
<jobStatus>job status: 0-pending, 1-running, 2-completed(NUMERIC)</jobStatus>
</setJob>
</response>

If operation failed:
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<setJob>
<error>error message</error>
</setJob>
</response>

recover

Recovers failed harvesting.

Query:

<?xml version="1.0" encoding="UTF-8" ?>
<request>
<recover>
<serviceId>service identifier (NUMERIC)</serviceId>
</recover>
</request>

Response:

If operation succeeded:
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<recover>
<status>1 (NUMERIC)</status>
<serviceId>service identifier (NUMERIC)</serviceId>
</recover>
</response>

If operation failed:
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<recover>
<status>0 (NUMERIC)</status>
<serviceId>service identifier (NUMERIC)</serviceId>
</recover>
</response>

Exceptions and errors handling

In case when during performing any of the operation above and exception is thrown, enformation about exception is being returned to the caller:

<?xml version="1.0" encoding="UTF-8" ?>
<exception>exception message</exception>

If user has not been authorized submit request, the following information is being returned to the caller:

<?xml version="1.0" encoding="UTF-8" ?>
<response>
<command>
<error><![CDATA[User not authorized to perform operation.]]></error>
</command>
</response>

See Also:
Serialized Form

Constructor Summary
HarvesterServlet()
          Deprecated.  
 
Method Summary
protected  void execute(HttpServletRequest request, HttpServletResponse response, RequestContext context)
          Deprecated. Process the HTTP request request.
 
Methods inherited from class com.esri.gpt.framework.context.BaseServlet
authenticate, doGet, doPost, getCredentials, getLogger, getParameterValue, getRealm, readInputCharacters, writeCharacterResponse, writeHtmlResponse, writeXmlResponse
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, 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

HarvesterServlet

public HarvesterServlet()
Deprecated. 
Method Detail

execute

protected void execute(HttpServletRequest request,
                       HttpServletResponse response,
                       RequestContext context)
                throws IOException,
                       CredentialsDeniedException,
                       NotAuthorizedException
Deprecated. 
Process the HTTP request request.

Specified by:
execute in class BaseServlet
Parameters:
request - HTTP request.
response - HTTP response.
context - request context
Throws:
ServletException - if error invoking command.
IOException - if error writing to the buffer.
CredentialsDeniedException - if user not authenticated
NotAuthorizedException - if user not authorized

ArcGIS Server Geoportal extension
10

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