< prev index next >

src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2014, 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 package javax.print.attribute.standard;
  26 
  27 import javax.print.attribute.EnumSyntax;
  28 import javax.print.attribute.Attribute;

  29 
  30 /**
  31  * Class JobStateReason is a printing attribute class, an enumeration, that
  32  * provides additional information about the job's current state, i.e.,
  33  * information that augments the value of the job's {@link JobState JobState}
  34  * attribute. Class JobStateReason defines standard job state reason values. A
  35  * Print Service implementation only needs to report those job state
  36  * reasons which are appropriate for the particular implementation; it does not
  37  * have to report every defined job state reason.
  38  * <P>
  39  * Instances of JobStateReason do not appear in a Print Job's attribute set
  40  * directly. Rather, a {@link JobStateReasons JobStateReasons} attribute appears
  41  * in the Print Job's attribute set. The {@link JobStateReasons JobStateReasons}
  42  * attribute contains zero, one, or more than one JobStateReason objects which
  43  * pertain to the Print Job's status. The printer adds a JobStateReason object
  44  * to the Print Job's {@link JobStateReasons JobStateReasons} attribute when the
  45  * corresponding condition becomes true of the Print Job, and the printer
  46  * removes the JobStateReason object again when the corresponding condition
  47  * becomes false, regardless of whether the Print Job's overall {@link JobState
  48  * JobState} also changed.
  49  * <P>
  50  * <B>IPP Compatibility:</B> The category name returned by
  51  * {@code getName()} is the IPP attribute name.  The enumeration's
  52  * integer value is the IPP enum value.  The {@code toString()} method
  53  * returns the IPP string representation of the attribute value.

  54  *
  55  * @author  Alan Kaminsky
  56  */
  57 public class JobStateReason extends EnumSyntax implements Attribute {
  58 



  59     private static final long serialVersionUID = -8765894420449009168L;
  60 
  61     /**
  62      * The printer has created the Print Job, but the printer has not finished
  63      * accessing or accepting all the print data yet.
  64      */
  65     public static final JobStateReason
  66         JOB_INCOMING = new JobStateReason(0);
  67 
  68     /**
  69      * The printer has created the Print Job, but the printer is expecting
  70      * additional print data before it can move the job into the PROCESSING
  71      * state. If a printer starts processing before it has received all data,
  72      * the printer removes the JOB_DATA_INSUFFICIENT reason, but the
  73      * JOB_INCOMING reason remains. If a printer starts processing after it
  74      * has received all data, the printer removes the JOB_DATA_INSUFFICIENT
  75      * and JOB_INCOMING reasons at the same time.

  76      */
  77     public static final JobStateReason
  78         JOB_DATA_INSUFFICIENT = new JobStateReason(1);
  79 
  80     /**
  81      * The Printer could not access one or more documents passed by reference
  82      * (i.e., the print data representation object is a URL). This reason is
  83      * intended to cover any file access problem,including file does not exist
  84      * and access denied because of an access control problem. Whether the
  85      * printer aborts the job and moves the job to the ABORTED job state or
  86      * prints all documents that are accessible and moves the job to the
  87      * COMPLETED job state and adds the COMPLETED_WITH_ERRORS reason to the
  88      * job's {@link JobStateReasons JobStateReasons} attribute depends on
  89      * implementation and/or site policy. This value should be supported if
  90      * the printer supports doc flavors with URL print data representation

  91      * objects.
  92      */
  93     public static final JobStateReason
  94         DOCUMENT_ACCESS_ERROR = new JobStateReason(2);
  95 
  96     /**
  97      * The job was not completely submitted for some unforeseen reason.
  98      * Possibilities include (1) the printer has crashed before the job was
  99      * fully submitted by the client, (2) the printer or the document transfer
 100      * method has crashed in some non-recoverable way before the document data
 101      * was entirely transferred to the printer, (3) the client crashed before
 102      * the job was fully submitted.
 103      */
 104     public static final JobStateReason
 105         SUBMISSION_INTERRUPTED = new JobStateReason(3);
 106 
 107     /**
 108      * The printer is transmitting the job to the output device.
 109      */
 110     public static final JobStateReason
 111         JOB_OUTGOING = new JobStateReason(4);
 112 
 113     /**
 114      * The value of the job's {@link JobHoldUntil JobHoldUntil} attribute was
 115      * specified with a date-time that is still in the future. The job must
 116      * not be a candidate for processing until this reason is removed and
 117      * there are
 118      * no other reasons to hold the job. This value should be supported if the
 119      * {@link JobHoldUntil JobHoldUntil} job template attribute is supported.
 120      */
 121     public static final JobStateReason
 122         JOB_HOLD_UNTIL_SPECIFIED = new JobStateReason(5);
 123 
 124     /**
 125      * At least one of the resources needed by the job, such as media, fonts,
 126      * resource objects, etc., is not ready on any of the physical printers
 127      * for which the job is a candidate. This condition may be detected
 128      * when the job is accepted, or subsequently while the job is pending
 129      * or processing, depending on implementation.
 130      * The job may remain in its current state or
 131      * be moved to the PENDING_HELD state, depending on implementation and/or
 132      * job scheduling policy.
 133      */
 134     public static final JobStateReason
 135         RESOURCES_ARE_NOT_READY = new JobStateReason(6);
 136 
 137     /**
 138      * The value of the printer's {@link PrinterStateReasons
 139      * PrinterStateReasons} attribute contains a {@link PrinterStateReason
 140      * PrinterStateReason} value of STOPPED_PARTLY.

 141      */
 142     public static final JobStateReason
 143         PRINTER_STOPPED_PARTLY = new JobStateReason(7);
 144 
 145     /**
 146      * The value of the printer's {@link PrinterState PrinterState} attribute
 147      * ia STOPPED.
 148      */
 149     public static final JobStateReason
 150         PRINTER_STOPPED = new JobStateReason(8);
 151 
 152     /**
 153      * The job is in the PROCESSING state, but more specifically, the printer
 154      * ia interpreting the document data.
 155      */
 156     public static final JobStateReason
 157         JOB_INTERPRETING = new JobStateReason(9);
 158 
 159     /**
 160      * The job is in the PROCESSING state, but more specifically, the printer
 161      * has queued the document data.
 162      */
 163     public static final JobStateReason JOB_QUEUED = new JobStateReason(10);
 164 
 165     /**
 166      * The job is in the PROCESSING state, but more specifically, the printer
 167      * is interpreting document data and producing another electronic
 168      * representation.
 169      */
 170     public static final JobStateReason
 171         JOB_TRANSFORMING = new JobStateReason(11);
 172 
 173     /**
 174      * The job is in the PENDING_HELD, PENDING, or PROCESSING state, but more
 175      * specifically, the printer has completed enough processing of the document
 176      * to be able to start marking and the job is waiting for the marker.
 177      * Systems that require human intervention to release jobs put the job into
 178      * the PENDING_HELD job state. Systems that automatically select a job to
 179      * use the marker put the job into the PENDING job state or keep the job
 180      * in the PROCESSING job state while waiting for the marker, depending on

 181      * implementation. All implementations put the job into (or back into) the
 182      * PROCESSING state when marking does begin.
 183      */
 184     public static final JobStateReason
 185         JOB_QUEUED_FOR_MARKER = new JobStateReason(12);
 186 
 187     /**
 188      * The output device is marking media. This value is useful for printers
 189      * which spend a great deal of time processing (1) when no marking is
 190      * happening and then want to show that marking is now happening or (2) when
 191      * the job is in the process of being canceled or aborted while the job
 192      * remains in the PROCESSING state, but the marking has not yet stopped so
 193      * that impression or sheet counts are still increasing for the job.

 194      */
 195     public static final JobStateReason
 196         JOB_PRINTING = new JobStateReason(13);
 197 
 198     /**
 199      * The job was canceled by the owner of the job, i.e., by a user whose
 200      * authenticated identity is the same as the value of the originating user
 201      * that created the Print Job, or by some other authorized end-user, such as
 202      * a member of the job owner's security group. This value should be
 203      * supported.
 204      */
 205     public static final JobStateReason
 206         JOB_CANCELED_BY_USER = new JobStateReason(14);
 207 
 208     /**
 209      * The job was canceled by the operator, i.e., by a user who has been
 210      * authenticated as having operator privileges (whether local or remote). If
 211      * the security policy is to allow anyone to cancel anyone's job, then this
 212      * value may be used when the job is canceled by someone other than the
 213      * owner of the job. For such a security policy, in effect, everyone is an
 214      * operator as far as canceling jobs is concerned. This value should be
 215      * supported if the implementation permits canceling by someone other than
 216      * the owner of the job.
 217      */
 218     public static final JobStateReason
 219         JOB_CANCELED_BY_OPERATOR = new JobStateReason(15);
 220 
 221     /**
 222      * The job was canceled by an unidentified local user, i.e., a user at a
 223      * console at the device. This value should be supported if the
 224      * implementation supports canceling jobs at the console.
 225      */
 226     public static final JobStateReason
 227         JOB_CANCELED_AT_DEVICE = new JobStateReason(16);
 228 
 229     /**
 230      * The job was aborted by the system. Either the job (1) is in the process
 231      * of being aborted, (2) has been aborted by the system and placed in the
 232      * ABORTED state, or (3) has been aborted by the system and placed in the
 233      * PENDING_HELD state, so that a user or operator can manually try the job
 234      * again. This value should be supported.
 235      */
 236     public static final JobStateReason
 237         ABORTED_BY_SYSTEM = new JobStateReason(17);
 238 
 239     /**
 240      * The job was aborted by the system because the printer determined while
 241      * attempting to decompress the document's data that the compression is
 242      * actually not among those supported by the printer. This value must be
 243      * supported, since {@link Compression Compression} is a required doc
 244      * description attribute.
 245      */
 246     public static final JobStateReason
 247         UNSUPPORTED_COMPRESSION = new JobStateReason(18);
 248 
 249     /**
 250      * The job was aborted by the system because the printer encountered an
 251      * error in the document data while decompressing it. If the printer posts
 252      * this reason, the document data has already passed any tests that would
 253      * have led to the UNSUPPORTED_COMPRESSION job state reason.
 254      */
 255     public static final JobStateReason
 256         COMPRESSION_ERROR = new JobStateReason(19);
 257 
 258     /**
 259      * The job was aborted by the system because the document data's document
 260      * format (doc flavor) is not among those supported by the printer. If the
 261      * client specifies a doc flavor with a MIME type of
 262      * {@code "application/octet-stream"}, the printer may abort the job if
 263      * the printer cannot determine the document data's actual format through
 264      * auto-sensing (even if the printer supports the document format if
 265      * specified explicitly). This value must be supported, since a doc flavor
 266      * is required to be specified for each doc.
 267      */
 268     public static final JobStateReason
 269         UNSUPPORTED_DOCUMENT_FORMAT = new JobStateReason(20);
 270 
 271     /**
 272      * The job was aborted by the system because the printer encountered an
 273      * error in the document data while processing it. If the printer posts this
 274      * reason, the document data has already passed any tests that would have
 275      * led to the UNSUPPORTED_DOCUMENT_FORMAT job state reason.
 276      */
 277     public static final JobStateReason
 278         DOCUMENT_FORMAT_ERROR = new JobStateReason(21);
 279 
 280     /**
 281      * The requester has canceled the job or the printer has aborted the job,
 282      * but the printer is still performing some actions on the job until a
 283      * specified stop point occurs or job termination/cleanup is completed.
 284      * <P>
 285      * If the implementation requires some measurable time to cancel the job in
 286      * the PROCESSING or PROCESSING_STOPPED job states, the printer must use
 287      * this reason to indicate that the printer is still performing some actions
 288      * on the job while the job remains in the PROCESSING or PROCESSING_STOPPED
 289      * state. After all the job's job description attributes have stopped
 290      * incrementing, the printer moves the job from the PROCESSING state to the
 291      * CANCELED or ABORTED job states.

 292      */
 293     public static final JobStateReason
 294         PROCESSING_TO_STOP_POINT = new JobStateReason(22);
 295 
 296     /**
 297      * The printer is off-line and accepting no jobs. All PENDING jobs are put
 298      * into the PENDING_HELD state. This situation could be true if the
 299      * service's or document transform's input is impaired or broken.
 300      */
 301     public static final JobStateReason
 302         SERVICE_OFF_LINE = new JobStateReason(23);
 303 
 304     /**
 305      * The job completed successfully. This value should be supported.
 306      */
 307     public static final JobStateReason
 308         JOB_COMPLETED_SUCCESSFULLY = new JobStateReason(24);
 309 
 310     /**
 311      * The job completed with warnings. This value should be supported if the
 312      * implementation detects warnings.
 313      */
 314     public static final JobStateReason
 315         JOB_COMPLETED_WITH_WARNINGS = new JobStateReason(25);
 316 
 317     /**
 318      * The job completed with errors (and possibly warnings too). This value
 319      * should be supported if the implementation detects errors.
 320      */
 321     public static final JobStateReason
 322         JOB_COMPLETED_WITH_ERRORS = new JobStateReason(26);
 323 
 324     /**
 325      * This job is retained and is currently able to be restarted. If
 326      * JOB_RESTARTABLE is contained in the job's {@link JobStateReasons
 327      * JobStateReasons} attribute, then the printer must accept a request to
 328      * restart that job. This value should be supported if restarting jobs is
 329      * supported. <I>[The capability for restarting jobs is not in the Java
 330      * Print Service API at present.]</I>
 331      */
 332     public static final JobStateReason
 333         JOB_RESTARTABLE = new JobStateReason(27);
 334 
 335     /**
 336      * The job has been forwarded to a device or print system that is unable to
 337      * send back status. The printer sets the job's {@link JobState JobState}
 338      * attribute to COMPLETED and adds the QUEUED_IN_DEVICE reason to the job's
 339      * {@link JobStateReasons JobStateReasons} attribute to indicate that the
 340      * printer has no additional information about the job and never will have
 341      * any better information.
 342      */
 343     public static final JobStateReason
 344         QUEUED_IN_DEVICE = new JobStateReason(28);
 345 
 346     /**
 347      * Construct a new job state reason enumeration value with the given
 348      * integer  value.
 349      *
 350      * @param  value  Integer value.
 351      */
 352     protected JobStateReason(int value) {
 353         super (value);
 354     }
 355 



 356     private static final String[] myStringTable = {
 357         "job-incoming",
 358         "job-data-insufficient",
 359         "document-access-error",
 360         "submission-interrupted",
 361         "job-outgoing",
 362         "job-hold-until-specified",
 363         "resources-are-not-ready",
 364         "printer-stopped-partly",
 365         "printer-stopped",
 366         "job-interpreting",
 367         "job-queued",
 368         "job-transforming",
 369         "job-queued-for-marker",
 370         "job-printing",
 371         "job-canceled-by-user",
 372         "job-canceled-by-operator",
 373         "job-canceled-at-device",
 374         "aborted-by-system",
 375         "unsupported-compression",
 376         "compression-error",
 377         "unsupported-document-format",
 378         "document-format-error",
 379         "processing-to-stop-point",
 380         "service-off-line",
 381         "job-completed-successfully",
 382         "job-completed-with-warnings",
 383         "job-completed-with-errors",
 384         "job-restartable",
 385         "queued-in-device"};
 386 



 387     private static final JobStateReason[] myEnumValueTable = {
 388         JOB_INCOMING,
 389         JOB_DATA_INSUFFICIENT,
 390         DOCUMENT_ACCESS_ERROR,
 391         SUBMISSION_INTERRUPTED,
 392         JOB_OUTGOING,
 393         JOB_HOLD_UNTIL_SPECIFIED,
 394         RESOURCES_ARE_NOT_READY,
 395         PRINTER_STOPPED_PARTLY,
 396         PRINTER_STOPPED,
 397         JOB_INTERPRETING,
 398         JOB_QUEUED,
 399         JOB_TRANSFORMING,
 400         JOB_QUEUED_FOR_MARKER,
 401         JOB_PRINTING,
 402         JOB_CANCELED_BY_USER,
 403         JOB_CANCELED_BY_OPERATOR,
 404         JOB_CANCELED_AT_DEVICE,
 405         ABORTED_BY_SYSTEM,
 406         UNSUPPORTED_COMPRESSION,
 407         COMPRESSION_ERROR,
 408         UNSUPPORTED_DOCUMENT_FORMAT,
 409         DOCUMENT_FORMAT_ERROR,
 410         PROCESSING_TO_STOP_POINT,
 411         SERVICE_OFF_LINE,
 412         JOB_COMPLETED_SUCCESSFULLY,
 413         JOB_COMPLETED_WITH_WARNINGS,
 414         JOB_COMPLETED_WITH_ERRORS,
 415         JOB_RESTARTABLE,
 416         QUEUED_IN_DEVICE};
 417 
 418     /**
 419      * Returns the string table for class JobStateReason.
 420      */
 421     protected String[] getStringTable() {
 422         return myStringTable.clone();
 423     }
 424 
 425     /**
 426      * Returns the enumeration value table for class JobStateReason.
 427      */
 428     protected EnumSyntax[] getEnumValueTable() {
 429         return (EnumSyntax[])myEnumValueTable.clone();
 430     }
 431 
 432 
 433     /**
 434      * Get the printing attribute class which is to be used as the "category"
 435      * for this printing attribute value.
 436      * <P>
 437      * For class JobStateReason and any vendor-defined subclasses, the
 438      * category  is class JobStateReason itself.
 439      *
 440      * @return  Printing attribute class (category), an instance of class
 441      *          {@link java.lang.Class java.lang.Class}.
 442      */
 443     public final Class<? extends Attribute> getCategory() {
 444         return JobStateReason.class;
 445     }
 446 
 447     /**
 448      * Get the name of the category of which this attribute value is an
 449      * instance.
 450      * <P>
 451      * For class JobStateReason and any vendor-defined subclasses, the
 452      * category name is {@code "job-state-reason"}.
 453      *
 454      * @return  Attribute category name.
 455      */
 456     public final String getName() {
 457         return "job-state-reason";
 458     }
 459 
 460 }
   1 /*
   2  * Copyright (c) 2000, 2017, 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 javax.print.attribute.Attribute;
  29 import javax.print.attribute.EnumSyntax;
  30 
  31 /**
  32  * Class {@code JobStateReason} is a printing attribute class, an enumeration,
  33  * that provides additional information about the job's current state, i.e.,
  34  * information that augments the value of the job's {@link JobState JobState}
  35  * attribute. Class {@code JobStateReason} defines standard job state reason
  36  * values. A Print Service implementation only needs to report those job state
  37  * reasons which are appropriate for the particular implementation; it does not
  38  * have to report every defined job state reason.
  39  * <p>
  40  * Instances of {@code JobStateReason} do not appear in a Print Job's attribute
  41  * set directly. Rather, a {@link JobStateReasons JobStateReasons} attribute
  42  * appears in the Print Job's attribute set. The
  43  * {@link JobStateReasons JobStateReasons} attribute contains zero, one, or more
  44  * than one {@code JobStateReason} objects which pertain to the Print Job's
  45  * status. The printer adds a JobStateReason object to the Print Job's
  46  * {@link JobStateReasons JobStateReasons} attribute when the corresponding
  47  * condition becomes true of the Print Job, and the printer removes the
  48  * {@code JobStateReason} object again when the corresponding condition becomes
  49  * false, regardless of whether the Print Job's overall
  50  * {@link JobState JobState} also changed.
  51  * <p>
  52  * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
  53  * the IPP attribute name. The enumeration's integer value is the IPP enum
  54  * value. The {@code toString()} method returns the IPP string representation of
  55  * the attribute value.
  56  *
  57  * @author Alan Kaminsky
  58  */
  59 public class JobStateReason extends EnumSyntax implements Attribute {
  60 
  61     /**
  62      * Use serialVersionUID from JDK 1.4 for interoperability.
  63      */
  64     private static final long serialVersionUID = -8765894420449009168L;
  65 
  66     /**
  67      * The printer has created the Print Job, but the printer has not finished
  68      * accessing or accepting all the print data yet.
  69      */
  70     public static final JobStateReason
  71         JOB_INCOMING = new JobStateReason(0);
  72 
  73     /**
  74      * The printer has created the Print Job, but the printer is expecting
  75      * additional print data before it can move the job into the
  76      * {@code PROCESSING} state. If a printer starts processing before it has
  77      * received all data, the printer removes the {@code JOB_DATA_INSUFFICIENT}
  78      * reason, but the {@code JOB_INCOMING} reason remains. If a printer starts
  79      * processing after it has received all data, the printer removes the
  80      * {@code JOB_DATA_INSUFFICIENT} and {@code JOB_INCOMING} reasons at the
  81      * same time.
  82      */
  83     public static final JobStateReason
  84         JOB_DATA_INSUFFICIENT = new JobStateReason(1);
  85 
  86     /**
  87      * The printer could not access one or more documents passed by reference
  88      * (i.e., the print data representation object is a {@code URL}). This
  89      * reason is intended to cover any file access problem,including file does
  90      * not exist and access denied because of an access control problem. Whether
  91      * the printer aborts the job and moves the job to the {@code ABORTED} job
  92      * state or prints all documents that are accessible and moves the job to
  93      * the {@code COMPLETED} job state and adds the
  94      * {@code COMPLETED_WITH_ERRORS} reason to the job's
  95      * {@link JobStateReasons JobStateReasons} attribute depends on
  96      * implementation and/or site policy. This value should be supported if the
  97      * printer supports doc flavors with {@code URL} print data representation
  98      * objects.
  99      */
 100     public static final JobStateReason
 101         DOCUMENT_ACCESS_ERROR = new JobStateReason(2);
 102 
 103     /**
 104      * The job was not completely submitted for some unforeseen reason.
 105      * Possibilities include (1) the printer has crashed before the job was
 106      * fully submitted by the client, (2) the printer or the document transfer
 107      * method has crashed in some non-recoverable way before the document data
 108      * was entirely transferred to the printer, (3) the client crashed before
 109      * the job was fully submitted.
 110      */
 111     public static final JobStateReason
 112         SUBMISSION_INTERRUPTED = new JobStateReason(3);
 113 
 114     /**
 115      * The printer is transmitting the job to the output device.
 116      */
 117     public static final JobStateReason
 118         JOB_OUTGOING = new JobStateReason(4);
 119 
 120     /**
 121      * The value of the job's {@link JobHoldUntil JobHoldUntil} attribute was
 122      * specified with a date-time that is still in the future. The job must not
 123      * be a candidate for processing until this reason is removed and there are

 124      * no other reasons to hold the job. This value should be supported if the
 125      * {@link JobHoldUntil JobHoldUntil} job template attribute is supported.
 126      */
 127     public static final JobStateReason
 128         JOB_HOLD_UNTIL_SPECIFIED = new JobStateReason(5);
 129 
 130     /**
 131      * At least one of the resources needed by the job, such as media, fonts,
 132      * resource objects, etc., is not ready on any of the physical printers for
 133      * which the job is a candidate. This condition may be detected when the job
 134      * is accepted, or subsequently while the job is pending or processing,
 135      * depending on implementation. The job may remain in its current state or
 136      * be moved to the {@code PENDING_HELD} state, depending on implementation
 137      * and/or job scheduling policy.

 138      */
 139     public static final JobStateReason
 140         RESOURCES_ARE_NOT_READY = new JobStateReason(6);
 141 
 142     /**
 143      * The value of the printer's {@link PrinterStateReasons
 144      * PrinterStateReasons} attribute contains a
 145      * {@link PrinterStateReason PrinterStateReason} value of
 146      * {@code STOPPED_PARTLY}.
 147      */
 148     public static final JobStateReason
 149         PRINTER_STOPPED_PARTLY = new JobStateReason(7);
 150 
 151     /**
 152      * The value of the printer's {@link PrinterState PrinterState} attribute ia
 153      * {@code STOPPED}.
 154      */
 155     public static final JobStateReason
 156         PRINTER_STOPPED = new JobStateReason(8);
 157 
 158     /**
 159      * The job is in the {@code PROCESSING} state, but more specifically, the
 160      * printer ia interpreting the document data.
 161      */
 162     public static final JobStateReason
 163         JOB_INTERPRETING = new JobStateReason(9);
 164 
 165     /**
 166      * The job is in the {@code PROCESSING} state, but more specifically, the
 167      * printer has queued the document data.
 168      */
 169     public static final JobStateReason JOB_QUEUED = new JobStateReason(10);
 170 
 171     /**
 172      * The job is in the {@code PROCESSING} state, but more specifically, the
 173      * printer is interpreting document data and producing another electronic
 174      * representation.
 175      */
 176     public static final JobStateReason
 177         JOB_TRANSFORMING = new JobStateReason(11);
 178 
 179     /**
 180      * The job is in the {@code PENDING_HELD}, {@code PENDING}, or
 181      * {@code PROCESSING} state, but more specifically, the printer has
 182      * completed enough processing of the document to be able to start marking
 183      * and the job is waiting for the marker. Systems that require human
 184      * intervention to release jobs put the job into the {@code PENDING_HELD}
 185      * job state. Systems that automatically select a job to use the marker put
 186      * the job into the {@code PENDING} job state or keep the job in the
 187      * {@code PROCESSING} job state while waiting for the marker, depending on
 188      * implementation. All implementations put the job into (or back into) the
 189      * {@code PROCESSING} state when marking does begin.
 190      */
 191     public static final JobStateReason
 192         JOB_QUEUED_FOR_MARKER = new JobStateReason(12);
 193 
 194     /**
 195      * The output device is marking media. This value is useful for printers
 196      * which spend a great deal of time processing (1) when no marking is
 197      * happening and then want to show that marking is now happening or (2) when
 198      * the job is in the process of being canceled or aborted while the job
 199      * remains in the {@code PROCESSING} state, but the marking has not yet
 200      * stopped so that impression or sheet counts are still increasing for the
 201      * job.
 202      */
 203     public static final JobStateReason
 204         JOB_PRINTING = new JobStateReason(13);
 205 
 206     /**
 207      * The job was canceled by the owner of the job, i.e., by a user whose
 208      * authenticated identity is the same as the value of the originating user
 209      * that created the Print Job, or by some other authorized end-user, such as
 210      * a member of the job owner's security group. This value should be
 211      * supported.
 212      */
 213     public static final JobStateReason
 214         JOB_CANCELED_BY_USER = new JobStateReason(14);
 215 
 216     /**
 217      * The job was canceled by the operator, i.e., by a user who has been
 218      * authenticated as having operator privileges (whether local or remote). If
 219      * the security policy is to allow anyone to cancel anyone's job, then this
 220      * value may be used when the job is canceled by someone other than the
 221      * owner of the job. For such a security policy, in effect, everyone is an
 222      * operator as far as canceling jobs is concerned. This value should be
 223      * supported if the implementation permits canceling by someone other than
 224      * the owner of the job.
 225      */
 226     public static final JobStateReason
 227         JOB_CANCELED_BY_OPERATOR = new JobStateReason(15);
 228 
 229     /**
 230      * The job was canceled by an unidentified local user, i.e., a user at a
 231      * console at the device. This value should be supported if the
 232      * implementation supports canceling jobs at the console.
 233      */
 234     public static final JobStateReason
 235         JOB_CANCELED_AT_DEVICE = new JobStateReason(16);
 236 
 237     /**
 238      * The job was aborted by the system. Either the job (1) is in the process
 239      * of being aborted, (2) has been aborted by the system and placed in the
 240      * {@code ABORTED} state, or (3) has been aborted by the system and placed
 241      * in the {@code PENDING_HELD} state, so that a user or operator can
 242      * manually try the job again. This value should be supported.
 243      */
 244     public static final JobStateReason
 245         ABORTED_BY_SYSTEM = new JobStateReason(17);
 246 
 247     /**
 248      * The job was aborted by the system because the printer determined while
 249      * attempting to decompress the document's data that the compression is
 250      * actually not among those supported by the printer. This value must be
 251      * supported, since {@link Compression Compression} is a required doc
 252      * description attribute.
 253      */
 254     public static final JobStateReason
 255         UNSUPPORTED_COMPRESSION = new JobStateReason(18);
 256 
 257     /**
 258      * The job was aborted by the system because the printer encountered an
 259      * error in the document data while decompressing it. If the printer posts
 260      * this reason, the document data has already passed any tests that would
 261      * have led to the {@code UNSUPPORTED_COMPRESSION} job state reason.
 262      */
 263     public static final JobStateReason
 264         COMPRESSION_ERROR = new JobStateReason(19);
 265 
 266     /**
 267      * The job was aborted by the system because the document data's document
 268      * format (doc flavor) is not among those supported by the printer. If the
 269      * client specifies a doc flavor with a MIME type of
 270      * {@code "application/octet-stream"}, the printer may abort the job if the
 271      * printer cannot determine the document data's actual format through
 272      * auto-sensing (even if the printer supports the document format if
 273      * specified explicitly). This value must be supported, since a doc flavor
 274      * is required to be specified for each doc.
 275      */
 276     public static final JobStateReason
 277         UNSUPPORTED_DOCUMENT_FORMAT = new JobStateReason(20);
 278 
 279     /**
 280      * The job was aborted by the system because the printer encountered an
 281      * error in the document data while processing it. If the printer posts this
 282      * reason, the document data has already passed any tests that would have
 283      * led to the {@code UNSUPPORTED_DOCUMENT_FORMAT} job state reason.
 284      */
 285     public static final JobStateReason
 286         DOCUMENT_FORMAT_ERROR = new JobStateReason(21);
 287 
 288     /**
 289      * The requester has canceled the job or the printer has aborted the job,
 290      * but the printer is still performing some actions on the job until a
 291      * specified stop point occurs or job termination/cleanup is completed.
 292      * <p>
 293      * If the implementation requires some measurable time to cancel the job in
 294      * the {@code PROCESSING} or {@code PROCESSING_STOPPED} job states, the
 295      * printer must use this reason to indicate that the printer is still
 296      * performing some actions on the job while the job remains in the
 297      * {@code PROCESSING} or {@code PROCESSING_STOPPED} state. After all the
 298      * job's job description attributes have stopped incrementing, the printer
 299      * moves the job from the PROCESSING state to the {@code CANCELED} or
 300      * {@code ABORTED} job states.
 301      */
 302     public static final JobStateReason
 303         PROCESSING_TO_STOP_POINT = new JobStateReason(22);
 304 
 305     /**
 306      * The printer is off-line and accepting no jobs. All {@code PENDING} jobs
 307      * are put into the {@code PENDING_HELD} state. This situation could be true
 308      * if the service's or document transform's input is impaired or broken.
 309      */
 310     public static final JobStateReason
 311         SERVICE_OFF_LINE = new JobStateReason(23);
 312 
 313     /**
 314      * The job completed successfully. This value should be supported.
 315      */
 316     public static final JobStateReason
 317         JOB_COMPLETED_SUCCESSFULLY = new JobStateReason(24);
 318 
 319     /**
 320      * The job completed with warnings. This value should be supported if the
 321      * implementation detects warnings.
 322      */
 323     public static final JobStateReason
 324         JOB_COMPLETED_WITH_WARNINGS = new JobStateReason(25);
 325 
 326     /**
 327      * The job completed with errors (and possibly warnings too). This value
 328      * should be supported if the implementation detects errors.
 329      */
 330     public static final JobStateReason
 331         JOB_COMPLETED_WITH_ERRORS = new JobStateReason(26);
 332 
 333     /**
 334      * This job is retained and is currently able to be restarted. If
 335      * {@code JOB_RESTARTABLE} is contained in the job's
 336      * {@link JobStateReasons JobStateReasons} attribute, then the printer must
 337      * accept a request to restart that job. This value should be supported if
 338      * restarting jobs is supported. <i>[The capability for restarting jobs is
 339      * not in the Java Print Service API at present.]</i>
 340      */
 341     public static final JobStateReason
 342         JOB_RESTARTABLE = new JobStateReason(27);
 343 
 344     /**
 345      * The job has been forwarded to a device or print system that is unable to
 346      * send back status. The printer sets the job's {@link JobState JobState}
 347      * attribute to {@code COMPLETED} and adds the {@code QUEUED_IN_DEVICE}
 348      * reason to the job's {@link JobStateReasons JobStateReasons} attribute to
 349      * indicate that the printer has no additional information about the job and
 350      * never will have any better information.
 351      */
 352     public static final JobStateReason
 353         QUEUED_IN_DEVICE = new JobStateReason(28);
 354 
 355     /**
 356      * Construct a new job state reason enumeration value with the given integer
 357      * value.
 358      *
 359      * @param  value Integer value
 360      */
 361     protected JobStateReason(int value) {
 362         super (value);
 363     }
 364 
 365     /**
 366      * The string table for class {@code JobStateReason}.
 367      */
 368     private static final String[] myStringTable = {
 369         "job-incoming",
 370         "job-data-insufficient",
 371         "document-access-error",
 372         "submission-interrupted",
 373         "job-outgoing",
 374         "job-hold-until-specified",
 375         "resources-are-not-ready",
 376         "printer-stopped-partly",
 377         "printer-stopped",
 378         "job-interpreting",
 379         "job-queued",
 380         "job-transforming",
 381         "job-queued-for-marker",
 382         "job-printing",
 383         "job-canceled-by-user",
 384         "job-canceled-by-operator",
 385         "job-canceled-at-device",
 386         "aborted-by-system",
 387         "unsupported-compression",
 388         "compression-error",
 389         "unsupported-document-format",
 390         "document-format-error",
 391         "processing-to-stop-point",
 392         "service-off-line",
 393         "job-completed-successfully",
 394         "job-completed-with-warnings",
 395         "job-completed-with-errors",
 396         "job-restartable",
 397         "queued-in-device"};
 398 
 399     /**
 400      * The enumeration value table for class {@code JobStateReason}.
 401      */
 402     private static final JobStateReason[] myEnumValueTable = {
 403         JOB_INCOMING,
 404         JOB_DATA_INSUFFICIENT,
 405         DOCUMENT_ACCESS_ERROR,
 406         SUBMISSION_INTERRUPTED,
 407         JOB_OUTGOING,
 408         JOB_HOLD_UNTIL_SPECIFIED,
 409         RESOURCES_ARE_NOT_READY,
 410         PRINTER_STOPPED_PARTLY,
 411         PRINTER_STOPPED,
 412         JOB_INTERPRETING,
 413         JOB_QUEUED,
 414         JOB_TRANSFORMING,
 415         JOB_QUEUED_FOR_MARKER,
 416         JOB_PRINTING,
 417         JOB_CANCELED_BY_USER,
 418         JOB_CANCELED_BY_OPERATOR,
 419         JOB_CANCELED_AT_DEVICE,
 420         ABORTED_BY_SYSTEM,
 421         UNSUPPORTED_COMPRESSION,
 422         COMPRESSION_ERROR,
 423         UNSUPPORTED_DOCUMENT_FORMAT,
 424         DOCUMENT_FORMAT_ERROR,
 425         PROCESSING_TO_STOP_POINT,
 426         SERVICE_OFF_LINE,
 427         JOB_COMPLETED_SUCCESSFULLY,
 428         JOB_COMPLETED_WITH_WARNINGS,
 429         JOB_COMPLETED_WITH_ERRORS,
 430         JOB_RESTARTABLE,
 431         QUEUED_IN_DEVICE};
 432 
 433     /**
 434      * Returns the string table for class {@code JobStateReason}.
 435      */
 436     protected String[] getStringTable() {
 437         return myStringTable.clone();
 438     }
 439 
 440     /**
 441      * Returns the enumeration value table for class {@code JobStateReason}.
 442      */
 443     protected EnumSyntax[] getEnumValueTable() {
 444         return (EnumSyntax[])myEnumValueTable.clone();
 445     }
 446 

 447     /**
 448      * Get the printing attribute class which is to be used as the "category"
 449      * for this printing attribute value.
 450      * <p>
 451      * For class {@code JobStateReason} and any vendor-defined subclasses, the
 452      * category is class {@code JobStateReason} itself.
 453      *
 454      * @return printing attribute class (category), an instance of class
 455      *         {@link Class java.lang.Class}
 456      */
 457     public final Class<? extends Attribute> getCategory() {
 458         return JobStateReason.class;
 459     }
 460 
 461     /**
 462      * Get the name of the category of which this attribute value is an
 463      * instance.
 464      * <p>
 465      * For class {@code JobStateReason} and any vendor-defined subclasses, the
 466      * category name is {@code "job-state-reason"}.
 467      *
 468      * @return attribute category name
 469      */
 470     public final String getName() {
 471         return "job-state-reason";
 472     }

 473 }
< prev index next >