ZetaGrid v1.9

zeta.handler
Class SynchronizationHandler

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

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

Handles a GET and a POST request to synchronize the data of this server with the data of another server. The GET request req can contain the following parameters:

Then the synchronized data are cleaned up. Or the GET request contains no parameter, then the synchronization data of this server will be generated. The response resp contains the parameters (size of the not aligned data, timestamp, successful, data) of the new work units. The POST request must contains the following parameters which are transfered at the header name 'Param-String': The response contains an 'ok' or an error. The data will be sequentially synchronized.


Field Summary
private  ZetaServlet servlet
          Servlet which owns this handler.
 
Constructor Summary
SynchronizationHandler(ZetaServlet servlet)
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Handles a GET request to synchronize the data of this server with the data of another server.
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Handles a POST request to synchronize the data of this server with the data of 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

SynchronizationHandler

public SynchronizationHandler(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 a GET request to synchronize the data of this server with the data of another server. The request req must contains the following parameters: Then the synchronized data are cleaned up. Or the GET request contains no parameter, then the synchronization data of this server will be generated. The response resp contains the parameters (size of data, timestamp, successful, data) of the new work units.

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 synchronize the data of this server with the data of another server. The request must contains the following parameters which are transfered at the header name 'Param-String': The response resp contains an 'ok' or an error. The data will be sequentially synchronized.

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.