com.sun.faban.harness.webclient
Class RunRetriever

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.sun.faban.harness.webclient.RunRetriever
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class RunRetriever
extends HttpServlet

This class represents both the servlet that allows fetching runs from the run queue and the client side utility pollRun used to retrieve remote runs.

Author:
Akara Sucharitakul
See Also:
Serialized Form

Constructor Summary
RunRetriever()
           
 
Method Summary
 void doPost(HttpServletRequest request, HttpServletResponse response)
          Post method to retrieve a run for a remote queue.
static File jar(Run run)
          Jars up the run directory.
static File pollRun(long localAge)
          Client side method to poll for the oldest run which must be older than localAge.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, 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

RunRetriever

public RunRetriever()
Method Detail

doPost

public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
            throws ServletException,
                   IOException
Post method to retrieve a run for a remote queue. Used only by pollees.

Overrides:
doPost in class HttpServlet
Parameters:
request - The servlet request
response - The servlet response
Throws:
ServletException - If there is an error in the servlet
IOException - If the servlet has an I/O error

jar

public static File jar(Run run)
                throws IOException
Jars up the run directory.

Parameters:
run - The run to jar up
Returns:
The resulting jar file
Throws:
IOException - Error creating the jar

pollRun

public static File pollRun(long localAge)
Client side method to poll for the oldest run which must be older than localAge. If found, the run will be downloaded into the temp space. and the run name will be returned.

Parameters:
localAge - The age of the oldest local run in the queue
Returns:
The file reference to the local run in the directory