package altk.comm.engine; /** * Derived classes may add more class attributes, e.g. list of phone numbers, call status. * @author Yuk-Ming * */ public class Job { /** * Named but empty interface designed for the purpose of extending a specific enum. */ public interface JobStatus { } /** * Base JobStatus values common to all CommEngine's. */ static public enum CommJobStatus implements JobStatus { SUCCESS, ADDRESS_ERROR, CANCELED, EXPIRED, SERVICE_PROVIDER_PROTOCOL_ERROR, SERVICE_PROVIDER_CONNECT_ERROR, SERVICE_PROVIDER_HTTP_ERROR, SERVICE_PROVIDER_GENERATED_ERROR, SERVICE_PROVIDER_OTHER_ERROR, FORBIDDEN, UNKNOWN_ERROR, NOT_AUTHORIZED, BAD_REQUEST, ABORT, PLATFORM_ERROR, FAILED, NOT_FOUND, PAYMENT_REQUIRED; } public Recipient recipient; public long startTime; public JobStatus jobStatus; public String errorText; public Job(Recipient recipient) { this.recipient = recipient; jobStatus = null; } public void setStatus(JobStatus jobStatus) { this.jobStatus = jobStatus; } public void setStatus(JobStatus jobStatus, String errorText) { this.jobStatus = jobStatus; this.errorText = errorText; } /** * * @return error in text form. */ public String getErrorText() { return errorText; } }