com.sun.faban.harness.webclient
Class RunRetriever
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
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
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 |
RunRetriever
public RunRetriever()
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 requestresponse
- 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