package jalview.ws2; import java.io.IOException; import java.util.List; import javax.print.attribute.standard.JobState; import jalview.util.MathUtils; public interface WebServiceWorkerI { public class WSJob { public final long uid = MathUtils.getUID(); protected WSJobState state = WSJobState.UNKNOWN; protected String jobID = ""; protected int jobNum = 0; protected int allowedExceptions = 3; public long getUID() { return uid; } public WSJobState getState() { return state; } public void setState(WSJobState state) { this.state = state; } public String getJobID() { return jobID; } public void setJobID(String jobID) { this.jobID = jobID; } public int getJobNum() { return jobNum; } public int getAllowedExceptions() { return allowedExceptions; } public boolean deductAllowedExceptions() { return allowedExceptions-- > 0; } public void resetAllowedExceptions() { allowedExceptions = 3; } } public long getUID(); public List getJobs(); public WSJobID startJob(WSJob job) throws IOException; public boolean pollJob(WSJob job) throws IOException; }