Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java
41171 views
1
/*
2
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
package javax.print.attribute.standard;
27
28
import java.io.Serial;
29
30
import javax.print.attribute.Attribute;
31
import javax.print.attribute.EnumSyntax;
32
33
/**
34
* Class {@code JobStateReason} is a printing attribute class, an enumeration,
35
* that provides additional information about the job's current state, i.e.,
36
* information that augments the value of the job's {@link JobState JobState}
37
* attribute. Class {@code JobStateReason} defines standard job state reason
38
* values. A Print Service implementation only needs to report those job state
39
* reasons which are appropriate for the particular implementation; it does not
40
* have to report every defined job state reason.
41
* <p>
42
* Instances of {@code JobStateReason} do not appear in a Print Job's attribute
43
* set directly. Rather, a {@link JobStateReasons JobStateReasons} attribute
44
* appears in the Print Job's attribute set. The
45
* {@link JobStateReasons JobStateReasons} attribute contains zero, one, or more
46
* than one {@code JobStateReason} objects which pertain to the Print Job's
47
* status. The printer adds a JobStateReason object to the Print Job's
48
* {@link JobStateReasons JobStateReasons} attribute when the corresponding
49
* condition becomes true of the Print Job, and the printer removes the
50
* {@code JobStateReason} object again when the corresponding condition becomes
51
* false, regardless of whether the Print Job's overall
52
* {@link JobState JobState} also changed.
53
* <p>
54
* <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
55
* the IPP attribute name. The enumeration's integer value is the IPP enum
56
* value. The {@code toString()} method returns the IPP string representation of
57
* the attribute value.
58
*
59
* @author Alan Kaminsky
60
*/
61
public class JobStateReason extends EnumSyntax implements Attribute {
62
63
/**
64
* Use serialVersionUID from JDK 1.4 for interoperability.
65
*/
66
@Serial
67
private static final long serialVersionUID = -8765894420449009168L;
68
69
/**
70
* The printer has created the Print Job, but the printer has not finished
71
* accessing or accepting all the print data yet.
72
*/
73
public static final JobStateReason
74
JOB_INCOMING = new JobStateReason(0);
75
76
/**
77
* The printer has created the Print Job, but the printer is expecting
78
* additional print data before it can move the job into the
79
* {@code PROCESSING} state. If a printer starts processing before it has
80
* received all data, the printer removes the {@code JOB_DATA_INSUFFICIENT}
81
* reason, but the {@code JOB_INCOMING} reason remains. If a printer starts
82
* processing after it has received all data, the printer removes the
83
* {@code JOB_DATA_INSUFFICIENT} and {@code JOB_INCOMING} reasons at the
84
* same time.
85
*/
86
public static final JobStateReason
87
JOB_DATA_INSUFFICIENT = new JobStateReason(1);
88
89
/**
90
* The printer could not access one or more documents passed by reference
91
* (i.e., the print data representation object is a {@code URL}). This
92
* reason is intended to cover any file access problem,including file does
93
* not exist and access denied because of an access control problem. Whether
94
* the printer aborts the job and moves the job to the {@code ABORTED} job
95
* state or prints all documents that are accessible and moves the job to
96
* the {@code COMPLETED} job state and adds the
97
* {@code COMPLETED_WITH_ERRORS} reason to the job's
98
* {@link JobStateReasons JobStateReasons} attribute depends on
99
* implementation and/or site policy. This value should be supported if the
100
* printer supports doc flavors with {@code URL} print data representation
101
* objects.
102
*/
103
public static final JobStateReason
104
DOCUMENT_ACCESS_ERROR = new JobStateReason(2);
105
106
/**
107
* The job was not completely submitted for some unforeseen reason.
108
* Possibilities include (1) the printer has crashed before the job was
109
* fully submitted by the client, (2) the printer or the document transfer
110
* method has crashed in some non-recoverable way before the document data
111
* was entirely transferred to the printer, (3) the client crashed before
112
* the job was fully submitted.
113
*/
114
public static final JobStateReason
115
SUBMISSION_INTERRUPTED = new JobStateReason(3);
116
117
/**
118
* The printer is transmitting the job to the output device.
119
*/
120
public static final JobStateReason
121
JOB_OUTGOING = new JobStateReason(4);
122
123
/**
124
* The value of the job's {@link JobHoldUntil JobHoldUntil} attribute was
125
* specified with a date-time that is still in the future. The job must not
126
* be a candidate for processing until this reason is removed and there are
127
* no other reasons to hold the job. This value should be supported if the
128
* {@link JobHoldUntil JobHoldUntil} job template attribute is supported.
129
*/
130
public static final JobStateReason
131
JOB_HOLD_UNTIL_SPECIFIED = new JobStateReason(5);
132
133
/**
134
* At least one of the resources needed by the job, such as media, fonts,
135
* resource objects, etc., is not ready on any of the physical printers for
136
* which the job is a candidate. This condition may be detected when the job
137
* is accepted, or subsequently while the job is pending or processing,
138
* depending on implementation. The job may remain in its current state or
139
* be moved to the {@code PENDING_HELD} state, depending on implementation
140
* and/or job scheduling policy.
141
*/
142
public static final JobStateReason
143
RESOURCES_ARE_NOT_READY = new JobStateReason(6);
144
145
/**
146
* The value of the printer's {@link PrinterStateReasons
147
* PrinterStateReasons} attribute contains a
148
* {@link PrinterStateReason PrinterStateReason} value of
149
* {@code STOPPED_PARTLY}.
150
*/
151
public static final JobStateReason
152
PRINTER_STOPPED_PARTLY = new JobStateReason(7);
153
154
/**
155
* The value of the printer's {@link PrinterState PrinterState} attribute ia
156
* {@code STOPPED}.
157
*/
158
public static final JobStateReason
159
PRINTER_STOPPED = new JobStateReason(8);
160
161
/**
162
* The job is in the {@code PROCESSING} state, but more specifically, the
163
* printer ia interpreting the document data.
164
*/
165
public static final JobStateReason
166
JOB_INTERPRETING = new JobStateReason(9);
167
168
/**
169
* The job is in the {@code PROCESSING} state, but more specifically, the
170
* printer has queued the document data.
171
*/
172
public static final JobStateReason JOB_QUEUED = new JobStateReason(10);
173
174
/**
175
* The job is in the {@code PROCESSING} state, but more specifically, the
176
* printer is interpreting document data and producing another electronic
177
* representation.
178
*/
179
public static final JobStateReason
180
JOB_TRANSFORMING = new JobStateReason(11);
181
182
/**
183
* The job is in the {@code PENDING_HELD}, {@code PENDING}, or
184
* {@code PROCESSING} state, but more specifically, the printer has
185
* completed enough processing of the document to be able to start marking
186
* and the job is waiting for the marker. Systems that require human
187
* intervention to release jobs put the job into the {@code PENDING_HELD}
188
* job state. Systems that automatically select a job to use the marker put
189
* the job into the {@code PENDING} job state or keep the job in the
190
* {@code PROCESSING} job state while waiting for the marker, depending on
191
* implementation. All implementations put the job into (or back into) the
192
* {@code PROCESSING} state when marking does begin.
193
*/
194
public static final JobStateReason
195
JOB_QUEUED_FOR_MARKER = new JobStateReason(12);
196
197
/**
198
* The output device is marking media. This value is useful for printers
199
* which spend a great deal of time processing (1) when no marking is
200
* happening and then want to show that marking is now happening or (2) when
201
* the job is in the process of being canceled or aborted while the job
202
* remains in the {@code PROCESSING} state, but the marking has not yet
203
* stopped so that impression or sheet counts are still increasing for the
204
* job.
205
*/
206
public static final JobStateReason
207
JOB_PRINTING = new JobStateReason(13);
208
209
/**
210
* The job was canceled by the owner of the job, i.e., by a user whose
211
* authenticated identity is the same as the value of the originating user
212
* that created the Print Job, or by some other authorized end-user, such as
213
* a member of the job owner's security group. This value should be
214
* supported.
215
*/
216
public static final JobStateReason
217
JOB_CANCELED_BY_USER = new JobStateReason(14);
218
219
/**
220
* The job was canceled by the operator, i.e., by a user who has been
221
* authenticated as having operator privileges (whether local or remote). If
222
* the security policy is to allow anyone to cancel anyone's job, then this
223
* value may be used when the job is canceled by someone other than the
224
* owner of the job. For such a security policy, in effect, everyone is an
225
* operator as far as canceling jobs is concerned. This value should be
226
* supported if the implementation permits canceling by someone other than
227
* the owner of the job.
228
*/
229
public static final JobStateReason
230
JOB_CANCELED_BY_OPERATOR = new JobStateReason(15);
231
232
/**
233
* The job was canceled by an unidentified local user, i.e., a user at a
234
* console at the device. This value should be supported if the
235
* implementation supports canceling jobs at the console.
236
*/
237
public static final JobStateReason
238
JOB_CANCELED_AT_DEVICE = new JobStateReason(16);
239
240
/**
241
* The job was aborted by the system. Either the job (1) is in the process
242
* of being aborted, (2) has been aborted by the system and placed in the
243
* {@code ABORTED} state, or (3) has been aborted by the system and placed
244
* in the {@code PENDING_HELD} state, so that a user or operator can
245
* manually try the job again. This value should be supported.
246
*/
247
public static final JobStateReason
248
ABORTED_BY_SYSTEM = new JobStateReason(17);
249
250
/**
251
* The job was aborted by the system because the printer determined while
252
* attempting to decompress the document's data that the compression is
253
* actually not among those supported by the printer. This value must be
254
* supported, since {@link Compression Compression} is a required doc
255
* description attribute.
256
*/
257
public static final JobStateReason
258
UNSUPPORTED_COMPRESSION = new JobStateReason(18);
259
260
/**
261
* The job was aborted by the system because the printer encountered an
262
* error in the document data while decompressing it. If the printer posts
263
* this reason, the document data has already passed any tests that would
264
* have led to the {@code UNSUPPORTED_COMPRESSION} job state reason.
265
*/
266
public static final JobStateReason
267
COMPRESSION_ERROR = new JobStateReason(19);
268
269
/**
270
* The job was aborted by the system because the document data's document
271
* format (doc flavor) is not among those supported by the printer. If the
272
* client specifies a doc flavor with a MIME type of
273
* {@code "application/octet-stream"}, the printer may abort the job if the
274
* printer cannot determine the document data's actual format through
275
* auto-sensing (even if the printer supports the document format if
276
* specified explicitly). This value must be supported, since a doc flavor
277
* is required to be specified for each doc.
278
*/
279
public static final JobStateReason
280
UNSUPPORTED_DOCUMENT_FORMAT = new JobStateReason(20);
281
282
/**
283
* The job was aborted by the system because the printer encountered an
284
* error in the document data while processing it. If the printer posts this
285
* reason, the document data has already passed any tests that would have
286
* led to the {@code UNSUPPORTED_DOCUMENT_FORMAT} job state reason.
287
*/
288
public static final JobStateReason
289
DOCUMENT_FORMAT_ERROR = new JobStateReason(21);
290
291
/**
292
* The requester has canceled the job or the printer has aborted the job,
293
* but the printer is still performing some actions on the job until a
294
* specified stop point occurs or job termination/cleanup is completed.
295
* <p>
296
* If the implementation requires some measurable time to cancel the job in
297
* the {@code PROCESSING} or {@code PROCESSING_STOPPED} job states, the
298
* printer must use this reason to indicate that the printer is still
299
* performing some actions on the job while the job remains in the
300
* {@code PROCESSING} or {@code PROCESSING_STOPPED} state. After all the
301
* job's job description attributes have stopped incrementing, the printer
302
* moves the job from the PROCESSING state to the {@code CANCELED} or
303
* {@code ABORTED} job states.
304
*/
305
public static final JobStateReason
306
PROCESSING_TO_STOP_POINT = new JobStateReason(22);
307
308
/**
309
* The printer is off-line and accepting no jobs. All {@code PENDING} jobs
310
* are put into the {@code PENDING_HELD} state. This situation could be true
311
* if the service's or document transform's input is impaired or broken.
312
*/
313
public static final JobStateReason
314
SERVICE_OFF_LINE = new JobStateReason(23);
315
316
/**
317
* The job completed successfully. This value should be supported.
318
*/
319
public static final JobStateReason
320
JOB_COMPLETED_SUCCESSFULLY = new JobStateReason(24);
321
322
/**
323
* The job completed with warnings. This value should be supported if the
324
* implementation detects warnings.
325
*/
326
public static final JobStateReason
327
JOB_COMPLETED_WITH_WARNINGS = new JobStateReason(25);
328
329
/**
330
* The job completed with errors (and possibly warnings too). This value
331
* should be supported if the implementation detects errors.
332
*/
333
public static final JobStateReason
334
JOB_COMPLETED_WITH_ERRORS = new JobStateReason(26);
335
336
/**
337
* This job is retained and is currently able to be restarted. If
338
* {@code JOB_RESTARTABLE} is contained in the job's
339
* {@link JobStateReasons JobStateReasons} attribute, then the printer must
340
* accept a request to restart that job. This value should be supported if
341
* restarting jobs is supported. <i>[The capability for restarting jobs is
342
* not in the Java Print Service API at present.]</i>
343
*/
344
public static final JobStateReason
345
JOB_RESTARTABLE = new JobStateReason(27);
346
347
/**
348
* The job has been forwarded to a device or print system that is unable to
349
* send back status. The printer sets the job's {@link JobState JobState}
350
* attribute to {@code COMPLETED} and adds the {@code QUEUED_IN_DEVICE}
351
* reason to the job's {@link JobStateReasons JobStateReasons} attribute to
352
* indicate that the printer has no additional information about the job and
353
* never will have any better information.
354
*/
355
public static final JobStateReason
356
QUEUED_IN_DEVICE = new JobStateReason(28);
357
358
/**
359
* Construct a new job state reason enumeration value with the given integer
360
* value.
361
*
362
* @param value Integer value
363
*/
364
protected JobStateReason(int value) {
365
super (value);
366
}
367
368
/**
369
* The string table for class {@code JobStateReason}.
370
*/
371
private static final String[] myStringTable = {
372
"job-incoming",
373
"job-data-insufficient",
374
"document-access-error",
375
"submission-interrupted",
376
"job-outgoing",
377
"job-hold-until-specified",
378
"resources-are-not-ready",
379
"printer-stopped-partly",
380
"printer-stopped",
381
"job-interpreting",
382
"job-queued",
383
"job-transforming",
384
"job-queued-for-marker",
385
"job-printing",
386
"job-canceled-by-user",
387
"job-canceled-by-operator",
388
"job-canceled-at-device",
389
"aborted-by-system",
390
"unsupported-compression",
391
"compression-error",
392
"unsupported-document-format",
393
"document-format-error",
394
"processing-to-stop-point",
395
"service-off-line",
396
"job-completed-successfully",
397
"job-completed-with-warnings",
398
"job-completed-with-errors",
399
"job-restartable",
400
"queued-in-device"};
401
402
/**
403
* The enumeration value table for class {@code JobStateReason}.
404
*/
405
private static final JobStateReason[] myEnumValueTable = {
406
JOB_INCOMING,
407
JOB_DATA_INSUFFICIENT,
408
DOCUMENT_ACCESS_ERROR,
409
SUBMISSION_INTERRUPTED,
410
JOB_OUTGOING,
411
JOB_HOLD_UNTIL_SPECIFIED,
412
RESOURCES_ARE_NOT_READY,
413
PRINTER_STOPPED_PARTLY,
414
PRINTER_STOPPED,
415
JOB_INTERPRETING,
416
JOB_QUEUED,
417
JOB_TRANSFORMING,
418
JOB_QUEUED_FOR_MARKER,
419
JOB_PRINTING,
420
JOB_CANCELED_BY_USER,
421
JOB_CANCELED_BY_OPERATOR,
422
JOB_CANCELED_AT_DEVICE,
423
ABORTED_BY_SYSTEM,
424
UNSUPPORTED_COMPRESSION,
425
COMPRESSION_ERROR,
426
UNSUPPORTED_DOCUMENT_FORMAT,
427
DOCUMENT_FORMAT_ERROR,
428
PROCESSING_TO_STOP_POINT,
429
SERVICE_OFF_LINE,
430
JOB_COMPLETED_SUCCESSFULLY,
431
JOB_COMPLETED_WITH_WARNINGS,
432
JOB_COMPLETED_WITH_ERRORS,
433
JOB_RESTARTABLE,
434
QUEUED_IN_DEVICE};
435
436
/**
437
* Returns the string table for class {@code JobStateReason}.
438
*/
439
protected String[] getStringTable() {
440
return myStringTable.clone();
441
}
442
443
/**
444
* Returns the enumeration value table for class {@code JobStateReason}.
445
*/
446
protected EnumSyntax[] getEnumValueTable() {
447
return (EnumSyntax[])myEnumValueTable.clone();
448
}
449
450
/**
451
* Get the printing attribute class which is to be used as the "category"
452
* for this printing attribute value.
453
* <p>
454
* For class {@code JobStateReason} and any vendor-defined subclasses, the
455
* category is class {@code JobStateReason} itself.
456
*
457
* @return printing attribute class (category), an instance of class
458
* {@link Class java.lang.Class}
459
*/
460
public final Class<? extends Attribute> getCategory() {
461
return JobStateReason.class;
462
}
463
464
/**
465
* Get the name of the category of which this attribute value is an
466
* instance.
467
* <p>
468
* For class {@code JobStateReason} and any vendor-defined subclasses, the
469
* category name is {@code "job-state-reason"}.
470
*
471
* @return attribute category name
472
*/
473
public final String getName() {
474
return "job-state-reason";
475
}
476
}
477
478