KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > print > attribute > standard > PrinterStateReason


1 /*
2  * @(#)PrinterStateReason.java 1.10 04/05/05
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.print.attribute.standard;
8
9 import javax.print.attribute.EnumSyntax JavaDoc;
10 import javax.print.attribute.Attribute JavaDoc;
11
12 /**
13  * Class PrinterStateReason is a printing attribute class, an enumeration,
14  * that provides additional information about the printer's current state,
15  * i.e., information that augments the value of the printer's
16  * {@link PrinterState PrinterState} attribute.
17  * Class PrinterStateReason defines standard printer
18  * state reason values. A Print Service implementation only needs to report
19  * those printer state reasons which are appropriate for the particular
20  * implementation; it does not have to report every defined printer state
21  * reason.
22  * <P>
23  * Instances of PrinterStateReason do not appear in a Print Service's
24  * attribute set directly.
25  * Rather, a {@link PrinterStateReasons PrinterStateReasons}
26  * attribute appears in the Print Service's attribute set. The {@link
27  * PrinterStateReasons PrinterStateReasons} attribute contains zero, one, or
28  * more than one PrinterStateReason objects which pertain to the
29  * Print Service's status, and each PrinterStateReason object is
30  * associated with a {@link Severity Severity} level of REPORT (least severe),
31  * WARNING, or ERROR (most severe). The printer adds a PrinterStateReason
32  * object to the Print Service's
33  * {@link PrinterStateReasons PrinterStateReasons} attribute when the
34  * corresponding condition becomes true of the printer, and the printer
35  * removesthe PrinterStateReason object again when the corresponding
36  * condition becomes false, regardless of whether the Print Service's overall
37  * {@link PrinterState PrinterState} also changed.
38  * <P>
39  * <B>IPP Compatibility:</B>
40  * The string values returned by each individual {@link PrinterStateReason} and
41  * associated {@link Severity} object's <CODE>toString()</CODE>
42  * methods, concatenated together with a hyphen (<CODE>"-"</CODE>) in
43  * between, gives the IPP keyword value for a {@link PrinterStateReasons}.
44  * The category name returned by <CODE>getName()</CODE> gives the IPP
45  * attribute name.
46  * <P>
47  *
48  * @author Alan Kaminsky
49  */

