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