org.galagosearch.tupleflow.execution
Class MasterWebHandler

java.lang.Object
  extended by org.mortbay.component.AbstractLifeCycle
      extended by org.mortbay.jetty.handler.AbstractHandler
          extended by org.galagosearch.tupleflow.execution.MasterWebHandler
All Implemented Interfaces:
org.mortbay.component.LifeCycle, org.mortbay.jetty.Handler

public class MasterWebHandler
extends org.mortbay.jetty.handler.AbstractHandler

This handler creates a web interface for checking on the status of a running TupleFlow job.

Author:
trevor

Nested Class Summary
static class MasterWebHandler.CounterName
           
 
Field Summary
 
Fields inherited from class org.mortbay.jetty.handler.AbstractHandler
_string
 
Fields inherited from interface org.mortbay.jetty.Handler
ALL, DEFAULT, ERROR, FORWARD, INCLUDE, REQUEST
 
Constructor Summary
MasterWebHandler(JobExecutor.JobExecutionStatus status)
           
 
Method Summary
 long getLastPageLoad()
           
 void handle(java.lang.String target, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, int dispatch)
           
 void handleSetCounter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void handleStatus(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void setLastPageLoad(long value)
           
 void waitForFinalPage()
          Waits a bit longer for someone to load a final status page.
 
Methods inherited from class org.mortbay.jetty.handler.AbstractHandler
destroy, doStart, doStop, getServer, setServer, toString
 
Methods inherited from class org.mortbay.component.AbstractLifeCycle
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mortbay.component.LifeCycle
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop
 

Constructor Detail

MasterWebHandler

public MasterWebHandler(JobExecutor.JobExecutionStatus status)
Method Detail

setLastPageLoad

public void setLastPageLoad(long value)

getLastPageLoad

public long getLastPageLoad()

waitForFinalPage

public void waitForFinalPage()

Waits a bit longer for someone to load a final status page.

This method should be called immediately after a job is complete. If the page was loaded recently and the job wasn't complete, this method will wait up to 15 seconds for the browser to load the indexing complete page, which has no auto-refresh logic. This avoids the ugly experience of showing a "cannot connect to server" error in the browser after indexing completes.


handleSetCounter

public void handleSetCounter(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws java.io.IOException
Throws:
java.io.IOException

handleStatus

public void handleStatus(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)
                  throws java.io.IOException
Throws:
java.io.IOException

handle

public void handle(java.lang.String target,
                   javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response,
                   int dispatch)
            throws java.io.IOException,
                   javax.servlet.ServletException
Throws:
java.io.IOException
javax.servlet.ServletException


Copyright © 2009. All Rights Reserved.