Imported from dev1.link2tek.net CommEngine.git
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

78 行
1.4 KiB

  1. package altk.comm.engine;
  2. /**
  3. * Derived classes may add more class attributes, e.g. list of phone numbers, call status.
  4. * @author Yuk-Ming
  5. *
  6. */
  7. public class Job
  8. {
  9. /**
  10. * Named but empty interface designed for the purpose of extending a specific enum.
  11. */
  12. public interface JobStatus
  13. {
  14. }
  15. /**
  16. * Base JobStatus values common to all CommEngine's.
  17. */
  18. static public enum CommJobStatus implements JobStatus
  19. {
  20. SUCCESS,
  21. ADDRESS_ERROR,
  22. CANCELED,
  23. EXPIRED,
  24. SERVICE_PROVIDER_PROTOCOL_ERROR,
  25. SERVICE_PROVIDER_CONNECT_ERROR,
  26. SERVICE_PROVIDER_HTTP_ERROR,
  27. SERVICE_PROVIDER_GENERATED_ERROR,
  28. SERVICE_PROVIDER_OTHER_ERROR,
  29. FORBIDDEN,
  30. UNKNOWN_ERROR,
  31. NOT_AUTHORIZED,
  32. BAD_REQUEST,
  33. ABORT,
  34. PLATFORM_ERROR,
  35. FAILED,
  36. NOT_FOUND,
  37. PAYMENT_REQUIRED;
  38. }
  39. public Recipient recipient;
  40. public long startTime;
  41. public JobStatus jobStatus;
  42. public String errorText;
  43. public Job(Recipient recipient)
  44. {
  45. this.recipient = recipient;
  46. jobStatus = null;
  47. }
  48. public void setStatus(JobStatus jobStatus)
  49. {
  50. this.jobStatus = jobStatus;
  51. }
  52. public void setStatus(JobStatus jobStatus, String errorText)
  53. {
  54. this.jobStatus = jobStatus;
  55. this.errorText = errorText;
  56. }
  57. /**
  58. *
  59. * @return error in text form.
  60. */
  61. public String getErrorText()
  62. {
  63. return errorText;
  64. }
  65. }