50 public class PrinterStateReason extends EnumSyntax JavaDoc implements Attribute JavaDoc {
51
52     private static final long serialVersionUID = -1623720656201472593L;
53
54     /**
55      * The printer has detected an error other than ones listed below.
56      */

57     public static final PrinterStateReason JavaDoc OTHER = new PrinterStateReason JavaDoc(0);
58
59     /**
60      * A tray has run out of media.
61      */

62     public static final PrinterStateReason JavaDoc
63     MEDIA_NEEDED = new PrinterStateReason JavaDoc(1);
64
65     /**
66      * The device has a media jam.
67      */

68     public static final PrinterStateReason JavaDoc
69     MEDIA_JAM = new PrinterStateReason JavaDoc(2);
70
71     /**
72      * Someone has paused the printer, but the device(s) are taking an
73      * appreciable time to stop. Later, when all output has stopped,
74      * the {@link PrinterState PrinterState} becomes STOPPED,
75      * and the PAUSED value replaces
76      * the MOVING_TO_PAUSED value in the {@link PrinterStateReasons
77      * PrinterStateReasons} attribute. This value must be supported if the
78      * printer can be paused and the implementation takes significant time to
79      * pause a device in certain circumstances.
80      */

81     public static final PrinterStateReason JavaDoc
82     MOVING_TO_PAUSED = new PrinterStateReason JavaDoc(3);
83
84     /**
85      * Someone has paused the printer and the printer's {@link PrinterState
86      * PrinterState} is STOPPED. In this state, a printer must not produce
87      * printed output, but it must perform other operations requested by a
88      * client. If a printer had been printing a job when the printer was
89      * paused,
90      * the Printer must resume printing that job when the printer is no longer
91      * paused and leave no evidence in the printed output of such a pause.
92      * This value must be supported if the printer can be paused.
93      */

94     public static final PrinterStateReason JavaDoc
95     PAUSED = new PrinterStateReason JavaDoc(4);
96
97     /**
98      * Someone has removed a printer from service, and the device may be
99      * powered down or physically removed.
100      * In this state, a printer must not produce
101      * printed output, and unless the printer is realized by a print server
102      * that is still active, the printer must perform no other operations
103      * requested by a client.
104      * If a printer had been printing a job when it was shut down,
105      * the printer need not resume printing that job when the printer is no
106      * longer shut down. If the printer resumes printing such a job, it may
107      * leave evidence in the printed output of such a shutdown, e.g. the part
108      * printed before the shutdown may be printed a second time after the
109      * shutdown.
110      */

111     public static final PrinterStateReason JavaDoc
112     SHUTDOWN = new PrinterStateReason JavaDoc(5);
113
114     /**
115      * The printer has scheduled a job on the output device and is in the
116      * process of connecting to a shared network output device (and might not
117      * be able to actually start printing the job for an arbitrarily long time
118      * depending on the usage of the output device by other servers on the
119      * network).
120      */

121     public static final PrinterStateReason JavaDoc
122     CONNECTING_TO_DEVICE = new PrinterStateReason JavaDoc(6);
123
124     /**
125      * The server was able to connect to the output device (or is always
126      * connected), but was unable to get a response from the output device.
127      */

128     public static final PrinterStateReason JavaDoc
129     TIMED_OUT = new PrinterStateReason JavaDoc(7);
130
131     /**
132      * The printer is in the process of stopping the device and will be
133      * stopped in a while.
134      * When the device is stopped, the printer will change the
135      * {@link PrinterState PrinterState} to STOPPED. The STOPPING reason is
136      * never an error, even for a printer with a single output device. When an
137      * output device ceases accepting jobs, the printer's {@link
138      * PrinterStateReasons PrinterStateReasons} will have this reason while
139      * the output device completes printing.
140      */

141     public static final PrinterStateReason JavaDoc
142     STOPPING = new PrinterStateReason JavaDoc(8);
143
144     /**
145      * When a printer controls more than one output device, this reason
146      * indicates that one or more output devices are stopped. If the reason's
147      * severity is a report, fewer than half of the output devices are
148      * stopped.
149      * If the reason's severity is a warning, half or more but fewer than
150      * all of the output devices are stopped.
151      */

152     public static final PrinterStateReason JavaDoc
153     STOPPED_PARTLY = new PrinterStateReason JavaDoc(9);
154
155     /**
156      * The device is low on toner.
157      */

158     public static final PrinterStateReason JavaDoc
159     TONER_LOW = new PrinterStateReason JavaDoc(10);
160
161     /**
162      * The device is out of toner.
163      */

164     public static final PrinterStateReason JavaDoc
165     TONER_EMPTY = new PrinterStateReason JavaDoc(11);
166
167     /**
168      * The limit of persistent storage allocated for spooling has been
169      * reached.
170      * The printer is temporarily unable to accept more jobs. The printer will
171      * remove this reason when it is able to accept more jobs.
172      * This value should be used by a non-spooling printer that only
173      * accepts one or a small number
174      * jobs at a time or a spooling printer that has filled the spool space.
175      */

176     public static final PrinterStateReason JavaDoc
177     SPOOL_AREA_FULL = new PrinterStateReason JavaDoc(12);
178
179     /**
180      * One or more covers on the device are open.
181      */

182     public static final PrinterStateReason JavaDoc
183     COVER_OPEN = new PrinterStateReason JavaDoc(13);
184
185     /**
186      * One or more interlock devices on the printer are unlocked.
187      */

188     public static final PrinterStateReason JavaDoc
189     INTERLOCK_OPEN = new PrinterStateReason JavaDoc(14);
190
191     /**
192      * One or more doors on the device are open.
193      */

194     public static final PrinterStateReason JavaDoc
195     DOOR_OPEN = new PrinterStateReason JavaDoc(15);
196
197     /**
198      * One or more input trays are not in the device.
199      */

200     public static final PrinterStateReason JavaDoc
201     INPUT_TRAY_MISSING = new PrinterStateReason JavaDoc(16);
202
203     /**
204      * At least one input tray is low on media.
205      */

206     public static final PrinterStateReason JavaDoc
207     MEDIA_LOW = new PrinterStateReason JavaDoc(17);
208
209     /**
210      * At least one input tray is empty.
211      */

212     public static final PrinterStateReason JavaDoc
213     MEDIA_EMPTY = new PrinterStateReason JavaDoc(18);
214
215     /**
216      * One or more output trays are not in the device.
217      */

218     public static final PrinterStateReason JavaDoc
219     OUTPUT_TRAY_MISSING = new PrinterStateReason JavaDoc(19);
220
221     /**
222      * One or more output areas are almost full
223      * (e.g. tray, stacker, collator).
224      */

225     public static final PrinterStateReason JavaDoc
226     OUTPUT_AREA_ALMOST_FULL = new PrinterStateReason JavaDoc(20);
227
228     /**
229      * One or more output areas are full (e.g. tray, stacker, collator).
230      */

231     public static final PrinterStateReason JavaDoc
232     OUTPUT_AREA_FULL = new PrinterStateReason JavaDoc(21);
233
234     /**
235      * The device is low on at least one marker supply (e.g. toner, ink,
236      * ribbon).
237      */

238     public static final PrinterStateReason JavaDoc
239     MARKER_SUPPLY_LOW = new PrinterStateReason JavaDoc(22);
240
241     /**
242      * The device is out of at least one marker supply (e.g. toner, ink,
243      * ribbon).
244      */

245     public static final PrinterStateReason JavaDoc
246     MARKER_SUPPLY_EMPTY = new PrinterStateReason JavaDoc(23);
247
248     /**
249      * The device marker supply waste receptacle is almost full.
250      */

251     public static final PrinterStateReason JavaDoc
252     MARKER_WASTE_ALMOST_FULL = new PrinterStateReason JavaDoc(24);
253
254     /**
255      * The device marker supply waste receptacle is full.
256      */

257     public static final PrinterStateReason JavaDoc
258     MARKER_WASTE_FULL = new PrinterStateReason JavaDoc(25);
259
260     /**
261      * The fuser temperature is above normal.
262      */

263     public static final PrinterStateReason JavaDoc
264     FUSER_OVER_TEMP = new PrinterStateReason JavaDoc(26);
265
266     /**
267      * The fuser temperature is below normal.
268      */

269     public static final PrinterStateReason JavaDoc
270     FUSER_UNDER_TEMP = new PrinterStateReason JavaDoc(27);
271
272     /**
273      * The optical photo conductor is near end of life.
274      */

275     public static final PrinterStateReason JavaDoc
276     OPC_NEAR_EOL = new PrinterStateReason JavaDoc(28);
277
278     /**
279      * The optical photo conductor is no longer functioning.
280      */

281     public static final PrinterStateReason JavaDoc
282     OPC_LIFE_OVER = new PrinterStateReason JavaDoc(29);
283
284     /**
285      * The device is low on developer.
286      */

287     public static final PrinterStateReason JavaDoc
288     DEVELOPER_LOW = new PrinterStateReason JavaDoc(30);
289
290     /**
291      * The device is out of developer.
292      */

293     public static final PrinterStateReason JavaDoc
294     DEVELOPER_EMPTY = new PrinterStateReason JavaDoc(31);
295
296     /**
297      * An interpreter resource is unavailable (e.g., font, form).
298      */

299     public static final PrinterStateReason JavaDoc
300     INTERPRETER_RESOURCE_UNAVAILABLE = new PrinterStateReason JavaDoc(32);
301     
302     /**
303      * Construct a new printer state reason enumeration value with
304      * the given integer value.
305      *
306      * @param value Integer value.
307      */

308     protected PrinterStateReason(int value) {
309     super (value);
310     }
311
312     private static final String JavaDoc[] myStringTable = {
313     "other",
314     "media-needed",
315     "media-jam",
316     "moving-to-paused",
317     "paused",
318     "shutdown",
319     "connecting-to-device",
320     "timed-out",
321     "stopping",
322     "stopped-partly",
323     "toner-low",
324     "toner-empty",
325     "spool-area-full",
326     "cover-open",
327     "interlock-open",
328     "door-open",
329     "input-tray-missing",
330     "media-low",
331     "media-empty",
332     "output-tray-missing",
333     "output-area-almost-full",
334     "output-area-full",
335     "marker-supply-low",
336     "marker-supply-empty",
337     "marker-waste-almost-full",
338     "marker-waste-full",
339     "fuser-over-temp",
340     "fuser-under-temp",
341     "opc-near-eol",
342     "opc-life-over",
343     "developer-low",
344     "developer-empty",
345     "interpreter-resource-unavailable"
346     };
347
348     private static final PrinterStateReason JavaDoc[] myEnumValueTable = {
349     OTHER,
350     MEDIA_NEEDED,
351     MEDIA_JAM,
352     MOVING_TO_PAUSED,
353     PAUSED,
354     SHUTDOWN,
355     CONNECTING_TO_DEVICE,
356     TIMED_OUT,
357     STOPPING,
358     STOPPED_PARTLY,
359     TONER_LOW,
360     TONER_EMPTY,
361     SPOOL_AREA_FULL,
362     COVER_OPEN,
363     INTERLOCK_OPEN,
364     DOOR_OPEN,
365     INPUT_TRAY_MISSING,
366     MEDIA_LOW,
367     MEDIA_EMPTY,
368     OUTPUT_TRAY_MISSING,
369     OUTPUT_AREA_ALMOST_FULL,
370     OUTPUT_AREA_FULL,
371     MARKER_SUPPLY_LOW,
372     MARKER_SUPPLY_EMPTY,
373     MARKER_WASTE_ALMOST_FULL,
374     MARKER_WASTE_FULL,
375     FUSER_OVER_TEMP,
376     FUSER_UNDER_TEMP,
377     OPC_NEAR_EOL,
378     OPC_LIFE_OVER,
379     DEVELOPER_LOW,
380     DEVELOPER_EMPTY,
381     INTERPRETER_RESOURCE_UNAVAILABLE
382     };
383
384     /**
385      * Returns the string table for class PrinterStateReason.
386      */

387     protected String JavaDoc[] getStringTable() {
388     return (String JavaDoc[])myStringTable.clone();
389     }
390     
391     /**
392      * Returns the enumeration value table for class PrinterStateReason.
393      */

394     protected EnumSyntax JavaDoc[] getEnumValueTable() {
395     return (EnumSyntax JavaDoc[])myEnumValueTable.clone();
396     }
397     
398
399     /**
400      * Get the printing attribute class which is to be used as the "category"
401      * for this printing attribute value.
402      * <P>
403      * For class PrinterStateReason and any vendor-defined subclasses, the
404      * category is class PrinterStateReason itself.
405      *
406      * @return Printing attribute class (category), an instance of class
407      * {@link java.lang.Class java.lang.Class}.
408      */

409     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
410     return PrinterStateReason JavaDoc.class;
411     }
412
413     /**
414      * Get the name of the category of which this attribute value is an
415      * instance.
416      * <P>
417      * For class PrinterStateReason and any vendor-defined subclasses, the
418      * category name is <CODE>"printer-state-reason"</CODE>.
419      *
420      * @return Attribute category name.
421      */

422     public final String JavaDoc getName() {
423     return "printer-state-reason";
424     }
425
426 }
427
Popular Tags