All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jirvan.jobpool.JobPoolController Maven / Gradle / Ivy

The newest version!
package com.jirvan.jobpool;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class JobPoolController {

    @RequestMapping(value = "/jobpool/getJobDetails", method = RequestMethod.POST)
    public @ResponseBody JobPool.Job getJobDetails(@RequestBody Long jobId) {

        JobPool.Job job = JobPool.commonJobPool.getJob(jobId);
        if (job != null) {
            return job;
        } else {
            throw new RuntimeException(String.format("Job \"%s\" not found", jobId));
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy