Class JobResource

    • Constructor Detail

      • JobResource

        public JobResource()
    • 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 ID
        crawlId - 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 ID
        crawlId - Crawl ID
        Returns:
        true if stopped, false otherwise
      • abort

        @GET
        @Path("/{id}/abort")
        public boolean abort​(@PathParam("id")
                             String id,
                             @QueryParam("crawlId")
                             String crawlId)
      • create

        @POST
        @Path("/create")
        @Consumes("application/json")
        public JobInfo create​(JobConfig config)
        Create a new job
        Parameters:
        config - The parameters of the job to create
        Returns:
        A JSON object of the job created with its details