ZetaGrid v1.9

zeta.handler
Class DataHandler

java.lang.Object
  |
  +--zeta.handler.DataHandler
All Implemented Interfaces:
GetHandler, PostHandler

public class DataHandler
extends java.lang.Object
implements GetHandler, PostHandler

Handles GET requests to retrieve work units of another server. The GET request req can contain the following parameters:

The response resp contains alist of work units or the data of a specified work unit.


Field Summary
private  ZetaServlet servlet
          Servlet which owns this handler.
 
Constructor Summary
DataHandler(ZetaServlet servlet)
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Handles GET requests to retrieve work units of another server.
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Handles a POST request to put work units from another server.
private static java.lang.String getParameter(java.util.Map parameter, java.lang.String key)
          Returns a value for a key from the specified map with parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servlet

private ZetaServlet servlet
Servlet which owns this handler.

Constructor Detail

DataHandler

public DataHandler(ZetaServlet servlet)
Parameters:
servlet - servlet which owns this handler.
Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse resp)
           throws javax.servlet.ServletException,
                  java.io.IOException
Handles GET requests to retrieve work units of another server. The GET request req can contain the following parameters: The response resp contains a list of work units or the data of a specified work unit.

Specified by:
doGet in interface GetHandler
javax.servlet.ServletException
java.io.IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse resp)
            throws javax.servlet.ServletException,
                   java.io.IOException
Handles a POST request to put work units from another server. The POST request req can contain the following parameters: The response resp contains an 'ok' or an error.

Specified by:
doPost in interface PostHandler
javax.servlet.ServletException
java.io.IOException

getParameter

private static java.lang.String getParameter(java.util.Map parameter,
                                             java.lang.String key)
Returns a value for a key from the specified map with parameters.

Parameters:
parameter - map with parameters
key - key
Returns:
value for a key from the specified map with parameters; empty string if no value was found.

ZetaGrid v1.9

For further technical papers, see ZetaGrid Technical Documentation.
 
Copyright © 2001,2002 Sebastian Wedeniwski. All Rights Reserved.