]> git.ipfire.org Git - thirdparty/cups.git/blob - scripting/java/src/com/easysw/cups/IPPStatus.java
Load cups into easysw/current.
[thirdparty/cups.git] / scripting / java / src / com / easysw / cups / IPPStatus.java
1 package com.easysw.cups;
2
3 /**
4 * @version 1.00 06-NOV-2002
5 * @author Apple Inc.
6 *
7 * Internet Printing Protocol definitions for the Common UNIX Printing
8 * System (CUPS).
9 *
10 * Copyright 2007 by Apple Inc.
11 * Copyright 1997-2002 by Easy Software Products.
12 *
13 * These coded instructions, statements, and computer programs are the
14 * property of Apple Inc. and are protected by Federal copyright
15 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
16 * which should have been included with this file. If this file is
17 * file is missing or damaged, see the license at "http://www.cups.org/".
18 */
19
20 /**
21 * Class to convert a status code to text.
22 *
23 * @author TDB
24 * @version 1.0
25 * @since JDK1.3
26 */
27
28 public class IPPStatus
29 {
30 int status;
31 String status_text;
32
33 /**
34 * Constructor, access the <code>status_text</code> member
35 * after creation.
36 *
37 * @param <code>p_status</code> Status code to convert.
38 * @see <code>IPPDefs</code>
39 */
40 public IPPStatus( int p_status )
41 {
42 status = p_status;
43 switch( status )
44 {
45 case IPPDefs.OK:
46 status_text = "OK";
47 break;
48 case IPPDefs.OK_SUBST:
49 status_text = "OK, substituted";
50 break;
51 case IPPDefs.OK_CONFLICT:
52 status_text = "OK, conflict";
53 break;
54 case IPPDefs.OK_IGNORED_SUBSCRIPTIONS:
55 status_text = "OK, ignored subscriptions";
56 break;
57 case IPPDefs.OK_IGNORED_NOTIFICATIONS:
58 status_text = "OK, ignored notifications";
59 break;
60 case IPPDefs.OK_TOO_MANY_EVENTS:
61 status_text = "OK, too many events";
62 break;
63 case IPPDefs.OK_BUT_CANCEL_SUBSCRIPTION:
64 status_text = "OK, but cancel subscription";
65 break;
66 case IPPDefs.REDIRECTION_OTHER_SITE:
67 status_text = "Redirected to other site";
68 break;
69 case IPPDefs.BAD_REQUEST:
70 status_text = "Bad request";
71 break;
72 case IPPDefs.FORBIDDEN:
73 status_text = "Forbidden";
74 break;
75 case IPPDefs.NOT_AUTHENTICATED:
76 status_text = "Not authenticated";
77 break;
78 case IPPDefs.NOT_AUTHORIZED:
79 status_text = "Not authorized";
80 break;
81 case IPPDefs.NOT_POSSIBLE:
82 status_text = "Not possible";
83 break;
84 case IPPDefs.TIMEOUT:
85 status_text = "Timeout";
86 break;
87 case IPPDefs.NOT_FOUND:
88 status_text = "Not found";
89 break;
90 case IPPDefs.GONE:
91 status_text = "Gone";
92 break;
93 case IPPDefs.REQUEST_ENTITY:
94 status_text = "Request entity";
95 break;
96 case IPPDefs.REQUEST_VALUE:
97 status_text = "Request value";
98 break;
99 case IPPDefs.DOCUMENT_FORMAT:
100 status_text = "Document format";
101 break;
102 case IPPDefs.ATTRIBUTES:
103 status_text = "Attributes";
104 break;
105 case IPPDefs.URI_SCHEME:
106 status_text = "URI scheme";
107 break;
108 case IPPDefs.CHARSET:
109 status_text = "Charset";
110 break;
111 case IPPDefs.CONFLICT:
112 status_text = "Conflict";
113 break;
114 case IPPDefs.COMPRESSION_NOT_SUPPORTED:
115 status_text = "Compression not supported";
116 break;
117 case IPPDefs.COMPRESSION_ERROR:
118 status_text = "Compression error";
119 break;
120 case IPPDefs.DOCUMENT_FORMAT_ERROR:
121 status_text = "Document format error";
122 break;
123 case IPPDefs.DOCUMENT_ACCESS_ERROR:
124 status_text = "Document access error";
125 break;
126 case IPPDefs.ATTRIBUTES_NOT_SETTABLE:
127 status_text = "Attributes not settable";
128 break;
129 case IPPDefs.IGNORED_ALL_SUBSCRIPTIONS:
130 status_text = "Ignored all subscriptions";
131 break;
132 case IPPDefs.TOO_MANY_SUBSCRIPTIONS:
133 status_text = "Too many subscriptions";
134 break;
135 case IPPDefs.IGNORED_ALL_NOTIFICATIONS:
136 status_text = "Ingored all notifications";
137 break;
138 case IPPDefs.PRINT_SUPPORT_FILE_NOT_FOUND:
139 status_text = "Support file not found";
140 break;
141 case IPPDefs.INTERNAL_ERROR:
142 status_text = "Internal error";
143 break;
144 case IPPDefs.OPERATION_NOT_SUPPORTED:
145 status_text = "Operation not supported";
146 break;
147 case IPPDefs.SERVICE_UNAVAILABLE:
148 status_text = "Service unavailable";
149 break;
150 case IPPDefs.VERSION_NOT_SUPPORTED:
151 status_text = "Version not supported";
152 break;
153 case IPPDefs.DEVICE_ERROR:
154 status_text = "Device error";
155 break;
156 case IPPDefs.TEMPORARY_ERROR:
157 status_text = "Temporary error";
158 break;
159 case IPPDefs.NOT_ACCEPTING:
160 status_text = "Not accepting";
161 break;
162 case IPPDefs.PRINTER_BUSY:
163 status_text = "Printer busy";
164 break;
165 case IPPDefs.ERROR_JOB_CANCELLED:
166 status_text = "Error, job cancelled";
167 break;
168 case IPPDefs.MULTIPLE_JOBS_NOT_SUPPORTED:
169 status_text = "Multiple jobs not supported";
170 break;
171 case IPPDefs.PRINTER_IS_DEACTIVATED:
172 status_text = "Printer is de-activated";
173 break;
174 default:
175 status_text = "Unknown error";
176 }
177 }
178
179
180
181
182
183 } // End of IPPStatus class
184
185
186