1 package org.fax4j;
2
3 import org.fax4j.common.Logger;
4
5
6
7
8
9
10
11
12 public final class FaxClientActionEvent extends AbstractFaxEvent {
13
14 private final FaxClientActionEventID ID;
15
16 private static final long serialVersionUID = 1L;
17
18
19
20
21
22
23
24
25
26 public enum FaxClientActionEventID {
27
28 CREATE_FAX_JOB,
29
30 SUBMIT_FAX_JOB,
31
32 SUSPEND_FAX_JOB,
33
34 RESUME_FAX_JOB,
35
36 CANCEL_FAX_JOB
37 }
38
39
40
41
42
43
44
45
46
47 public FaxClientActionEvent(FaxClientActionEventID id, FaxJob faxJob) {
48 super(faxJob);
49
50
51 if (id == null) {
52 throw new FaxException("Fax client action event ID not provided.");
53 }
54
55
56 this.ID = id;
57 }
58
59
60
61
62
63
64 public FaxClientActionEventID getID() {
65 return this.ID;
66 }
67
68
69
70
71
72
73 @Override
74 public String toString() {
75
76 StringBuilder buffer = new StringBuilder(500);
77 buffer.append("Fax Client Action Event:");
78
79
80 buffer.append(Logger.SYSTEM_EOL);
81 buffer.append("ID: ");
82 buffer.append(this.getID());
83 buffer.append(Logger.SYSTEM_EOL);
84 buffer.append(this.getFaxJob());
85
86
87 String text = buffer.toString();
88
89 return text;
90 }
91 }