Class JobResource
- java.lang.Object
-
- org.apache.nutch.service.resources.AbstractResource
-
- org.apache.nutch.service.resources.JobResource
-
@Path("/job") public class JobResource extends AbstractResource
-
-
Field Summary
-
Fields inherited from class org.apache.nutch.service.resources.AbstractResource
configManager, jobManager, server
-
-
Constructor Summary
Constructors Constructor Description JobResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
abort(String id, String crawlId)
JobInfo
create(JobConfig config)
Create a new jobJobInfo
getInfo(String id, String crawlId)
Get job infoCollection<JobInfo>
getJobs(String crawlId)
Get job history for a given job regardless of the jobs stateboolean
stop(String id, String crawlId)
Stop Job-
Methods inherited from class org.apache.nutch.service.resources.AbstractResource
throwBadRequestException
-
-
-
-
Method Detail
-
getJobs
@GET @Path("/") public Collection<JobInfo> getJobs(@QueryParam("crawlId") String crawlId)
Get job history for a given job regardless of the jobs state- Parameters:
crawlId
- a crawlId- Returns:
- A nested JSON object of all the jobs created for that crawlId
-
getInfo
@GET @Path("/{id}") public JobInfo getInfo(@PathParam("id") String id, @QueryParam("crawlId") String crawlId)
Get job info- Parameters:
id
- Job IDcrawlId
- Crawl ID- Returns:
- A JSON object of job parameters
-
stop
@GET @Path("/{id}/stop") public boolean stop(@PathParam("id") String id, @QueryParam("crawlId") String crawlId)
Stop Job- Parameters:
id
- Job IDcrawlId
- Crawl ID- Returns:
- true if stopped, false otherwise
-
abort
@GET @Path("/{id}/abort") public boolean abort(@PathParam("id") String id, @QueryParam("crawlId") String crawlId)
-
-