|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.archive.hcc.client.ClusterControllerClientImpl
class ClusterControllerClientImpl
As the workhorse of the cluster controller client, this class is responsible
for connecting to the local or remote ClusterControllerBean
via
its DynamicMBean
interface. It hides all the details of
connecting to the remote MBean, ie invocations and notifications.
Constructor Summary | |
---|---|
ClusterControllerClientImpl()
Creates a local instance of the ClusterControllerBean and attaches to it. |
|
ClusterControllerClientImpl(java.net.InetSocketAddress address)
Constructs a client running on a remote machine. |
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. |
CrawlerImpl |
findCrawlJobParentInternal(java.lang.String uid,
java.net.InetSocketAddress address)
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
ClusterControllerClientImpl(java.net.InetSocketAddress address) throws javax.management.InstanceNotFoundException, java.io.IOException
address
-
javax.management.InstanceNotFoundException
java.io.IOException
ClusterControllerClientImpl()
Method Detail |
---|
public void addCrawlerLifecycleListener(CrawlerLifecycleListener l)
ClusterControllerClient
addCrawlerLifecycleListener
in interface ClusterControllerClient
public void removeCrawlerLifecycleListener(CrawlerLifecycleListener l)
ClusterControllerClient
removeCrawlerLifecycleListener
in interface ClusterControllerClient
public void addCrawlJobListener(CurrentCrawlJobListener l)
ClusterControllerClient
addCrawlJobListener
in interface ClusterControllerClient
public void removeCrawlJobListener(CurrentCrawlJobListener l)
ClusterControllerClient
removeCrawlJobListener
in interface ClusterControllerClient
public void destroyAllCrawlers() throws ClusterException
ClusterControllerClient
destroyAllCrawlers
in interface ClusterControllerClient
ClusterException
public boolean pauseAllJobs() throws ClusterException
pauseAllJobs
in interface ClusterControllerClient
ClusterException
public boolean resumeAllPausedJobs() throws ClusterException
resumeAllPausedJobs
in interface ClusterControllerClient
ClusterException
public Crawler findCrawlJobParent(java.lang.String uid, java.net.InetSocketAddress address) throws ClusterException
ClusterControllerClient
findCrawlJobParent
in interface ClusterControllerClient
uid
- A crawl job's id.address
- The remote address of the crawler (ie not the hcc proxied address)
ClusterException
public CrawlerImpl findCrawlJobParentInternal(java.lang.String uid, java.net.InetSocketAddress address) throws ClusterException
ClusterException
public Crawler createCrawler() throws InsufficientCrawlingResourcesException, ClusterException
ClusterControllerClient
createCrawler
in interface ClusterControllerClient
InsufficientCrawlingResourcesException
- If no crawling machines have capicity for another crawler instance.
ClusterException
public java.util.Collection<Crawler> listCrawlers() throws ClusterException
ClusterControllerClient
listCrawlers
in interface ClusterControllerClient
ClusterException
public void destroy()
ClusterControllerClient
destroy
in interface ClusterControllerClient
public CurrentCrawlJob getCurrentCrawlJob(Crawler crawler) throws ClusterException
ClusterControllerClient
getCurrentCrawlJob
in interface ClusterControllerClient
ClusterException
public int getMaxInstances(java.lang.String hostname, int port) throws ClusterException
getMaxInstances
in interface ClusterControllerClient
hostname
- port
-
ClusterException
public void setMaxInstances(java.lang.String hostname, int port, int maxInstances) throws ClusterException
setMaxInstances
in interface ClusterControllerClient
hostname
- port
- maxInstances
-
ClusterException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |