org.archive.hcc.client
Interface ClusterControllerClient

All Known Implementing Classes:
ClusterControllerClientImpl

public interface ClusterControllerClient

Author:
dbernstein

Method Summary
 void addCrawlerLifecycleListener(CrawlerLifecycleListener l)
          Adds a crawler lifecycle listener.
 void addCrawlJobListener(CurrentCrawlJobListener l)
          Adds a crawl job listener.
 Crawler createCrawler()
          Creates a new instance of the crawler.
 void destroy()
          Destroys the cluster controller bean which the client is communicating with.
 void destroyAllCrawlers()
          Issues destroy commands to all the crawlers managed by the controller.
 Crawler findCrawlJobParent(java.lang.String uid, java.net.InetSocketAddress address)
          Returns the matching crawler.
 CurrentCrawlJob getCurrentCrawlJob(Crawler crawler)
          Returns the current job running on the specified crawler.
 int getMaxInstances(java.lang.String hostname, int port)
          Returns the maximum number of instances allowed for this container.
 java.util.Collection<Crawler> listCrawlers()
          Lists all the crawler instances in the cluster.
 boolean pauseAllJobs()
           
 void removeCrawlerLifecycleListener(CrawlerLifecycleListener l)
          Removes a crawler lifecycle listener.
 void removeCrawlJobListener(CurrentCrawlJobListener l)
          Removes a crawl job listener.
 boolean resumeAllPausedJobs()
           
 void setMaxInstances(java.lang.String hostname, int port, int maxInstances)
          Sets the maximum number of instances that may run on a specified container defined by a host and port.
 

Method Detail

createCrawler

Crawler createCrawler()
                      throws InsufficientCrawlingResourcesException,
                             ClusterException
Creates a new instance of the crawler.

Returns:
Throws:
InsufficientCrawlingResourcesException - If no crawling machines have capicity for another crawler instance.
ClusterException

listCrawlers

java.util.Collection<Crawler> listCrawlers()
                                           throws ClusterException
Lists all the crawler instances in the cluster.

Returns:
Throws:
ClusterException

destroyAllCrawlers

void destroyAllCrawlers()
                        throws ClusterException
Issues destroy commands to all the crawlers managed by the controller.

Throws:
ClusterException

destroy

void destroy()
Destroys the cluster controller bean which the client is communicating with. It doesn't actually affect any objects within the cluster - ie containers, crawlers, and jobs.


findCrawlJobParent

Crawler findCrawlJobParent(java.lang.String uid,
                           java.net.InetSocketAddress address)
                           throws ClusterException
Returns the matching crawler.

Parameters:
uid - A crawl job's id.
address - The remote address of the crawler (ie not the hcc proxied address)
Returns:
The crawler or null if the parent cannot be found.
Throws:
ClusterException

getCurrentCrawlJob

CurrentCrawlJob getCurrentCrawlJob(Crawler crawler)
                                   throws ClusterException
Returns the current job running on the specified crawler. If the crawler is not found or the crawler is not currently running a job, null will be returned.

Parameters:
crawler -
Returns:
Throws:
ClusterException

addCrawlerLifecycleListener

void addCrawlerLifecycleListener(CrawlerLifecycleListener l)
Adds a crawler lifecycle listener.

Parameters:
l -

removeCrawlerLifecycleListener

void removeCrawlerLifecycleListener(CrawlerLifecycleListener l)
Removes a crawler lifecycle listener.

Parameters:
l -

addCrawlJobListener

void addCrawlJobListener(CurrentCrawlJobListener l)
Adds a crawl job listener.

Parameters:
l -

removeCrawlJobListener

void removeCrawlJobListener(CurrentCrawlJobListener l)
Removes a crawl job listener.

Parameters:
l -

getMaxInstances

int getMaxInstances(java.lang.String hostname,
                    int port)
                    throws ClusterException
Returns the maximum number of instances allowed for this container. If the container does not exist, -1 is returned.

Parameters:
hostname -
port -
Returns:
Throws:
ClusterException

setMaxInstances

void setMaxInstances(java.lang.String hostname,
                     int port,
                     int maxInstances)
                     throws ClusterException
Sets the maximum number of instances that may run on a specified container defined by a host and port.

Parameters:
hostname -
port -
maxInstances -
Throws:
ClusterException

pauseAllJobs

boolean pauseAllJobs()
                     throws ClusterException
Returns:
true if pause was successfully invoked on all running jobs.
Throws:
ClusterControllerException
ClusterException

resumeAllPausedJobs

boolean resumeAllPausedJobs()
                            throws ClusterException
Returns:
true if resume was successfully invoked on all paused or pausing jobs.
Throws:
ClusterControllerException
ClusterException


Copyright © 2005-2008 The Internet Archive. All Rights Reserved.