Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/print/attribute/standard/JobStateReason.java
38918 views
/*1* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/24package javax.print.attribute.standard;2526import javax.print.attribute.EnumSyntax;27import javax.print.attribute.Attribute;2829/**30* Class JobStateReason is a printing attribute class, an enumeration, that31* provides additional information about the job's current state, i.e.,32* information that augments the value of the job's {@link JobState JobState}33* attribute. Class JobStateReason defines standard job state reason values. A34* Print Service implementation only needs to report those job state35* reasons which are appropriate for the particular implementation; it does not36* have to report every defined job state reason.37* <P>38* Instances of JobStateReason do not appear in a Print Job's attribute set39* directly. Rather, a {@link JobStateReasons JobStateReasons} attribute appears40* in the Print Job's attribute set. The {@link JobStateReasons JobStateReasons}41* attribute contains zero, one, or more than one JobStateReason objects which42* pertain to the Print Job's status. The printer adds a JobStateReason object43* to the Print Job's {@link JobStateReasons JobStateReasons} attribute when the44* corresponding condition becomes true of the Print Job, and the printer45* removes the JobStateReason object again when the corresponding condition46* becomes false, regardless of whether the Print Job's overall {@link JobState47* JobState} also changed.48* <P>49* <B>IPP Compatibility:</B> The category name returned by50* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's51* integer value is the IPP enum value. The <code>toString()</code> method52* returns the IPP string representation of the attribute value.53* <P>54*55* @author Alan Kaminsky56*/57public class JobStateReason extends EnumSyntax implements Attribute {5859private static final long serialVersionUID = -8765894420449009168L;6061/**62* The printer has created the Print Job, but the printer has not finished63* accessing or accepting all the print data yet.64*/65public static final JobStateReason66JOB_INCOMING = new JobStateReason(0);6768/**69* The printer has created the Print Job, but the printer is expecting70* additional print data before it can move the job into the PROCESSING71* state. If a printer starts processing before it has received all data,72* the printer removes the JOB_DATA_INSUFFICIENT reason, but the73* JOB_INCOMING reason remains. If a printer starts processing after it74* has received all data, the printer removes the JOB_DATA_INSUFFICIENT75* and JOB_INCOMING reasons at the same time.76*/77public static final JobStateReason78JOB_DATA_INSUFFICIENT = new JobStateReason(1);7980/**81* The Printer could not access one or more documents passed by reference82* (i.e., the print data representation object is a URL). This reason is83* intended to cover any file access problem,including file does not exist84* and access denied because of an access control problem. Whether the85* printer aborts the job and moves the job to the ABORTED job state or86* prints all documents that are accessible and moves the job to the87* COMPLETED job state and adds the COMPLETED_WITH_ERRORS reason to the88* job's {@link JobStateReasons JobStateReasons} attribute depends on89* implementation and/or site policy. This value should be supported if90* the printer supports doc flavors with URL print data representation91* objects.92*/93public static final JobStateReason94DOCUMENT_ACCESS_ERROR = new JobStateReason(2);9596/**97* The job was not completely submitted for some unforeseen reason.98* Possibilities include (1) the printer has crashed before the job was99* fully submitted by the client, (2) the printer or the document transfer100* method has crashed in some non-recoverable way before the document data101* was entirely transferred to the printer, (3) the client crashed before102* the job was fully submitted.103*/104public static final JobStateReason105SUBMISSION_INTERRUPTED = new JobStateReason(3);106107/**108* The printer is transmitting the job to the output device.109*/110public static final JobStateReason111JOB_OUTGOING = new JobStateReason(4);112113/**114* The value of the job's {@link JobHoldUntil JobHoldUntil} attribute was115* specified with a date-time that is still in the future. The job must116* not be a candidate for processing until this reason is removed and117* there are118* no other reasons to hold the job. This value should be supported if the119* {@link JobHoldUntil JobHoldUntil} job template attribute is supported.120*/121public static final JobStateReason122JOB_HOLD_UNTIL_SPECIFIED = new JobStateReason(5);123124/**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 printers127* for which the job is a candidate. This condition may be detected128* when the job is accepted, or subsequently while the job is pending129* or processing, depending on implementation.130* The job may remain in its current state or131* be moved to the PENDING_HELD state, depending on implementation and/or132* job scheduling policy.133*/134public static final JobStateReason135RESOURCES_ARE_NOT_READY = new JobStateReason(6);136137/**138* The value of the printer's {@link PrinterStateReasons139* PrinterStateReasons} attribute contains a {@link PrinterStateReason140* PrinterStateReason} value of STOPPED_PARTLY.141*/142public static final JobStateReason143PRINTER_STOPPED_PARTLY = new JobStateReason(7);144145/**146* The value of the printer's {@link PrinterState PrinterState} attribute147* ia STOPPED.148*/149public static final JobStateReason150PRINTER_STOPPED = new JobStateReason(8);151152/**153* The job is in the PROCESSING state, but more specifically, the printer154* ia interpreting the document data.155*/156public static final JobStateReason157JOB_INTERPRETING = new JobStateReason(9);158159/**160* The job is in the PROCESSING state, but more specifically, the printer161* has queued the document data.162*/163public static final JobStateReason JOB_QUEUED = new JobStateReason(10);164165/**166* The job is in the PROCESSING state, but more specifically, the printer167* is interpreting document data and producing another electronic168* representation.169*/170public static final JobStateReason171JOB_TRANSFORMING = new JobStateReason(11);172173/**174* The job is in the PENDING_HELD, PENDING, or PROCESSING state, but more175* specifically, the printer has completed enough processing of the document176* 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 into178* the PENDING_HELD job state. Systems that automatically select a job to179* use the marker put the job into the PENDING job state or keep the job180* in the PROCESSING job state while waiting for the marker, depending on181* implementation. All implementations put the job into (or back into) the182* PROCESSING state when marking does begin.183*/184public static final JobStateReason185JOB_QUEUED_FOR_MARKER = new JobStateReason(12);186187/**188* The output device is marking media. This value is useful for printers189* which spend a great deal of time processing (1) when no marking is190* happening and then want to show that marking is now happening or (2) when191* the job is in the process of being canceled or aborted while the job192* remains in the PROCESSING state, but the marking has not yet stopped so193* that impression or sheet counts are still increasing for the job.194*/195public static final JobStateReason196JOB_PRINTING = new JobStateReason(13);197198/**199* The job was canceled by the owner of the job, i.e., by a user whose200* authenticated identity is the same as the value of the originating user201* that created the Print Job, or by some other authorized end-user, such as202* a member of the job owner's security group. This value should be203* supported.204*/205public static final JobStateReason206JOB_CANCELED_BY_USER = new JobStateReason(14);207208/**209* The job was canceled by the operator, i.e., by a user who has been210* authenticated as having operator privileges (whether local or remote). If211* the security policy is to allow anyone to cancel anyone's job, then this212* value may be used when the job is canceled by someone other than the213* owner of the job. For such a security policy, in effect, everyone is an214* operator as far as canceling jobs is concerned. This value should be215* supported if the implementation permits canceling by someone other than216* the owner of the job.217*/218public static final JobStateReason219JOB_CANCELED_BY_OPERATOR = new JobStateReason(15);220221/**222* The job was canceled by an unidentified local user, i.e., a user at a223* console at the device. This value should be supported if the224* implementation supports canceling jobs at the console.225*/226public static final JobStateReason227JOB_CANCELED_AT_DEVICE = new JobStateReason(16);228229/**230* The job was aborted by the system. Either the job (1) is in the process231* of being aborted, (2) has been aborted by the system and placed in the232* ABORTED state, or (3) has been aborted by the system and placed in the233* PENDING_HELD state, so that a user or operator can manually try the job234* again. This value should be supported.235*/236public static final JobStateReason237ABORTED_BY_SYSTEM = new JobStateReason(17);238239/**240* The job was aborted by the system because the printer determined while241* attempting to decompress the document's data that the compression is242* actually not among those supported by the printer. This value must be243* supported, since {@link Compression Compression} is a required doc244* description attribute.245*/246public static final JobStateReason247UNSUPPORTED_COMPRESSION = new JobStateReason(18);248249/**250* The job was aborted by the system because the printer encountered an251* error in the document data while decompressing it. If the printer posts252* this reason, the document data has already passed any tests that would253* have led to the UNSUPPORTED_COMPRESSION job state reason.254*/255public static final JobStateReason256COMPRESSION_ERROR = new JobStateReason(19);257258/**259* The job was aborted by the system because the document data's document260* format (doc flavor) is not among those supported by the printer. If the261* client specifies a doc flavor with a MIME type of262* <CODE>"application/octet-stream"</CODE>, the printer may abort the job if263* the printer cannot determine the document data's actual format through264* auto-sensing (even if the printer supports the document format if265* specified explicitly). This value must be supported, since a doc flavor266* is required to be specified for each doc.267*/268public static final JobStateReason269UNSUPPORTED_DOCUMENT_FORMAT = new JobStateReason(20);270271/**272* The job was aborted by the system because the printer encountered an273* error in the document data while processing it. If the printer posts this274* reason, the document data has already passed any tests that would have275* led to the UNSUPPORTED_DOCUMENT_FORMAT job state reason.276*/277public static final JobStateReason278DOCUMENT_FORMAT_ERROR = new JobStateReason(21);279280/**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 a283* specified stop point occurs or job termination/cleanup is completed.284* <P>285* If the implementation requires some measurable time to cancel the job in286* the PROCESSING or PROCESSING_STOPPED job states, the printer must use287* this reason to indicate that the printer is still performing some actions288* on the job while the job remains in the PROCESSING or PROCESSING_STOPPED289* state. After all the job's job description attributes have stopped290* incrementing, the printer moves the job from the PROCESSING state to the291* CANCELED or ABORTED job states.292*/293public static final JobStateReason294PROCESSING_TO_STOP_POINT = new JobStateReason(22);295296/**297* The printer is off-line and accepting no jobs. All PENDING jobs are put298* into the PENDING_HELD state. This situation could be true if the299* service's or document transform's input is impaired or broken.300*/301public static final JobStateReason302SERVICE_OFF_LINE = new JobStateReason(23);303304/**305* The job completed successfully. This value should be supported.306*/307public static final JobStateReason308JOB_COMPLETED_SUCCESSFULLY = new JobStateReason(24);309310/**311* The job completed with warnings. This value should be supported if the312* implementation detects warnings.313*/314public static final JobStateReason315JOB_COMPLETED_WITH_WARNINGS = new JobStateReason(25);316317/**318* The job completed with errors (and possibly warnings too). This value319* should be supported if the implementation detects errors.320*/321public static final JobStateReason322JOB_COMPLETED_WITH_ERRORS = new JobStateReason(26);323324/**325* This job is retained and is currently able to be restarted. If326* JOB_RESTARTABLE is contained in the job's {@link JobStateReasons327* JobStateReasons} attribute, then the printer must accept a request to328* restart that job. This value should be supported if restarting jobs is329* supported. <I>[The capability for restarting jobs is not in the Java330* Print Service API at present.]</I>331*/332public static final JobStateReason333JOB_RESTARTABLE = new JobStateReason(27);334335/**336* The job has been forwarded to a device or print system that is unable to337* 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's339* {@link JobStateReasons JobStateReasons} attribute to indicate that the340* printer has no additional information about the job and never will have341* any better information.342*/343public static final JobStateReason344QUEUED_IN_DEVICE = new JobStateReason(28);345346/**347* Construct a new job state reason enumeration value with the given348* integer value.349*350* @param value Integer value.351*/352protected JobStateReason(int value) {353super (value);354}355356private 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"};386387private static final JobStateReason[] myEnumValueTable = {388JOB_INCOMING,389JOB_DATA_INSUFFICIENT,390DOCUMENT_ACCESS_ERROR,391SUBMISSION_INTERRUPTED,392JOB_OUTGOING,393JOB_HOLD_UNTIL_SPECIFIED,394RESOURCES_ARE_NOT_READY,395PRINTER_STOPPED_PARTLY,396PRINTER_STOPPED,397JOB_INTERPRETING,398JOB_QUEUED,399JOB_TRANSFORMING,400JOB_QUEUED_FOR_MARKER,401JOB_PRINTING,402JOB_CANCELED_BY_USER,403JOB_CANCELED_BY_OPERATOR,404JOB_CANCELED_AT_DEVICE,405ABORTED_BY_SYSTEM,406UNSUPPORTED_COMPRESSION,407COMPRESSION_ERROR,408UNSUPPORTED_DOCUMENT_FORMAT,409DOCUMENT_FORMAT_ERROR,410PROCESSING_TO_STOP_POINT,411SERVICE_OFF_LINE,412JOB_COMPLETED_SUCCESSFULLY,413JOB_COMPLETED_WITH_WARNINGS,414JOB_COMPLETED_WITH_ERRORS,415JOB_RESTARTABLE,416QUEUED_IN_DEVICE};417418/**419* Returns the string table for class JobStateReason.420*/421protected String[] getStringTable() {422return (String[])myStringTable.clone();423}424425/**426* Returns the enumeration value table for class JobStateReason.427*/428protected EnumSyntax[] getEnumValueTable() {429return (EnumSyntax[])myEnumValueTable.clone();430}431432433/**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, the438* category is class JobStateReason itself.439*440* @return Printing attribute class (category), an instance of class441* {@link java.lang.Class java.lang.Class}.442*/443public final Class<? extends Attribute> getCategory() {444return JobStateReason.class;445}446447/**448* Get the name of the category of which this attribute value is an449* instance.450* <P>451* For class JobStateReason and any vendor-defined subclasses, the452* category name is <CODE>"job-state-reason"</CODE>.453*454* @return Attribute category name.455*/456public final String getName() {457return "job-state-reason";458}459460}461462463