package eu.simstadt.nf; /** * This job class bundles the three attributes of every nF job: Id, status and last job related nF (error) message. * * @author Marcel Bruse */ public abstract class Job { /** The status of the job. There are different states for export and import jobs. */ private JobStatus status; /** The id of the job. */ private int jobId; /** * This constructor forces the job to have a defined state. * * @param status The initial status of this job. */ public Job(JobStatus status) { this.status = status; } /** * Every job has it's status. Look up the different possible values in the JobStatus enumeration. * * @return Returns the status of this job. */ public JobStatus getStatus() { return status; } /** * Lets you set the status of this job. * * @param status The status of this job. */ protected void setStatus(JobStatus status) { this.status = status; } /** * @return Returns the id of this job. */ public int getJobId() { return jobId; } /** * Sets the id of this job. * * @param jobId The job id about to be set. */ public void setJobId(int jobId) { this.jobId = jobId; } /** * Sets the status of this job depending on the given nF status code. nF status codes will be sent * to you in http responses. Export jobs and import jobs have different states. Consider this fact * in your implementation. * * @param statusCode The nF status code for this job. */ public abstract void setStatusForCode(int statusCode); }