org.apache.oodt.cas.pushpull.daemon
Class DaemonController

java.lang.Object
  extended by org.apache.oodt.cas.pushpull.daemon.DaemonController

public class DaemonController
extends Object

Author:
bfoster

After the CrawlDaemon has been started, this class can control the CrawlDaemon through webserver communication, thus it can be control from computers other than the one it is executing on. This class has control over pausing, resuming, and killing the CrawlDaemon process. It also has the ability of getting the status on several variables within the CrawlDaemon class. See CrawlDaemon for more info.

.

Constructor Summary
DaemonController(String rmiUrl)
          Constructor -- initializes the XmlRpcClient
 
Method Summary
 long getAverageRunTime()
          Get the average time for each run of the Crawler controlled by the CrawlDaemons
 long getDaemonCreationTime()
          Gets the time in milliseconds of when the CrawlDaemon was created
 long getMillisCrawling()
          Gets the total milliseconds for which the Crawler in CrawlDaemon has been crawling since the CrawlDaemon was created.
 int getNumCrawls()
          Gets the numbers of times the Crawler has been run by the CrawlDaemon
 long getWaitInterval()
          Gets the time between the start of each scheduled run.
 boolean isRunning()
          Used to determine if the Crawler in the CrawlDaemon is running
static void main(String[] args)
          Driver method -- starts the CrawlDaemonController
 void quit()
           
 void resume()
          Wakes the CrawlDaemon up and tells it to start crawling again.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DaemonController

public DaemonController(String rmiUrl)
                 throws RemoteException
Constructor -- initializes the XmlRpcClient

Parameters:
crawlUrlStr - The URL location where the CrawlDaemon server is running
Throws:
InstantiationException
RemoteException
Method Detail

getAverageRunTime

public long getAverageRunTime()
                       throws RemoteException
Get the average time for each run of the Crawler controlled by the CrawlDaemons

Returns:
Average runtime of Crawler
Throws:
RemoteException
XmlRpcCommunicationException - Error communicating with server

getMillisCrawling

public long getMillisCrawling()
                       throws RemoteException
Gets the total milliseconds for which the Crawler in CrawlDaemon has been crawling since the CrawlDaemon was created.

Returns:
The total milliseconds which the Crawler has been crawling
Throws:
RemoteException
XmlRpcCommunicationException - Error communicating with server

getWaitInterval

public long getWaitInterval()
                     throws RemoteException
Gets the time between the start of each scheduled run.

Returns:
The time between the start of each execution of the Crawler controlled by the CrawlDaemon
Throws:
RemoteException
XmlRpcCommunicationException - Error communicating with server

getNumCrawls

public int getNumCrawls()
                 throws RemoteException
Gets the numbers of times the Crawler has been run by the CrawlDaemon

Returns:
The of times Crawler has executed
Throws:
RemoteException
XmlRpcCommunicationException - Error communicating with server

isRunning

public boolean isRunning()
                  throws RemoteException
Used to determine if the Crawler in the CrawlDaemon is running

Returns:
true is Crawler is running
Throws:
RemoteException
XmlRpcCommunicationException - Error communicating with server

resume

public void resume()
            throws RemoteException
Wakes the CrawlDaemon up and tells it to start crawling again. If stop() was called, this method will have the CrawlDaemon continue from where it left off. This method will also wake up the CrawlDaemon from its sleep between scheduled runs.

Throws:
RemoteException
XmlRpcCommunicationException - Error communicating with server

quit

public void quit()
          throws RemoteException
Throws:
RemoteException

getDaemonCreationTime

public long getDaemonCreationTime()
                           throws RemoteException
Gets the time in milliseconds of when the CrawlDaemon was created

Returns:
The time the CrawlDaemon was created
Throws:
RemoteException
XmlRpcCommunicationException - Error communicating with server

main

public static void main(String[] args)
                 throws Exception
Driver method -- starts the CrawlDaemonController

Parameters:
args - See documentation
Throws:
Exception - On error! :)


Copyright © 1999-2011 Apache Incubator. All Rights Reserved.