1 /********************************************************************************
2 * $Id: Job.java 98 2008-02-27 06:11:26Z sjardine $
3 *
4 * Copyright 2001-2003 Innovation Software Group, LLC - http://www.innovationsw.com
5 * Copyright 2001-2003 Joe Phillips <jaiger@innovationsw.com>
6 * Copyright 2008 Steven Jardine, MJN Services, Inc. <steve@mjnservices.com>
7 *
8 * All rights reserved. This program and the accompanying materials are made
9 * available under the terms of the GNU Lesser Public License v2.1 which
10 * accompanies this distribution, and is available at
11 * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
12 *
13 * For more information on the HylaFAX Fax Server please see
14 * HylaFAX - http://www.hylafax.org or
15 * Hylafax+ - http://hylafax.sourceforge.net
16 *
17 * Contributors:
18 * Joe Phillips - Initial API and implementation
19 * Steven Jardine - Code formatting, rework of license header, javadoc
20 ******************************************************************************/
21 package gnu.hylafax;
22
23 import gnu.inet.ftp.ServerResponseException;
24
25 import java.awt.Dimension;
26 import java.io.IOException;
27 import java.util.Date;
28
29 /***
30 * Defines a FAX Job.
31 *
32 * @version $Revision: 98 $
33 * @author Joe Phillips <jaiger@innovationsw.com>
34 * @author Steven Jardine <steve@mjnservices.com>
35 */
36 public interface Job {
37
38 public static int PRIORITY_NORMAL = 127;
39
40 public static int PRIORITY_BULK = 207;
41
42 public static int PRIORITY_HIGH = 63;
43
44 public static int RESOLUTION_LOW = 98;
45
46 public static int RESOLUTION_MEDIUM = 196;
47
48 public static String NOTIFY_NONE = ClientProtocol.NOTIFY_NONE;
49
50 public static String NOTIFY_DONE = ClientProtocol.NOTIFY_DONE;
51
52 public static String NOTIFY_REQUEUE = ClientProtocol.NOTIFY_REQUEUE;
53
54 public static String NOTIFY_ALL = ClientProtocol.NOTIFY_ALL;
55
56 public static String CHOP_DEFAULT = "default";
57
58 public String getFromUser() throws ServerResponseException, IOException;
59
60 public String getKilltime() throws ServerResponseException, IOException;
61
62 public int getMaximumDials() throws ServerResponseException, IOException;
63
64 public int getMaximumTries() throws ServerResponseException, IOException;
65
66 public int getPriority() throws ServerResponseException, IOException;
67
68 public String getDialstring() throws ServerResponseException, IOException;
69
70 public String getNotifyAddress() throws ServerResponseException,
71 IOException;
72
73 public int getVerticalResolution() throws ServerResponseException,
74 IOException;
75
76 public Dimension getPageDimension() throws ServerResponseException,
77 IOException;
78
79 public int getPageWidth() throws ServerResponseException, IOException;
80
81 public int getPageLength() throws ServerResponseException, IOException;
82
83 public String getNotifyType() throws ServerResponseException, IOException;
84
85 public String getPageChop() throws ServerResponseException, IOException;
86
87 public int getChopThreshold() throws ServerResponseException, IOException;
88
89 public String getDocumentName() throws ServerResponseException, IOException;
90
91 public String getRetrytime() throws ServerResponseException, IOException;
92
93 /***
94 * Get JobInfo attribute. JobInfo is an identifying string associated with
95 * the job.
96 */
97 public String getJobInfo() throws ServerResponseException, IOException;
98
99 /***
100 * Get TagLine format attribute. The TagLine
101 */
102 public String getTagline() throws ServerResponseException, IOException;
103
104 /***
105 * Get the UseTagLine attribute. The TagLine
106 */
107 public boolean getUseTagline() throws ServerResponseException, IOException;
108
109 /***
110 * Get the value for an arbitrary property for this job. Developers using
111 * this method should be familiar with the HylaFAX client protocol in order
112 * to provide the correct key values and how to interpret the values
113 * returned. This method is thread-safe.
114 *
115 * @exception ServerResponseException
116 * the server responded with an error. This is likely due
117 * to a protocol error.
118 * @exception IOException
119 * an i/o error occured
120 * @return a String value for the given property key
121 */
122 public String getProperty(String key) throws ServerResponseException,
123 IOException;
124
125 /***
126 * get the job-id of this Job instance.
127 *
128 * @return job id
129 */
130 public long getId();
131
132 public void setFromUser(String value) throws ServerResponseException,
133 IOException;
134
135 public void setKilltime(String value) throws ServerResponseException,
136 IOException;
137
138 public void setMaximumDials(int value) throws ServerResponseException,
139 IOException;
140
141 public void setMaximumTries(int value) throws ServerResponseException,
142 IOException;
143
144 public void setPriority(int value) throws ServerResponseException,
145 IOException;
146
147 public void setDialstring(String value) throws ServerResponseException,
148 IOException;
149
150 public void setNotifyAddress(String value) throws ServerResponseException,
151 IOException;
152
153 public void setVerticalResolution(int value)
154 throws ServerResponseException, IOException;
155
156 /***
157 * Set the job's pagesize.
158 *
159 * @see Pagesize for common pagesizes
160 */
161 public void setPageDimension(Dimension value)
162 throws ServerResponseException, IOException;
163
164 public void setPageWidth(int width) throws ServerResponseException,
165 IOException;
166
167 public void setPageLength(int length) throws ServerResponseException,
168 IOException;
169
170 /***
171 * set the notification type. For possible values, see the NOTIFY_* members
172 * of this class.
173 *
174 * @param value
175 * the new notification type
176 * @exception ServerResponseException
177 * the server responded with an error. This is likely a
178 * protocol violation.
179 * @exception IOException
180 * an IO error occurred while communicating with the
181 * server
182 */
183 public void setNotifyType(String value) throws ServerResponseException,
184 IOException;
185
186 public void setPageChop(String value) throws ServerResponseException,
187 IOException;
188
189 public void setChopThreshold(int value) throws ServerResponseException,
190 IOException;
191
192 public void addDocument(String value) throws ServerResponseException,
193 IOException;
194
195 public void setRetrytime(String value) throws ServerResponseException,
196 IOException;
197
198 /***
199 * Set the JobInfo attribute. This is an identifying string associated with
200 * each job.
201 */
202 public void setJobInfo(String value) throws ServerResponseException,
203 IOException;
204
205 /***
206 * Set the TagLine format attribute. This property specifies the format of
207 * the tagline rendered at the top of each page of the transmitted FAX.
208 * Tagline format strings are documented in config(5F). If you use this, you
209 * will probably want to use setUseTagline()
210 */
211 public void setTagline(String value) throws ServerResponseException,
212 IOException;
213
214 /***
215 * Set the UseTagLine format attribute. This is an
216 */
217 public void setUseTagline(boolean f) throws ServerResponseException,
218 IOException;
219
220 /***
221 * Set any arbitrary property on this job. In order to use this method,
222 * developers should be familiar with the HylaFAX client protocol. This
223 * method is thread-safe.
224 *
225 * @exception ServerResponseException
226 * the server responded with an error code. This is
227 * likely a protocol violation.
228 * @exception IOException
229 * an i/o error occured
230 */
231 public void setProperty(String parameter, String value)
232 throws ServerResponseException, IOException;
233
234 /***
235 * Set any arbitrary property on this job to an integer value. In order to
236 * use this method, developers should be familiar with the HylaFAX client
237 * protocol. This method is thread-safe.
238 *
239 * @exception ServerResponseException
240 * the server responded with an error code. This is
241 * likely a protocol violation.
242 * @exception IOException
243 * an i/o error occured
244 */
245 public void setProperty(String property, int value)
246 throws ServerResponseException, IOException;
247
248 /***
249 * Set the SENDTIME attribute. This allows for queuing up faxes and sending
250 * them at a specific time.
251 *
252 * @param sendTime
253 * @throws ServerResponseException
254 * the server responded with an error code. This is likely a
255 * protocol violation.
256 * @throws IOException
257 * an i/o error occured
258 */
259 public void setSendTime(Date sendTime) throws ServerResponseException,
260 IOException;
261
262 /***
263 * Set the SENDTIME attribute. Must be in the format yyyyMMddHHmm and in GMT
264 * time. This allows for queuing up faxes and sending them at a specific
265 * time.
266 *
267 * @param sendTime
268 * @throws ServerResponseException
269 * the server responded with an error code. This is likely a
270 * protocol violation.
271 * @throws IOException
272 * an i/o error occured
273 */
274 public void setSendTime(String sendTime) throws ServerResponseException,
275 IOException;
276
277 }