1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.archive.hcc.client;
24
25 import java.util.Collection;
26
27 /***
28 * An interface representing an instance of a Crawler.
29 *
30 * @author Daniel Bernstein (dbernstein@archive.org)
31 */
32 public interface Crawler extends Proxy {
33 /***
34 * Starts the pending job queue. Does nothing
35 * if the queue is already started.
36 */
37 public void startPendingJobQueue();
38
39 /***
40 * Stops the pending job queue. Does nothing if the
41 * queue is already stopped.
42 *
43 */
44 public void stopPendingJobQueue();
45
46 /***
47 * Returns true if the pending job queue is running.
48 * @return
49 */
50 public boolean isPendingJobQueueRunning();
51
52 /***
53 * Adds a job to the pending job queue.
54 * @param order
55 * @return
56 */
57 public String addJob(JobOrder order);
58
59 /***
60 * Terminates the currently running job. Does nothing if
61 * if no job is currently running.
62 */
63 public void terminateCurrentJob();
64
65 /***
66 * Returns true if the crawler has a currently running job.
67 * @return
68 */
69 public boolean isCrawling();
70
71 /***
72 * Returns the Heritrix version.
73 * @return
74 */
75 public String getVersion();
76
77 /***
78 * Destroys the crawler instance and all dependent objects.
79 *
80 */
81 public void destroy();
82
83 /***
84 * Deletes a job from the pending queue.
85 * @param job
86 * @return
87 */
88 public boolean deletePendingCrawlJob(PendingCrawlJob job);
89
90 /***
91 * Deletes a job from the completed list.
92 * @param job
93 * @return
94 * @throws ClusterException
95 */
96 public boolean deleteCompletedCrawlJob(CompletedCrawlJob job) throws ClusterException;
97
98 /***
99 * Returns a list of pending jobs.
100 * @return
101 */
102 public Collection<PendingCrawlJob> listPendingCrawlJobs();
103
104 /***
105 * Returns a list of completed jobs.
106 * @return
107 */
108 public Collection<CompletedCrawlJob> listCompletedCrawlJobs();
109 }