001/*
002 * Copyright 2007-2019 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright (C) 2008-2019 Ping Identity Corporation
007 *
008 * This program is free software; you can redistribute it and/or modify
009 * it under the terms of the GNU General Public License (GPLv2 only)
010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011 * as published by the Free Software Foundation.
012 *
013 * This program is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016 * GNU General Public License for more details.
017 *
018 * You should have received a copy of the GNU General Public License
019 * along with this program; if not, see <http://www.gnu.org/licenses>.
020 */
021package com.unboundid.ldap.sdk;
022
023
024
025import java.io.Serializable;
026import java.util.concurrent.ConcurrentHashMap;
027
028import com.unboundid.util.NotMutable;
029import com.unboundid.util.StaticUtils;
030import com.unboundid.util.ThreadSafety;
031import com.unboundid.util.ThreadSafetyLevel;
032
033import static com.unboundid.ldap.sdk.LDAPMessages.*;
034
035
036
037/**
038 * This class defines a number of constants associated with LDAP result codes.
039 * The {@code ResultCode} constant values defined in this class are immutable,
040 * and at most one result code object will ever be created for a given int
041 * value, so it is acceptable to compare result codes with either the
042 * {@link ResultCode#equals} method or the "{@code ==}" operator.
043 *<BR><BR>
044 * The result codes that are currently defined include:
045 * <BR>
046 * <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="50%"
047 *        SUMMARY="Result Code Names and Numeric Values">
048 *   <TR>
049 *     <TH ALIGN="LEFT">Name</TH>
050 *     <TH ALIGN="RIGHT">Integer Value</TH>
051 *   </TR>
052 *   <TR>
053 *     <TD ALIGN="LEFT">SUCCESS</TD>
054 *     <TD ALIGN="RIGHT">0</TD>
055 *   </TR>
056 *   <TR>
057 *     <TD ALIGN="LEFT">OPERATIONS_ERROR</TD>
058 *     <TD ALIGN="RIGHT">1</TD>
059 *   </TR>
060 *   <TR>
061 *     <TD ALIGN="LEFT">PROTOCOL_ERROR</TD>
062 *     <TD ALIGN="RIGHT">2</TD>
063 *   </TR>
064 *   <TR>
065 *     <TD ALIGN="LEFT">TIME_LIMIT_EXCEEDED</TD>
066 *     <TD ALIGN="RIGHT">3</TD>
067 *   </TR>
068 *   <TR>
069 *     <TD ALIGN="LEFT">SIZE_LIMIT_EXCEEDED</TD>
070 *     <TD ALIGN="RIGHT">4</TD>
071 *   </TR>
072 *   <TR>
073 *     <TD ALIGN="LEFT">COMPARE_FALSE</TD>
074 *     <TD ALIGN="RIGHT">5</TD>
075 *   </TR>
076 *   <TR>
077 *     <TD ALIGN="LEFT">COMPARE_TRUE</TD>
078 *     <TD ALIGN="RIGHT">6</TD>
079 *   </TR>
080 *   <TR>
081 *     <TD ALIGN="LEFT">AUTH_METHOD_NOT_SUPPORTED</TD>
082 *     <TD ALIGN="RIGHT">7</TD>
083 *   </TR>
084 *   <TR>
085 *     <TD ALIGN="LEFT">STRONG_AUTH_REQUIRED</TD>
086 *     <TD ALIGN="RIGHT">8</TD>
087 *   </TR>
088 *   <TR>
089 *     <TD ALIGN="LEFT">REFERRAL</TD>
090 *     <TD ALIGN="RIGHT">10</TD>
091 *   </TR>
092 *   <TR>
093 *    <TD ALIGN="LEFT">ADMIN_LIMIT_EXCEEDED</TD>
094 *     <TD ALIGN="RIGHT">11</TD>
095 *   </TR>
096 *   <TR>
097 *     <TD ALIGN="LEFT">UNAVAILABLE_CRITICAL_EXTENSION</TD>
098 *     <TD ALIGN="RIGHT">12</TD>
099 *   </TR>
100 *   <TR>
101 *     <TD ALIGN="LEFT">CONFIDENTIALITY_REQUIRED</TD>
102 *     <TD ALIGN="RIGHT">13</TD>
103 *   </TR>
104 *   <TR>
105 *     <TD ALIGN="LEFT">SASL_BIND_IN_PROGRESS</TD>
106 *     <TD ALIGN="RIGHT">14</TD>
107 *   </TR>
108 *   <TR>
109 *     <TD ALIGN="LEFT">NO_SUCH_ATTRIBUTE</TD>
110 *     <TD ALIGN="RIGHT">16</TD>
111 *   </TR>
112 *   <TR>
113 *     <TD ALIGN="LEFT">UNDEFINED_ATTRIBUTE_TYPE</TD>
114 *     <TD ALIGN="RIGHT">17</TD>
115 *   </TR>
116 *   <TR>
117 *     <TD ALIGN="LEFT">INAPPROPRIATE_MATCHING</TD>
118 *     <TD ALIGN="RIGHT">18</TD>
119 *   </TR>
120 *   <TR>
121 *     <TD ALIGN="LEFT">CONSTRAINT_VIOLATION</TD>
122 *     <TD ALIGN="RIGHT">19</TD>
123 *   </TR>
124 *   <TR>
125 *     <TD ALIGN="LEFT">ATTRIBUTE_OR_VALUE_EXISTS</TD>
126 *     <TD ALIGN="RIGHT">20</TD>
127 *   </TR>
128 *   <TR>
129 *     <TD ALIGN="LEFT">INVALID_ATTRIBUTE_SYNTAX</TD>
130 *     <TD ALIGN="RIGHT">21</TD>
131 *   </TR>
132 *   <TR>
133 *     <TD ALIGN="LEFT">NO_SUCH_OBJECT</TD>
134 *     <TD ALIGN="RIGHT">32</TD>
135 *   </TR>
136 *   <TR>
137 *     <TD ALIGN="LEFT">ALIAS_PROBLEM</TD>
138 *     <TD ALIGN="RIGHT">33</TD>
139 *   </TR>
140 *   <TR>
141 *     <TD ALIGN="LEFT">INVALID_DN_SYNTAX</TD>
142 *     <TD ALIGN="RIGHT">34</TD>
143 *   </TR>
144 *   <TR>
145 *     <TD ALIGN="LEFT">ALIAS_DEREFERENCING_PROBLEM</TD>
146 *     <TD ALIGN="RIGHT">36</TD>
147 *   </TR>
148 *   <TR>
149 *     <TD ALIGN="LEFT">INAPPROPRIATE_AUTHENTICATION</TD>
150 *     <TD ALIGN="RIGHT">48</TD>
151 *   </TR>
152 *   <TR>
153 *     <TD ALIGN="LEFT">INVALID_CREDENTIALS</TD>
154 *     <TD ALIGN="RIGHT">49</TD>
155 *   </TR>
156 *   <TR>
157 *     <TD ALIGN="LEFT">INSUFFICIENT_ACCESS_RIGHTS</TD>
158 *     <TD ALIGN="RIGHT">50</TD>
159 *   </TR>
160 *   <TR>
161 *     <TD ALIGN="LEFT">BUSY</TD>
162 *     <TD ALIGN="RIGHT">51</TD>
163 *   </TR>
164 *   <TR>
165 *     <TD ALIGN="LEFT">UNAVAILABLE</TD>
166 *     <TD ALIGN="RIGHT">52</TD>
167 *   </TR>
168 *   <TR>
169 *     <TD ALIGN="LEFT">UNWILLING_TO_PERFORM</TD>
170 *     <TD ALIGN="RIGHT">53</TD>
171 *   </TR>
172 *   <TR>
173 *     <TD ALIGN="LEFT">LOOP_DETECT</TD>
174 *     <TD ALIGN="RIGHT">54</TD>
175 *   </TR>
176 *   <TR>
177 *     <TD ALIGN="LEFT">SORT_CONTROL_MISSING</TD>
178 *     <TD ALIGN="RIGHT">60</TD>
179 *   </TR>
180 *   <TR>
181 *     <TD ALIGN="LEFT">OFFSET_RANGE_ERROR</TD>
182 *     <TD ALIGN="RIGHT">61</TD>
183 *   </TR>
184 *   <TR>
185 *     <TD ALIGN="LEFT">NAMING_VIOLATION</TD>
186 *     <TD ALIGN="RIGHT">64</TD>
187 *   </TR>
188 *   <TR>
189 *     <TD ALIGN="LEFT">OBJECT_CLASS_VIOLATION</TD>
190 *     <TD ALIGN="RIGHT">65</TD>
191 *   </TR>
192 *   <TR>
193 *     <TD ALIGN="LEFT">NOT_ALLOWED_ON_NONLEAF</TD>
194 *     <TD ALIGN="RIGHT">66</TD>
195 *   </TR>
196 *   <TR>
197 *     <TD ALIGN="LEFT">NOT_ALLOWED_ON_NONLEAF</TD>
198 *     <TD ALIGN="RIGHT">66</TD>
199 *   </TR>
200 *   <TR>
201 *     <TD ALIGN="LEFT">NOT_ALLOWED_ON_RDN</TD>
202 *     <TD ALIGN="RIGHT">67</TD>
203 *   </TR>
204 *   <TR>
205 *     <TD ALIGN="LEFT">ENTRY_ALREADY_EXISTS</TD>
206 *     <TD ALIGN="RIGHT">68</TD>
207 *   </TR>
208 *   <TR>
209 *     <TD ALIGN="LEFT">OBJECT_CLASS_MODS_PROHIBITED</TD>
210 *     <TD ALIGN="RIGHT">69</TD>
211 *   </TR>
212 *   <TR>
213 *     <TD ALIGN="LEFT">AFFECTS_MULTIPLE_DSAS</TD>
214 *     <TD ALIGN="RIGHT">71</TD>
215 *   </TR>
216 *   <TR>
217 *     <TD ALIGN="LEFT">VIRTUAL_LIST_VIEW_ERROR</TD>
218 *     <TD ALIGN="RIGHT">76</TD>
219 *   </TR>
220 *   <TR>
221 *     <TD ALIGN="LEFT">OTHER</TD>
222 *     <TD ALIGN="RIGHT">80</TD>
223 *   </TR>
224 *   <TR>
225 *     <TD ALIGN="LEFT">SERVER_DOWN</TD>
226 *     <TD ALIGN="RIGHT">81</TD>
227 *   </TR>
228 *   <TR>
229 *     <TD ALIGN="LEFT">LOCAL_ERROR</TD>
230 *     <TD ALIGN="RIGHT">82</TD>
231 *   </TR>
232 *   <TR>
233 *     <TD ALIGN="LEFT">ENCODING_ERROR</TD>
234 *     <TD ALIGN="RIGHT">83</TD>
235 *   </TR>
236 *   <TR>
237 *     <TD ALIGN="LEFT">DECODING_ERROR</TD>
238 *     <TD ALIGN="RIGHT">84</TD>
239 *   </TR>
240 *   <TR>
241 *     <TD ALIGN="LEFT">TIMEOUT</TD>
242 *     <TD ALIGN="RIGHT">85</TD>
243 *   </TR>
244 *   <TR>
245 *     <TD ALIGN="LEFT">AUTH_UNKNOWN</TD>
246 *     <TD ALIGN="RIGHT">86</TD>
247 *   </TR>
248 *   <TR>
249 *     <TD ALIGN="LEFT">FILTER_ERROR</TD>
250 *      <TD ALIGN="RIGHT">87</TD>
251 *   </TR>
252 *   <TR>
253 *     <TD ALIGN="LEFT">USER_CANCELED</TD>
254 *     <TD ALIGN="RIGHT">88</TD>
255 *   </TR>
256 *   <TR>
257 *     <TD ALIGN="LEFT">PARAM_ERROR</TD>
258 *     <TD ALIGN="RIGHT">89</TD>
259 *   </TR>
260 *   <TR>
261 *     <TD ALIGN="LEFT">NO_MEMORY</TD>
262 *     <TD ALIGN="RIGHT">90</TD>
263 *   </TR>
264 *   <TR>
265 *     <TD ALIGN="LEFT">CONNECT_ERROR</TD>
266 *     <TD ALIGN="RIGHT">91</TD>
267 *   </TR>
268 *   <TR>
269 *     <TD ALIGN="LEFT">NOT_SUPPORTED</TD>
270 *     <TD ALIGN="RIGHT">92</TD>
271 *   </TR>
272 *   <TR>
273 *     <TD ALIGN="LEFT">CONTROL_NOT_FOUND</TD>
274 *     <TD ALIGN="RIGHT">93</TD>
275 *   </TR>
276 *   <TR>
277 *     <TD ALIGN="LEFT">NO_RESULTS_RETURNED</TD>
278 *     <TD ALIGN="RIGHT">94</TD>
279 *   </TR>
280 *   <TR>
281 *     <TD ALIGN="LEFT">MORE_RESULTS_TO_RETURN</TD>
282 *     <TD ALIGN="RIGHT">95</TD>
283 *   </TR>
284 *   <TR>
285 *     <TD ALIGN="LEFT">CLIENT_LOOP</TD>
286 *     <TD ALIGN="RIGHT">96</TD>
287 *   </TR>
288 *   <TR>
289 *     <TD ALIGN="LEFT">REFERRAL_LIMIT_EXCEEDED</TD>
290 *     <TD ALIGN="RIGHT">97</TD>
291 *   </TR>
292 *   <TR>
293 *     <TD ALIGN="LEFT">CANCELED</TD>
294 *     <TD ALIGN="RIGHT">118</TD>
295 *   </TR>
296 *   <TR>
297 *     <TD ALIGN="LEFT">NO_SUCH_OPERATION</TD>
298 *     <TD ALIGN="RIGHT">119</TD>
299 *   </TR>
300 *   <TR>
301 *     <TD ALIGN="LEFT">TOO_LATE</TD>
302 *     <TD ALIGN="RIGHT">120</TD>
303 *   </TR>
304 *   <TR>
305 *     <TD ALIGN="LEFT">CANNOT_CANCEL</TD>
306 *     <TD ALIGN="RIGHT">121</TD>
307 *   </TR>
308 *   <TR>
309 *     <TD ALIGN="LEFT">ASSERTION_FAILED</TD>
310 *     <TD ALIGN="RIGHT">122</TD>
311 *   </TR>
312 *   <TR>
313 *     <TD ALIGN="LEFT">AUTHORIZATION_DENIED</TD>
314 *     <TD ALIGN="RIGHT">123</TD>
315 *   </TR>
316 *   <TR>
317 *     <TD ALIGN="LEFT">E_SYNC_REFRESH_REQUIRED</TD>
318 *     <TD ALIGN="RIGHT">4096</TD>
319 *   </TR>
320 *   <TR>
321 *     <TD ALIGN="LEFT">NO_OPERATION</TD>
322 *     <TD ALIGN="RIGHT">16654</TD>
323 *   </TR>
324 *   <TR>
325 *     <TD ALIGN="LEFT">INTERACTIVE_TRANSACTION_ABORTED</TD>
326 *     <TD ALIGN="RIGHT">30221001</TD>
327 *   </TR>
328 *   <TR>
329 *     <TD ALIGN="LEFT">DATABASE_LOCK_CONFLICT</TD>
330 *     <TD ALIGN="RIGHT">30221002</TD>
331 *   </TR>
332 *   <TR>
333 *     <TD ALIGN="LEFT">MIRRORED_SUBTREE_DIGEST_MISMATCH</TD>
334 *     <TD ALIGN="RIGHT">30221003</TD>
335 *   </TR>
336 *   <TR>
337 *     <TD ALIGN="LEFT">TOKEN_DELIVERY_MECHANISM_UNAVAILABLE</TD>
338 *     <TD ALIGN="RIGHT">30221004</TD>
339 *   </TR>
340 *   <TR>
341 *     <TD ALIGN="LEFT">TOKEN_DELIVERY_ATTEMPT_FAILED</TD>
342 *     <TD ALIGN="RIGHT">30221005</TD>
343 *   </TR>
344 *   <TR>
345 *     <TD ALIGN="LEFT">TOKEN_DELIVERY_INVALID_RECIPIENT_ID</TD>
346 *     <TD ALIGN="RIGHT">30221006</TD>
347 *   </TR>
348 *   <TR>
349 *     <TD ALIGN="LEFT">TOKEN_DELIVERY_INVALID_ACCOUNT_STATE</TD>
350 *     <TD ALIGN="RIGHT">30221007</TD>
351 *   </TR>
352 * </TABLE>
353 */
354@NotMutable()
355@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
356public final class ResultCode
357       implements Serializable
358{
359  /**
360   * The integer value (0) for the "SUCCESS" result code.
361   */
362  public static final int SUCCESS_INT_VALUE = 0;
363
364
365
366  /**
367   * The result code (0) that will be used to indicate a successful operation.
368   */
369  public static final ResultCode SUCCESS =
370       new ResultCode(INFO_RC_SUCCESS.get(), SUCCESS_INT_VALUE);
371
372
373
374  /**
375   * The integer value (1) for the "OPERATIONS_ERROR" result code.
376   */
377  public static final int OPERATIONS_ERROR_INT_VALUE = 1;
378
379
380
381  /**
382   * The result code (1) that will be used to indicate that an operation was
383   * requested out of sequence.
384   */
385  public static final ResultCode OPERATIONS_ERROR =
386       new ResultCode(INFO_RC_OPERATIONS_ERROR.get(),
387                      OPERATIONS_ERROR_INT_VALUE);
388
389
390
391  /**
392   * The integer value (2) for the "PROTOCOL_ERROR" result code.
393   */
394  public static final int PROTOCOL_ERROR_INT_VALUE = 2;
395
396
397
398  /**
399   * The result code (2) that will be used to indicate that the client sent a
400   * malformed request.
401   */
402  public static final ResultCode PROTOCOL_ERROR =
403       new ResultCode(INFO_RC_PROTOCOL_ERROR.get(), PROTOCOL_ERROR_INT_VALUE);
404
405
406
407  /**
408   * The integer value (3) for the "TIME_LIMIT_EXCEEDED" result code.
409   */
410  public static final int TIME_LIMIT_EXCEEDED_INT_VALUE = 3;
411
412
413
414  /**
415   * The result code (3) that will be used to indicate that the server was
416   * unable to complete processing on the request in the allotted time limit.
417   */
418  public static final ResultCode TIME_LIMIT_EXCEEDED =
419       new ResultCode(INFO_RC_TIME_LIMIT_EXCEEDED.get(),
420                      TIME_LIMIT_EXCEEDED_INT_VALUE);
421
422
423
424  /**
425   * The integer value (4) for the "SIZE_LIMIT_EXCEEDED" result code.
426   */
427  public static final int SIZE_LIMIT_EXCEEDED_INT_VALUE = 4;
428
429
430
431  /**
432   * The result code (4) that will be used to indicate that the server found
433   * more matching entries than the configured request size limit.
434   */
435  public static final ResultCode SIZE_LIMIT_EXCEEDED =
436       new ResultCode(INFO_RC_SIZE_LIMIT_EXCEEDED.get(),
437                      SIZE_LIMIT_EXCEEDED_INT_VALUE);
438
439
440
441  /**
442   * The integer value (5) for the "COMPARE_FALSE" result code.
443   */
444  public static final int COMPARE_FALSE_INT_VALUE = 5;
445
446
447
448  /**
449   * The result code (5) that will be used if a requested compare assertion does
450   * not match the target entry.
451   */
452  public static final ResultCode COMPARE_FALSE =
453       new ResultCode(INFO_RC_COMPARE_FALSE.get(), COMPARE_FALSE_INT_VALUE);
454
455
456
457  /**
458   * The integer value (6) for the "COMPARE_TRUE" result code.
459   */
460  public static final int COMPARE_TRUE_INT_VALUE = 6;
461
462
463
464  /**
465   * The result code (6) that will be used if a requested compare assertion
466   * matched the target entry.
467   */
468  public static final ResultCode COMPARE_TRUE =
469       new ResultCode(INFO_RC_COMPARE_TRUE.get(), COMPARE_TRUE_INT_VALUE);
470
471
472
473  /**
474   * The integer value (7) for the "AUTH_METHOD_NOT_SUPPORTED" result code.
475   */
476  public static final int AUTH_METHOD_NOT_SUPPORTED_INT_VALUE = 7;
477
478
479
480  /**
481   * The result code (7) that will be used if the client requested a form of
482   * authentication that is not supported by the server.
483   */
484  public static final ResultCode AUTH_METHOD_NOT_SUPPORTED =
485       new ResultCode(INFO_RC_AUTH_METHOD_NOT_SUPPORTED.get(),
486                      AUTH_METHOD_NOT_SUPPORTED_INT_VALUE);
487
488
489
490  /**
491   * The integer value (8) for the "STRONG_AUTH_REQUIRED" result code.
492   */
493  public static final int STRONG_AUTH_REQUIRED_INT_VALUE = 8;
494
495
496
497  /**
498   * The result code (8) that will be used if the client requested an operation
499   * that requires a strong authentication mechanism.
500   */
501  public static final ResultCode STRONG_AUTH_REQUIRED =
502       new ResultCode(INFO_RC_STRONG_AUTH_REQUIRED.get(),
503                      STRONG_AUTH_REQUIRED_INT_VALUE);
504
505
506
507  /**
508   * The integer value (10) for the "REFERRAL" result code.
509   */
510  public static final int REFERRAL_INT_VALUE = 10;
511
512
513
514  /**
515   * The result code (10) that will be used if the server sends a referral to
516   * the client to refer to data in another location.
517   */
518  public static final ResultCode REFERRAL =
519       new ResultCode(INFO_RC_REFERRAL.get(), REFERRAL_INT_VALUE);
520
521
522
523  /**
524   * The integer value (11) for the "ADMIN_LIMIT_EXCEEDED" result code.
525   */
526  public static final int ADMIN_LIMIT_EXCEEDED_INT_VALUE = 11;
527
528
529
530  /**
531   * The result code (11) that will be used if a server administrative limit has
532   * been exceeded.
533   */
534  public static final ResultCode ADMIN_LIMIT_EXCEEDED =
535       new ResultCode(INFO_RC_ADMIN_LIMIT_EXCEEDED.get(),
536                      ADMIN_LIMIT_EXCEEDED_INT_VALUE);
537
538
539
540  /**
541   * The integer value (12) for the "UNAVAILABLE_CRITICAL_EXTENSION" result
542   * code.
543   */
544  public static final int UNAVAILABLE_CRITICAL_EXTENSION_INT_VALUE = 12;
545
546
547
548  /**
549   * The result code (12) that will be used if the client requests a critical
550   * control that is not supported by the server.
551   */
552  public static final ResultCode UNAVAILABLE_CRITICAL_EXTENSION =
553       new ResultCode(INFO_RC_UNAVAILABLE_CRITICAL_EXTENSION.get(),
554                      UNAVAILABLE_CRITICAL_EXTENSION_INT_VALUE);
555
556
557
558  /**
559   * The integer value (13) for the "CONFIDENTIALITY_REQUIRED" result code.
560   */
561  public static final int CONFIDENTIALITY_REQUIRED_INT_VALUE = 13;
562
563
564
565  /**
566   * The result code (13) that will be used if the server requires a secure
567   * communication mechanism for the requested operation.
568   */
569  public static final ResultCode CONFIDENTIALITY_REQUIRED =
570       new ResultCode(INFO_RC_CONFIDENTIALITY_REQUIRED.get(),
571                      CONFIDENTIALITY_REQUIRED_INT_VALUE);
572
573
574
575  /**
576   * The integer value (14) for the "SASL_BIND_IN_PROGRESS" result code.
577   */
578  public static final int SASL_BIND_IN_PROGRESS_INT_VALUE = 14;
579
580
581
582  /**
583   * The result code (14) that will be returned from the server after SASL bind
584   * stages in which more processing is required.
585   */
586  public static final ResultCode SASL_BIND_IN_PROGRESS =
587       new ResultCode(INFO_RC_SASL_BIND_IN_PROGRESS.get(),
588                      SASL_BIND_IN_PROGRESS_INT_VALUE);
589
590
591
592  /**
593   * The integer value (16) for the "NO_SUCH_ATTRIBUTE" result code.
594   */
595  public static final int NO_SUCH_ATTRIBUTE_INT_VALUE = 16;
596
597
598
599  /**
600   * The result code (16) that will be used if the client referenced an
601   * attribute that does not exist in the target entry.
602   */
603  public static final ResultCode NO_SUCH_ATTRIBUTE =
604       new ResultCode(INFO_RC_NO_SUCH_ATTRIBUTE.get(),
605                      NO_SUCH_ATTRIBUTE_INT_VALUE);
606
607
608
609  /**
610   * The integer value (17) for the "UNDEFINED_ATTRIBUTE_TYPE" result code.
611   */
612  public static final int UNDEFINED_ATTRIBUTE_TYPE_INT_VALUE = 17;
613
614
615
616  /**
617   * The result code (17) that will be used if the client referenced an
618   * attribute that is not defined in the server schema.
619   */
620  public static final ResultCode UNDEFINED_ATTRIBUTE_TYPE =
621       new ResultCode(INFO_RC_UNDEFINED_ATTRIBUTE_TYPE.get(),
622                      UNDEFINED_ATTRIBUTE_TYPE_INT_VALUE);
623
624
625
626  /**
627   * The integer value (18) for the "INAPPROPRIATE_MATCHING" result code.
628   */
629  public static final int INAPPROPRIATE_MATCHING_INT_VALUE = 18;
630
631
632
633  /**
634   * The result code (18) that will be used if the client attempted to use an
635   * attribute in a search filter in a manner not supported by the matching
636   * rules associated with that attribute.
637   */
638  public static final ResultCode INAPPROPRIATE_MATCHING =
639       new ResultCode(INFO_RC_INAPPROPRIATE_MATCHING.get(),
640                      INAPPROPRIATE_MATCHING_INT_VALUE);
641
642
643
644  /**
645   * The integer value (19) for the "CONSTRAINT_VIOLATION" result code.
646   */
647  public static final int CONSTRAINT_VIOLATION_INT_VALUE = 19;
648
649
650
651  /**
652   * The result code (19) that will be used if the requested operation would
653   * violate some constraint defined in the server.
654   */
655  public static final ResultCode CONSTRAINT_VIOLATION =
656       new ResultCode(INFO_RC_CONSTRAINT_VIOLATION.get(),
657                      CONSTRAINT_VIOLATION_INT_VALUE);
658
659
660
661  /**
662   * The integer value (20) for the "ATTRIBUTE_OR_VALUE_EXISTS" result code.
663   */
664  public static final int ATTRIBUTE_OR_VALUE_EXISTS_INT_VALUE = 20;
665
666
667
668  /**
669   * The result code (20) that will be used if the client attempts to modify an
670   * entry in a way that would create a duplicate value, or create multiple
671   * values for a single-valued attribute.
672   */
673  public static final ResultCode ATTRIBUTE_OR_VALUE_EXISTS =
674       new ResultCode(INFO_RC_ATTRIBUTE_OR_VALUE_EXISTS.get(),
675                      ATTRIBUTE_OR_VALUE_EXISTS_INT_VALUE);
676
677
678
679  /**
680   * The integer value (21) for the "INVALID_ATTRIBUTE_SYNTAX" result code.
681   */
682  public static final int INVALID_ATTRIBUTE_SYNTAX_INT_VALUE = 21;
683
684
685
686  /**
687   * The result code (21) that will be used if the client attempts to perform an
688   * operation that would create an attribute value that violates the syntax
689   * for that attribute.
690   */
691  public static final ResultCode INVALID_ATTRIBUTE_SYNTAX =
692       new ResultCode(INFO_RC_INVALID_ATTRIBUTE_SYNTAX.get(),
693                      INVALID_ATTRIBUTE_SYNTAX_INT_VALUE);
694
695
696
697  /**
698   * The integer value (32) for the "NO_SUCH_OBJECT" result code.
699   */
700  public static final int NO_SUCH_OBJECT_INT_VALUE = 32;
701
702
703
704  /**
705   * The result code (32) that will be used if the client targeted an entry that
706   * does not exist.
707   */
708  public static final ResultCode NO_SUCH_OBJECT =
709       new ResultCode(INFO_RC_NO_SUCH_OBJECT.get(), NO_SUCH_OBJECT_INT_VALUE);
710
711
712
713  /**
714   * The integer value (33) for the "ALIAS_PROBLEM" result code.
715   */
716  public static final int ALIAS_PROBLEM_INT_VALUE = 33;
717
718
719
720  /**
721   * The result code (33) that will be used if the client targeted an entry that
722   * as an alias.
723   */
724  public static final ResultCode ALIAS_PROBLEM =
725       new ResultCode(INFO_RC_ALIAS_PROBLEM.get(), ALIAS_PROBLEM_INT_VALUE);
726
727
728
729  /**
730   * The integer value (34) for the "INVALID_DN_SYNTAX" result code.
731   */
732  public static final int INVALID_DN_SYNTAX_INT_VALUE = 34;
733
734
735
736  /**
737   * The result code (34) that will be used if the client provided an invalid
738   * DN.
739   */
740  public static final ResultCode INVALID_DN_SYNTAX =
741       new ResultCode(INFO_RC_INVALID_DN_SYNTAX.get(),
742                      INVALID_DN_SYNTAX_INT_VALUE);
743
744
745
746  /**
747   * The integer value (36) for the "ALIAS_DEREFERENCING_PROBLEM" result code.
748   */
749  public static final int ALIAS_DEREFERENCING_PROBLEM_INT_VALUE = 36;
750
751
752
753  /**
754   * The result code (36) that will be used if a problem is encountered while
755   * the server is attempting to dereference an alias.
756   */
757  public static final ResultCode ALIAS_DEREFERENCING_PROBLEM =
758       new ResultCode(INFO_RC_ALIAS_DEREFERENCING_PROBLEM.get(),
759                      ALIAS_DEREFERENCING_PROBLEM_INT_VALUE);
760
761
762
763  /**
764   * The integer value (48) for the "INAPPROPRIATE_AUTHENTICATION" result code.
765   */
766  public static final int INAPPROPRIATE_AUTHENTICATION_INT_VALUE = 48;
767
768
769
770  /**
771   * The result code (48) that will be used if the client attempts to perform a
772   * type of authentication that is not supported for the target user.
773   */
774  public static final ResultCode INAPPROPRIATE_AUTHENTICATION =
775       new ResultCode(INFO_RC_INAPPROPRIATE_AUTHENTICATION.get(),
776                      INAPPROPRIATE_AUTHENTICATION_INT_VALUE);
777
778
779
780  /**
781   * The integer value (49) for the "INVALID_CREDENTIALS" result code.
782   */
783  public static final int INVALID_CREDENTIALS_INT_VALUE = 49;
784
785
786
787  /**
788   * The result code (49) that will be used if the client provided invalid
789   * credentials while trying to authenticate.
790   */
791  public static final ResultCode INVALID_CREDENTIALS =
792       new ResultCode(INFO_RC_INVALID_CREDENTIALS.get(),
793                      INVALID_CREDENTIALS_INT_VALUE);
794
795
796
797  /**
798   * The integer value (50) for the "INSUFFICIENT_ACCESS_RIGHTS" result code.
799   */
800  public static final int INSUFFICIENT_ACCESS_RIGHTS_INT_VALUE = 50;
801
802
803
804  /**
805   * The result code (50) that will be used if the client does not have
806   * permission to perform the requested operation.
807   */
808  public static final ResultCode INSUFFICIENT_ACCESS_RIGHTS =
809       new ResultCode(INFO_RC_INSUFFICIENT_ACCESS_RIGHTS.get(),
810                      INSUFFICIENT_ACCESS_RIGHTS_INT_VALUE);
811
812
813
814  /**
815   * The integer value (51) for the "BUSY" result code.
816   */
817  public static final int BUSY_INT_VALUE = 51;
818
819
820
821  /**
822   * The result code (51) that will be used if the server is too busy to process
823   * the requested operation.
824   */
825  public static final ResultCode BUSY = new ResultCode(INFO_RC_BUSY.get(),
826                                                       BUSY_INT_VALUE);
827
828
829
830  /**
831   * The integer value (52) for the "UNAVAILABLE" result code.
832   */
833  public static final int UNAVAILABLE_INT_VALUE = 52;
834
835
836
837  /**
838   * The result code (52) that will be used if the server is unavailable.
839   */
840  public static final ResultCode UNAVAILABLE =
841       new ResultCode(INFO_RC_UNAVAILABLE.get(), UNAVAILABLE_INT_VALUE);
842
843
844
845  /**
846   * The integer value (53) for the "UNWILLING_TO_PERFORM" result code.
847   */
848  public static final int UNWILLING_TO_PERFORM_INT_VALUE = 53;
849
850
851
852  /**
853   * The result code (53) that will be used if the server is not willing to
854   * perform the requested operation.
855   */
856  public static final ResultCode UNWILLING_TO_PERFORM =
857       new ResultCode(INFO_RC_UNWILLING_TO_PERFORM.get(),
858                      UNWILLING_TO_PERFORM_INT_VALUE);
859
860
861
862  /**
863   * The integer value (54) for the "LOOP_DETECT" result code.
864   */
865  public static final int LOOP_DETECT_INT_VALUE = 54;
866
867
868
869  /**
870   * The result code (54) that will be used if the server detects a chaining or
871   * alias loop.
872   */
873  public static final ResultCode LOOP_DETECT =
874       new ResultCode(INFO_RC_LOOP_DETECT.get(), LOOP_DETECT_INT_VALUE);
875
876
877
878  /**
879   * The integer value (60) for the "SORT_CONTROL_MISSING" result code.
880   */
881  public static final int SORT_CONTROL_MISSING_INT_VALUE = 60;
882
883
884
885  /**
886   * The result code (60) that will be used if the client sends a virtual list
887   * view control without a server-side sort control.
888   */
889  public static final ResultCode SORT_CONTROL_MISSING =
890       new ResultCode(INFO_RC_SORT_CONTROL_MISSING.get(),
891                      SORT_CONTROL_MISSING_INT_VALUE);
892
893
894
895  /**
896   * The integer value (61) for the "OFFSET_RANGE_ERROR" result code.
897   */
898  public static final int OFFSET_RANGE_ERROR_INT_VALUE = 61;
899
900
901
902  /**
903   * The result code (61) that will be used if the client provides a virtual
904   * list view control with a target offset that is out of range for the
905   * available data set.
906   */
907  public static final ResultCode OFFSET_RANGE_ERROR =
908       new ResultCode(INFO_RC_OFFSET_RANGE_ERROR.get(),
909                      OFFSET_RANGE_ERROR_INT_VALUE);
910
911
912
913  /**
914   * The integer value (64) for the "NAMING_VIOLATION" result code.
915   */
916  public static final int NAMING_VIOLATION_INT_VALUE = 64;
917
918
919
920  /**
921   * The result code (64) that will be used if the client request violates a
922   * naming constraint (e.g., a name form or DIT structure rule) defined in the
923   * server.
924   */
925  public static final ResultCode NAMING_VIOLATION =
926       new ResultCode(INFO_RC_NAMING_VIOLATION.get(),
927                      NAMING_VIOLATION_INT_VALUE);
928
929
930
931  /**
932   * The integer value (65) for the "OBJECT_CLASS_VIOLATION" result code.
933   */
934  public static final int OBJECT_CLASS_VIOLATION_INT_VALUE = 65;
935
936
937
938  /**
939   * The result code (65) that will be used if the client request violates an
940   * object class constraint (e.g., an undefined object class, a
941   * disallowed attribute, or a missing required attribute) defined in the
942   * server.
943   */
944  public static final ResultCode OBJECT_CLASS_VIOLATION =
945       new ResultCode(INFO_RC_OBJECT_CLASS_VIOLATION.get(),
946                      OBJECT_CLASS_VIOLATION_INT_VALUE);
947
948
949
950  /**
951   * The integer value (66) for the "NOT_ALLOWED_ON_NONLEAF" result code.
952   */
953  public static final int NOT_ALLOWED_ON_NONLEAF_INT_VALUE = 66;
954
955
956
957  /**
958   * The result code (66) that will be used if the requested operation is not
959   * allowed to be performed on non-leaf entries.
960   */
961  public static final ResultCode NOT_ALLOWED_ON_NONLEAF =
962       new ResultCode(INFO_RC_NOT_ALLOWED_ON_NONLEAF.get(),
963                      NOT_ALLOWED_ON_NONLEAF_INT_VALUE);
964
965
966
967  /**
968   * The integer value (67) for the "NOT_ALLOWED_ON_RDN" result code.
969   */
970  public static final int NOT_ALLOWED_ON_RDN_INT_VALUE = 67;
971
972
973
974  /**
975   * The result code (67) that will be used if the requested operation would
976   * alter the RDN of the entry but the operation was not a modify DN request.
977   */
978  public static final ResultCode NOT_ALLOWED_ON_RDN =
979       new ResultCode(INFO_RC_NOT_ALLOWED_ON_RDN.get(),
980                      NOT_ALLOWED_ON_RDN_INT_VALUE);
981
982
983
984  /**
985   * The integer value (68) for the "ENTRY_ALREADY_EXISTS" result code.
986   */
987  public static final int ENTRY_ALREADY_EXISTS_INT_VALUE = 68;
988
989
990
991  /**
992   * The result code (68) that will be used if the requested operation would
993   * create a conflict with an entry that already exists in the server.
994   */
995  public static final ResultCode ENTRY_ALREADY_EXISTS =
996       new ResultCode(INFO_RC_ENTRY_ALREADY_EXISTS.get(),
997                      ENTRY_ALREADY_EXISTS_INT_VALUE);
998
999
1000
1001  /**
1002   * The integer value (69) for the "OBJECT_CLASS_MODS_PROHIBITED" result code.
1003   */
1004  public static final int OBJECT_CLASS_MODS_PROHIBITED_INT_VALUE = 69;
1005
1006
1007
1008  /**
1009   * The result code (69) that will be used if the requested operation would
1010   * alter the set of object classes defined in the entry in a disallowed
1011   * manner.
1012   */
1013  public static final ResultCode OBJECT_CLASS_MODS_PROHIBITED =
1014       new ResultCode(INFO_RC_OBJECT_CLASS_MODS_PROHIBITED.get(),
1015                      OBJECT_CLASS_MODS_PROHIBITED_INT_VALUE);
1016
1017
1018
1019  /**
1020   * The integer value (71) for the "AFFECTS_MULTIPLE_DSAS" result code.
1021   */
1022  public static final int AFFECTS_MULTIPLE_DSAS_INT_VALUE = 71;
1023
1024
1025
1026  /**
1027   * The result code (71) that will be used if the requested operation would
1028   * impact entries in multiple data sources.
1029   */
1030  public static final ResultCode AFFECTS_MULTIPLE_DSAS =
1031       new ResultCode(INFO_RC_AFFECTS_MULTIPLE_DSAS.get(),
1032                      AFFECTS_MULTIPLE_DSAS_INT_VALUE);
1033
1034
1035
1036  /**
1037   * The integer value (76) for the "VIRTUAL_LIST_VIEW_ERROR" result code.
1038   */
1039  public static final int VIRTUAL_LIST_VIEW_ERROR_INT_VALUE = 76;
1040
1041
1042
1043  /**
1044   * The result code (76) that will be used if an error occurred while
1045   * performing processing associated with the virtual list view control.
1046   */
1047  public static final ResultCode VIRTUAL_LIST_VIEW_ERROR =
1048       new ResultCode(INFO_RC_VIRTUAL_LIST_VIEW_ERROR.get(),
1049                      VIRTUAL_LIST_VIEW_ERROR_INT_VALUE);
1050
1051
1052
1053  /**
1054   * The integer value (80) for the "OTHER" result code.
1055   */
1056  public static final int OTHER_INT_VALUE = 80;
1057
1058
1059
1060  /**
1061   * The result code (80) that will be used if none of the other result codes
1062   * are appropriate.
1063   */
1064  public static final ResultCode OTHER =
1065       new ResultCode(INFO_RC_OTHER.get(), OTHER_INT_VALUE);
1066
1067
1068
1069  /**
1070   * The integer value (81) for the "SERVER_DOWN" result code.
1071   */
1072  public static final int SERVER_DOWN_INT_VALUE = 81;
1073
1074
1075
1076  /**
1077   * The client-side result code (81) that will be used if an established
1078   * connection to the server is lost.
1079   */
1080  public static final ResultCode SERVER_DOWN =
1081       new ResultCode(INFO_RC_SERVER_DOWN.get(), SERVER_DOWN_INT_VALUE);
1082
1083
1084
1085  /**
1086   * The integer value (82) for the "LOCAL_ERROR" result code.
1087   */
1088  public static final int LOCAL_ERROR_INT_VALUE = 82;
1089
1090
1091
1092  /**
1093   * The client-side result code (82) that will be used if a generic client-side
1094   * error occurs during processing.
1095   */
1096  public static final ResultCode LOCAL_ERROR =
1097       new ResultCode(INFO_RC_LOCAL_ERROR.get(), LOCAL_ERROR_INT_VALUE);
1098
1099
1100
1101  /**
1102   * The integer value (83) for the "ENCODING_ERROR" result code.
1103   */
1104  public static final int ENCODING_ERROR_INT_VALUE = 83;
1105
1106
1107
1108  /**
1109   * The client-side result code (83) that will be used if an error occurs while
1110   * encoding a request.
1111   */
1112  public static final ResultCode ENCODING_ERROR =
1113       new ResultCode(INFO_RC_ENCODING_ERROR.get(), ENCODING_ERROR_INT_VALUE);
1114
1115
1116
1117  /**
1118   * The integer value (84) for the "DECODING_ERROR" result code.
1119   */
1120  public static final int DECODING_ERROR_INT_VALUE = 84;
1121
1122
1123
1124  /**
1125   * The client-side result code (84) that will be used if an error occurs while
1126   * decoding a response.
1127   */
1128  public static final ResultCode DECODING_ERROR =
1129       new ResultCode(INFO_RC_DECODING_ERROR.get(), DECODING_ERROR_INT_VALUE);
1130
1131
1132
1133  /**
1134   * The integer value (85) for the "TIMEOUT" result code.
1135   */
1136  public static final int TIMEOUT_INT_VALUE = 85;
1137
1138
1139
1140  /**
1141   * The client-side result code (85) that will be used if a client timeout
1142   * occurs while waiting for a response from the server.
1143   */
1144  public static final ResultCode TIMEOUT =
1145       new ResultCode(INFO_RC_TIMEOUT.get(), TIMEOUT_INT_VALUE);
1146
1147
1148
1149  /**
1150   * The integer value (86) for the "AUTH_UNKNOWN" result code.
1151   */
1152  public static final int AUTH_UNKNOWN_INT_VALUE = 86;
1153
1154
1155
1156  /**
1157   * The client-side result code (86) that will be used if the client attempts
1158   * to use an unknown authentication type.
1159   */
1160  public static final ResultCode AUTH_UNKNOWN =
1161       new ResultCode(INFO_RC_AUTH_UNKNOWN.get(), AUTH_UNKNOWN_INT_VALUE);
1162
1163
1164
1165  /**
1166   * The integer value (87) for the "FILTER_ERROR" result code.
1167   */
1168  public static final int FILTER_ERROR_INT_VALUE = 87;
1169
1170
1171
1172  /**
1173   * The client-side result code (87) that will be used if an error occurs while
1174   * attempting to encode a search filter.
1175   */
1176  public static final ResultCode FILTER_ERROR =
1177       new ResultCode(INFO_RC_FILTER_ERROR.get(), FILTER_ERROR_INT_VALUE);
1178
1179
1180
1181  /**
1182   * The integer value (88) for the "USER_CANCELED" result code.
1183   */
1184  public static final int USER_CANCELED_INT_VALUE = 88;
1185
1186
1187
1188  /**
1189   * The client-side result code (88) that will be used if the end user canceled
1190   * the operation in progress.
1191   */
1192  public static final ResultCode USER_CANCELED =
1193       new ResultCode(INFO_RC_USER_CANCELED.get(), USER_CANCELED_INT_VALUE);
1194
1195
1196
1197  /**
1198   * The integer value (89) for the "PARAM_ERROR" result code.
1199   */
1200  public static final int PARAM_ERROR_INT_VALUE = 89;
1201
1202
1203
1204  /**
1205   * The client-side result code (89) that will be used if there is a problem
1206   * with the parameters provided for a request.
1207   */
1208  public static final ResultCode PARAM_ERROR =
1209       new ResultCode(INFO_RC_PARAM_ERROR.get(), PARAM_ERROR_INT_VALUE);
1210
1211
1212
1213  /**
1214   * The integer value (90) for the "NO_MEMORY" result code.
1215   */
1216  public static final int NO_MEMORY_INT_VALUE = 90;
1217
1218
1219
1220  /**
1221   * The client-side result code (90) that will be used if the client does not
1222   * have sufficient memory to perform the requested operation.
1223   */
1224  public static final ResultCode NO_MEMORY =
1225       new ResultCode(INFO_RC_NO_MEMORY.get(), NO_MEMORY_INT_VALUE);
1226
1227
1228
1229  /**
1230   * The integer value (91) for the "CONNECT_ERROR" result code.
1231   */
1232  public static final int CONNECT_ERROR_INT_VALUE = 91;
1233
1234
1235
1236  /**
1237   * The client-side result code (91) that will be used if an error occurs while
1238   * attempting to connect to a target server.
1239   */
1240  public static final ResultCode CONNECT_ERROR =
1241       new ResultCode(INFO_RC_CONNECT_ERROR.get(), CONNECT_ERROR_INT_VALUE);
1242
1243
1244
1245  /**
1246   * The integer value (92) for the "NOT_SUPPORTED" result code.
1247   */
1248  public static final int NOT_SUPPORTED_INT_VALUE = 92;
1249
1250
1251
1252  /**
1253   * The client-side result code (92) that will be used if the requested
1254   * operation is not supported.
1255   */
1256  public static final ResultCode NOT_SUPPORTED =
1257       new ResultCode(INFO_RC_NOT_SUPPORTED.get(), NOT_SUPPORTED_INT_VALUE);
1258
1259
1260
1261  /**
1262   * The integer value (93) for the "CONTROL_NOT_FOUND" result code.
1263   */
1264  public static final int CONTROL_NOT_FOUND_INT_VALUE = 93;
1265
1266
1267
1268  /**
1269   * The client-side result code (93) that will be used if the response from the
1270   * server did not include an expected control.
1271   */
1272  public static final ResultCode CONTROL_NOT_FOUND =
1273       new ResultCode(INFO_RC_CONTROL_NOT_FOUND.get(),
1274                      CONTROL_NOT_FOUND_INT_VALUE);
1275
1276
1277
1278  /**
1279   * The integer value (94) for the "NO_RESULTS_RETURNED" result code.
1280   */
1281  public static final int NO_RESULTS_RETURNED_INT_VALUE = 94;
1282
1283
1284
1285  /**
1286   * The client-side result code (94) that will be used if the server did not
1287   * send any results.
1288   */
1289  public static final ResultCode NO_RESULTS_RETURNED =
1290       new ResultCode(INFO_RC_NO_RESULTS_RETURNED.get(),
1291                      NO_RESULTS_RETURNED_INT_VALUE);
1292
1293
1294
1295  /**
1296   * The integer value (95) for the "MORE_RESULTS_TO_RETURN" result code.
1297   */
1298  public static final int MORE_RESULTS_TO_RETURN_INT_VALUE = 95;
1299
1300
1301
1302  /**
1303   * The client-side result code (95) that will be used if there are still more
1304   * results to return.
1305   */
1306  public static final ResultCode MORE_RESULTS_TO_RETURN =
1307       new ResultCode(INFO_RC_MORE_RESULTS_TO_RETURN.get(),
1308                      MORE_RESULTS_TO_RETURN_INT_VALUE);
1309
1310
1311
1312  /**
1313   * The integer value (96) for the "CLIENT_LOOP" result code.
1314   */
1315  public static final int CLIENT_LOOP_INT_VALUE = 96;
1316
1317
1318
1319  /**
1320   * The client-side result code (96) that will be used if the client detects a
1321   * loop while attempting to follow referrals.
1322   */
1323  public static final ResultCode CLIENT_LOOP =
1324       new ResultCode(INFO_RC_CLIENT_LOOP.get(), CLIENT_LOOP_INT_VALUE);
1325
1326
1327
1328  /**
1329   * The integer value (97) for the "REFERRAL_LIMIT_EXCEEDED" result code.
1330   */
1331  public static final int REFERRAL_LIMIT_EXCEEDED_INT_VALUE = 97;
1332
1333
1334
1335  /**
1336   * The client-side result code (97) that will be used if the client
1337   * encountered too many referrals in the course of processing an operation.
1338   */
1339  public static final ResultCode REFERRAL_LIMIT_EXCEEDED =
1340       new ResultCode(INFO_RC_REFERRAL_LIMIT_EXCEEDED.get(),
1341                      REFERRAL_LIMIT_EXCEEDED_INT_VALUE);
1342
1343
1344
1345  /**
1346   * The integer value (118) for the "CANCELED" result code.
1347   */
1348  public static final int CANCELED_INT_VALUE = 118;
1349
1350
1351
1352  /**
1353   * The result code (118) that will be used if the operation was canceled.
1354   */
1355  public static final ResultCode CANCELED =
1356       new ResultCode(INFO_RC_CANCELED.get(), CANCELED_INT_VALUE);
1357
1358
1359
1360  /**
1361   * The integer value (119) for the "NO_SUCH_OPERATION" result code.
1362   */
1363  public static final int NO_SUCH_OPERATION_INT_VALUE = 119;
1364
1365
1366
1367  /**
1368   * The result code (119) that will be used if the client attempts to cancel an
1369   * operation that the client doesn't exist in the server.
1370   */
1371  public static final ResultCode NO_SUCH_OPERATION =
1372       new ResultCode(INFO_RC_NO_SUCH_OPERATION.get(),
1373                      NO_SUCH_OPERATION_INT_VALUE);
1374
1375
1376
1377  /**
1378   * The integer value (120) for the "TOO_LATE" result code.
1379   */
1380  public static final int TOO_LATE_INT_VALUE = 120;
1381
1382
1383
1384  /**
1385   * The result code (120) that will be used if the client attempts to cancel an
1386   * operation too late in the processing for that operation.
1387   */
1388  public static final ResultCode TOO_LATE =
1389       new ResultCode(INFO_RC_TOO_LATE.get(), TOO_LATE_INT_VALUE);
1390
1391
1392
1393  /**
1394   * The integer value (121) for the "CANNOT_CANCEL" result code.
1395   */
1396  public static final int CANNOT_CANCEL_INT_VALUE = 121;
1397
1398
1399
1400  /**
1401   * The result code (121) that will be used if the client attempts to cancel an
1402   * operation that cannot be canceled.
1403   */
1404  public static final ResultCode CANNOT_CANCEL =
1405       new ResultCode(INFO_RC_CANNOT_CANCEL.get(), CANNOT_CANCEL_INT_VALUE);
1406
1407
1408
1409  /**
1410   * The integer value (122) for the "ASSERTION_FAILED" result code.
1411   */
1412  public static final int ASSERTION_FAILED_INT_VALUE = 122;
1413
1414
1415
1416  /**
1417   * The result code (122) that will be used if the requested operation included
1418   * the LDAP assertion control but the assertion did not match the target
1419   * entry.
1420   */
1421  public static final ResultCode ASSERTION_FAILED =
1422       new ResultCode(INFO_RC_ASSERTION_FAILED.get(),
1423                      ASSERTION_FAILED_INT_VALUE);
1424
1425
1426
1427  /**
1428   * The integer value (123) for the "AUTHORIZATION_DENIED" result code.
1429   */
1430  public static final int AUTHORIZATION_DENIED_INT_VALUE = 123;
1431
1432
1433
1434  /**
1435   * The result code (123) that will be used if the client is denied the ability
1436   * to use the proxied authorization control.
1437   */
1438  public static final ResultCode AUTHORIZATION_DENIED =
1439       new ResultCode(INFO_RC_AUTHORIZATION_DENIED.get(),
1440                      AUTHORIZATION_DENIED_INT_VALUE);
1441
1442
1443
1444  /**
1445   * The integer value (4096) for the "E_SYNC_REFRESH_REQUIRED" result code.
1446   */
1447  public static final int E_SYNC_REFRESH_REQUIRED_INT_VALUE = 4096;
1448
1449
1450
1451  /**
1452   * The result code (4096) that will be used if a client using the content
1453   * synchronization request control requests an incremental update but the
1454   * server is unable to honor that request and requires the client to request
1455   * an initial content.
1456   */
1457  public static final ResultCode E_SYNC_REFRESH_REQUIRED =
1458       new ResultCode(INFO_RC_E_SYNC_REFRESH_REQUIRED.get(),
1459                      E_SYNC_REFRESH_REQUIRED_INT_VALUE);
1460
1461
1462
1463  /**
1464   * The integer value (16654) for the "NO_OPERATION" result code.
1465   */
1466  public static final int NO_OPERATION_INT_VALUE = 16_654;
1467
1468
1469
1470  /**
1471   * The result code (16654) for operations that completed successfully but no
1472   * changes were made to the server because the LDAP no-op control was included
1473   * in the request.
1474   */
1475  public static final ResultCode NO_OPERATION =
1476       new ResultCode(INFO_RC_NO_OPERATION.get(), NO_OPERATION_INT_VALUE);
1477
1478
1479
1480  /**
1481   * The integer value (30221001) for the "INTERACTIVE_TRANSACTION_ABORTED"
1482   * result code.
1483   */
1484  public static final int INTERACTIVE_TRANSACTION_ABORTED_INT_VALUE =
1485       30_221_001;
1486
1487
1488
1489  /**
1490   * The result code (30221001) for use if an interactive transaction has been
1491   * aborted, either due to an explicit request from a client or by the server
1492   * without a client request.
1493   */
1494  public static final ResultCode INTERACTIVE_TRANSACTION_ABORTED =
1495       new ResultCode(INFO_RC_INTERACTIVE_TRANSACTION_ABORTED.get(),
1496                      INTERACTIVE_TRANSACTION_ABORTED_INT_VALUE);
1497
1498
1499
1500  /**
1501   * The integer value (30221002) for the "DATABASE_LOCK_CONFLICT" result code.
1502   */
1503  public static final int DATABASE_LOCK_CONFLICT_INT_VALUE = 30_221_002;
1504
1505
1506
1507  /**
1508   * The result code (30221002) for use if an operation fails because of a
1509   * database lock conflict (e.g., a deadlock or lock timeout).
1510   */
1511  public static final ResultCode DATABASE_LOCK_CONFLICT =
1512       new ResultCode(INFO_RC_DATABASE_LOCK_CONFLICT.get(),
1513                      DATABASE_LOCK_CONFLICT_INT_VALUE);
1514
1515
1516
1517  /**
1518   * The integer value (30221003) for the "MIRRORED_SUBTREE_DIGEST_MISMATCH"
1519   * result code.
1520   */
1521  public static final int MIRRORED_SUBTREE_DIGEST_MISMATCH_INT_VALUE =
1522       30_221_003;
1523
1524
1525
1526  /**
1527   * The result code (30221003) that should be used by a node in a topology of
1528   * servers to indicate that its subtree digest does not match that of its
1529   * master's.
1530   */
1531  public static final ResultCode MIRRORED_SUBTREE_DIGEST_MISMATCH =
1532      new ResultCode(INFO_RC_MIRRORED_SUBTREE_DIGEST_MISMATCH.get(),
1533          MIRRORED_SUBTREE_DIGEST_MISMATCH_INT_VALUE);
1534
1535
1536
1537  /**
1538   * The integer value (30221004) for the "TOKEN_DELIVERY_MECHANISM_UNAVAILABLE"
1539   * result code.
1540   */
1541  public static final int TOKEN_DELIVERY_MECHANISM_UNAVAILABLE_INT_VALUE =
1542       30_221_004;
1543
1544
1545
1546  /**
1547   * The result code (30221004) that should be used to indicate that the server
1548   * could not deliver a one-time password, password reset token, or single-use
1549   * token because none of the attempted delivery mechanisms were supported for
1550   * the target user.
1551   */
1552  public static final ResultCode TOKEN_DELIVERY_MECHANISM_UNAVAILABLE =
1553      new ResultCode(INFO_RC_TOKEN_DELIVERY_MECHANISM_UNAVAILABLE.get(),
1554          TOKEN_DELIVERY_MECHANISM_UNAVAILABLE_INT_VALUE);
1555
1556
1557
1558  /**
1559   * The integer value (30221005) for the "TOKEN_DELIVERY_ATTEMPT_FAILED"
1560   * result code.
1561   */
1562  public static final int TOKEN_DELIVERY_ATTEMPT_FAILED_INT_VALUE = 30_221_005;
1563
1564
1565
1566  /**
1567   * The result code (30221005) that should be used to indicate that the server
1568   * could not deliver a one-time password, password reset token, or single-use
1569   * token because a failure was encountered while attempting to deliver the
1570   * token through all of the supported mechanisms.
1571   */
1572  public static final ResultCode TOKEN_DELIVERY_ATTEMPT_FAILED =
1573      new ResultCode(INFO_RC_TOKEN_DELIVERY_ATTEMPT_FAILED.get(),
1574          TOKEN_DELIVERY_ATTEMPT_FAILED_INT_VALUE);
1575
1576
1577
1578  /**
1579   * The integer value (30221006) for the "TOKEN_DELIVERY_INVALID_RECIPIENT_ID"
1580   * result code.
1581   */
1582  public static final int TOKEN_DELIVERY_INVALID_RECIPIENT_ID_INT_VALUE =
1583       30_221_006;
1584
1585
1586
1587  /**
1588   * The result code (30221006) that should be used to indicate that the server
1589   * could not deliver a one-time password, password reset token, or single-use
1590   * token because the client specified a recipient ID that was not appropriate
1591   * for the target user.
1592   */
1593  public static final ResultCode TOKEN_DELIVERY_INVALID_RECIPIENT_ID =
1594      new ResultCode(INFO_RC_TOKEN_DELIVERY_INVALID_RECIPIENT_ID.get(),
1595          TOKEN_DELIVERY_INVALID_RECIPIENT_ID_INT_VALUE);
1596
1597
1598
1599  /**
1600   * The integer value (30221007) for the "TOKEN_DELIVERY_INVALID_ACCOUNT_STATE"
1601   * result code.
1602   */
1603  public static final int TOKEN_DELIVERY_INVALID_ACCOUNT_STATE_INT_VALUE =
1604       30_221_007;
1605
1606
1607
1608  /**
1609   * The result code (30221007) that should be used to indicate that the server
1610   * could not deliver a one-time password, password reset token, or single-use
1611   * token because the target user account was in an invalid state for receiving
1612   * such tokens (e.g., the account is disabled or locked, the password is
1613   * expired, etc.).
1614   */
1615  public static final ResultCode TOKEN_DELIVERY_INVALID_ACCOUNT_STATE =
1616      new ResultCode(INFO_RC_TOKEN_DELIVERY_INVALID_ACCOUNT_STATE.get(),
1617          TOKEN_DELIVERY_INVALID_ACCOUNT_STATE_INT_VALUE);
1618
1619
1620
1621  /**
1622   * The set of result code objects created with undefined int result code
1623   * values.
1624   */
1625  private static final ConcurrentHashMap<Integer,ResultCode>
1626       UNDEFINED_RESULT_CODES =
1627            new ConcurrentHashMap<>(StaticUtils.computeMapCapacity(10));
1628
1629
1630
1631  /**
1632   * The serial version UID for this serializable class.
1633   */
1634  private static final long serialVersionUID = 7609311304252378100L;
1635
1636
1637
1638  // The integer value for this result code.
1639  private final int intValue;
1640
1641  // The name for this result code.
1642  private final String name;
1643
1644  // The string representation for this result code.
1645  private final String stringRepresentation;
1646
1647
1648
1649  /**
1650   * Creates a new result code with the specified integer value.
1651   *
1652   * @param  intValue  The integer value for this result code.
1653   */
1654  private ResultCode(final int intValue)
1655  {
1656    this.intValue = intValue;
1657
1658    name                 = String.valueOf(intValue);
1659    stringRepresentation = name;
1660  }
1661
1662
1663
1664  /**
1665   * Creates a new result code with the specified name and integer value.
1666   *
1667   * @param  name      The name for this result code.
1668   * @param  intValue  The integer value for this result code.
1669   */
1670  private ResultCode(final String name, final int intValue)
1671  {
1672    this.name     = name;
1673    this.intValue = intValue;
1674
1675    stringRepresentation = intValue + " (" + name + ')';
1676  }
1677
1678
1679
1680  /**
1681   * Retrieves the name for this result code.
1682   *
1683   * @return  The name for this result code.
1684   */
1685  public String getName()
1686  {
1687    return name;
1688  }
1689
1690
1691
1692  /**
1693   * Retrieves the integer value for this result code.
1694   *
1695   * @return  The integer value for this result code.
1696   */
1697  public int intValue()
1698  {
1699    return intValue;
1700  }
1701
1702
1703
1704  /**
1705   * Retrieves the result code with the specified integer value.  If the
1706   * provided integer value does not correspond to a predefined
1707   * {@code ResultCode} object, then a new {@code ResultCode} object will be
1708   * created and returned.  Any new result codes created will also be cached
1709   * and returned for any subsequent requests with that integer value so the
1710   * same object will always be returned for a given integer value.
1711   *
1712   * @param  intValue  The integer value for which to retrieve the corresponding
1713   *                   result code.
1714   *
1715   * @return  The result code with the specified integer value, or a new result
1716   *          code
1717   */
1718  public static ResultCode valueOf(final int intValue)
1719  {
1720    return valueOf(intValue, null);
1721  }
1722
1723
1724
1725  /**
1726   * Retrieves the result code with the specified integer value.  If the
1727   * provided integer value does not correspond to a predefined
1728   * {@code ResultCode} object, then a new {@code ResultCode} object will be
1729   * created and returned.  Any new result codes created will also be cached
1730   * and returned for any subsequent requests with that integer value so the
1731   * same object will always be returned for a given integer value.
1732   *
1733   * @param  intValue  The integer value for which to retrieve the corresponding
1734   *                   result code.
1735   * @param  name      The user-friendly name to use for the result code if no
1736   *                   result code has been previously accessed with the same
1737   *                   integer value.  It may be {@code null} if this is not
1738   *                   known or a string representation of the integer value
1739   *                   should be used.
1740   *
1741   * @return  The result code with the specified integer value, or a new result
1742   *          code
1743   */
1744  public static ResultCode valueOf(final int intValue, final String name)
1745  {
1746    return valueOf(intValue, name, true);
1747  }
1748
1749
1750
1751  /**
1752   * Retrieves the result code with the specified integer value.  If the
1753   * provided integer value does not correspond to an already-defined
1754   * {@code ResultCode} object, then this method may optionally create and
1755   * return a new {@code ResultCode}.  Any new result codes created will also be
1756   * cached and returned for any subsequent requests with that integer value so
1757   * the same object will always be returned for a given integer value.
1758   *
1759   * @param  intValue             The integer value for which to retrieve the
1760   *                              corresponding result code.
1761   * @param  name                 The user-friendly name to use for the result
1762   *                              code if no result code has been previously
1763   *                              accessed with the same integer value.  It may
1764   *                              be {@code null} if this is not known or a
1765   *                              string representation of the integer value
1766   *                              should be used.
1767   * @param  createNewResultCode  Indicates whether to create a new result code
1768   *                              object with the specified integer value and
1769   *                              name if that value does not correspond to
1770   *                              any already-defined result code.
1771   *
1772   * @return  The existing result code with the specified integer value if one
1773   *          already existed, a newly-created result code with the specified
1774   *          name and integer value if none already existed but
1775   *          {@code createNewResultCode} is {@code true}, or {@code null} if no
1776   *          result code already existed with the specified integer value and
1777   *          {@code createNewResultCode} is {@code false}.
1778   */
1779  public static ResultCode valueOf(final int intValue, final String name,
1780                                   final boolean createNewResultCode)
1781  {
1782    switch (intValue)
1783    {
1784      case SUCCESS_INT_VALUE:
1785        return SUCCESS;
1786      case OPERATIONS_ERROR_INT_VALUE:
1787        return OPERATIONS_ERROR;
1788      case PROTOCOL_ERROR_INT_VALUE:
1789        return PROTOCOL_ERROR;
1790      case TIME_LIMIT_EXCEEDED_INT_VALUE:
1791        return TIME_LIMIT_EXCEEDED;
1792      case SIZE_LIMIT_EXCEEDED_INT_VALUE:
1793        return SIZE_LIMIT_EXCEEDED;
1794      case COMPARE_FALSE_INT_VALUE:
1795        return COMPARE_FALSE;
1796      case COMPARE_TRUE_INT_VALUE:
1797        return COMPARE_TRUE;
1798      case AUTH_METHOD_NOT_SUPPORTED_INT_VALUE:
1799        return AUTH_METHOD_NOT_SUPPORTED;
1800      case STRONG_AUTH_REQUIRED_INT_VALUE:
1801        return STRONG_AUTH_REQUIRED;
1802      case REFERRAL_INT_VALUE:
1803        return REFERRAL;
1804      case ADMIN_LIMIT_EXCEEDED_INT_VALUE:
1805        return ADMIN_LIMIT_EXCEEDED;
1806      case UNAVAILABLE_CRITICAL_EXTENSION_INT_VALUE:
1807        return UNAVAILABLE_CRITICAL_EXTENSION;
1808      case CONFIDENTIALITY_REQUIRED_INT_VALUE:
1809        return CONFIDENTIALITY_REQUIRED;
1810      case SASL_BIND_IN_PROGRESS_INT_VALUE:
1811        return SASL_BIND_IN_PROGRESS;
1812      case NO_SUCH_ATTRIBUTE_INT_VALUE:
1813        return NO_SUCH_ATTRIBUTE;
1814      case UNDEFINED_ATTRIBUTE_TYPE_INT_VALUE:
1815        return UNDEFINED_ATTRIBUTE_TYPE;
1816      case INAPPROPRIATE_MATCHING_INT_VALUE:
1817        return INAPPROPRIATE_MATCHING;
1818      case CONSTRAINT_VIOLATION_INT_VALUE:
1819        return CONSTRAINT_VIOLATION;
1820      case ATTRIBUTE_OR_VALUE_EXISTS_INT_VALUE:
1821        return ATTRIBUTE_OR_VALUE_EXISTS;
1822      case INVALID_ATTRIBUTE_SYNTAX_INT_VALUE:
1823        return INVALID_ATTRIBUTE_SYNTAX;
1824      case NO_SUCH_OBJECT_INT_VALUE:
1825        return NO_SUCH_OBJECT;
1826      case ALIAS_PROBLEM_INT_VALUE:
1827        return ALIAS_PROBLEM;
1828      case INVALID_DN_SYNTAX_INT_VALUE:
1829        return INVALID_DN_SYNTAX;
1830      case ALIAS_DEREFERENCING_PROBLEM_INT_VALUE:
1831        return ALIAS_DEREFERENCING_PROBLEM;
1832      case INAPPROPRIATE_AUTHENTICATION_INT_VALUE:
1833        return INAPPROPRIATE_AUTHENTICATION;
1834      case INVALID_CREDENTIALS_INT_VALUE:
1835        return INVALID_CREDENTIALS;
1836      case INSUFFICIENT_ACCESS_RIGHTS_INT_VALUE:
1837        return INSUFFICIENT_ACCESS_RIGHTS;
1838      case BUSY_INT_VALUE:
1839        return BUSY;
1840      case UNAVAILABLE_INT_VALUE:
1841        return UNAVAILABLE;
1842      case UNWILLING_TO_PERFORM_INT_VALUE:
1843        return UNWILLING_TO_PERFORM;
1844      case LOOP_DETECT_INT_VALUE:
1845        return LOOP_DETECT;
1846      case SORT_CONTROL_MISSING_INT_VALUE:
1847        return SORT_CONTROL_MISSING;
1848      case OFFSET_RANGE_ERROR_INT_VALUE:
1849        return OFFSET_RANGE_ERROR;
1850      case NAMING_VIOLATION_INT_VALUE:
1851        return NAMING_VIOLATION;
1852      case OBJECT_CLASS_VIOLATION_INT_VALUE:
1853        return OBJECT_CLASS_VIOLATION;
1854      case NOT_ALLOWED_ON_NONLEAF_INT_VALUE:
1855        return NOT_ALLOWED_ON_NONLEAF;
1856      case NOT_ALLOWED_ON_RDN_INT_VALUE:
1857        return NOT_ALLOWED_ON_RDN;
1858      case ENTRY_ALREADY_EXISTS_INT_VALUE:
1859        return ENTRY_ALREADY_EXISTS;
1860      case OBJECT_CLASS_MODS_PROHIBITED_INT_VALUE:
1861        return OBJECT_CLASS_MODS_PROHIBITED;
1862      case AFFECTS_MULTIPLE_DSAS_INT_VALUE:
1863        return AFFECTS_MULTIPLE_DSAS;
1864      case VIRTUAL_LIST_VIEW_ERROR_INT_VALUE:
1865        return VIRTUAL_LIST_VIEW_ERROR;
1866      case OTHER_INT_VALUE:
1867        return OTHER;
1868      case SERVER_DOWN_INT_VALUE:
1869        return SERVER_DOWN;
1870      case LOCAL_ERROR_INT_VALUE:
1871        return LOCAL_ERROR;
1872      case ENCODING_ERROR_INT_VALUE:
1873        return ENCODING_ERROR;
1874      case DECODING_ERROR_INT_VALUE:
1875        return DECODING_ERROR;
1876      case TIMEOUT_INT_VALUE:
1877        return TIMEOUT;
1878      case AUTH_UNKNOWN_INT_VALUE:
1879        return AUTH_UNKNOWN;
1880      case FILTER_ERROR_INT_VALUE:
1881        return FILTER_ERROR;
1882      case USER_CANCELED_INT_VALUE:
1883        return USER_CANCELED;
1884      case PARAM_ERROR_INT_VALUE:
1885        return PARAM_ERROR;
1886      case NO_MEMORY_INT_VALUE:
1887        return NO_MEMORY;
1888      case CONNECT_ERROR_INT_VALUE:
1889        return CONNECT_ERROR;
1890      case NOT_SUPPORTED_INT_VALUE:
1891        return NOT_SUPPORTED;
1892      case CONTROL_NOT_FOUND_INT_VALUE:
1893        return CONTROL_NOT_FOUND;
1894      case NO_RESULTS_RETURNED_INT_VALUE:
1895        return NO_RESULTS_RETURNED;
1896      case MORE_RESULTS_TO_RETURN_INT_VALUE:
1897        return MORE_RESULTS_TO_RETURN;
1898      case CLIENT_LOOP_INT_VALUE:
1899        return CLIENT_LOOP;
1900      case REFERRAL_LIMIT_EXCEEDED_INT_VALUE:
1901        return REFERRAL_LIMIT_EXCEEDED;
1902      case CANCELED_INT_VALUE:
1903        return CANCELED;
1904      case NO_SUCH_OPERATION_INT_VALUE:
1905        return NO_SUCH_OPERATION;
1906      case TOO_LATE_INT_VALUE:
1907        return TOO_LATE;
1908      case CANNOT_CANCEL_INT_VALUE:
1909        return CANNOT_CANCEL;
1910      case ASSERTION_FAILED_INT_VALUE:
1911        return ASSERTION_FAILED;
1912      case AUTHORIZATION_DENIED_INT_VALUE:
1913        return AUTHORIZATION_DENIED;
1914      case E_SYNC_REFRESH_REQUIRED_INT_VALUE:
1915        return E_SYNC_REFRESH_REQUIRED;
1916      case NO_OPERATION_INT_VALUE:
1917        return NO_OPERATION;
1918      case INTERACTIVE_TRANSACTION_ABORTED_INT_VALUE:
1919        return INTERACTIVE_TRANSACTION_ABORTED;
1920      case DATABASE_LOCK_CONFLICT_INT_VALUE:
1921        return DATABASE_LOCK_CONFLICT;
1922      case MIRRORED_SUBTREE_DIGEST_MISMATCH_INT_VALUE:
1923        return MIRRORED_SUBTREE_DIGEST_MISMATCH;
1924      case TOKEN_DELIVERY_MECHANISM_UNAVAILABLE_INT_VALUE:
1925        return TOKEN_DELIVERY_MECHANISM_UNAVAILABLE;
1926      case TOKEN_DELIVERY_ATTEMPT_FAILED_INT_VALUE:
1927        return TOKEN_DELIVERY_ATTEMPT_FAILED;
1928      case TOKEN_DELIVERY_INVALID_RECIPIENT_ID_INT_VALUE:
1929        return TOKEN_DELIVERY_INVALID_RECIPIENT_ID;
1930      case TOKEN_DELIVERY_INVALID_ACCOUNT_STATE_INT_VALUE:
1931        return TOKEN_DELIVERY_INVALID_ACCOUNT_STATE;
1932    }
1933
1934    ResultCode rc = UNDEFINED_RESULT_CODES.get(intValue);
1935    if (rc == null)
1936    {
1937      if (! createNewResultCode)
1938      {
1939        return null;
1940      }
1941
1942      if (name == null)
1943      {
1944        rc = new ResultCode(intValue);
1945      }
1946      else
1947      {
1948        rc = new ResultCode(name, intValue);
1949      }
1950
1951      final ResultCode existingRC =
1952           UNDEFINED_RESULT_CODES.putIfAbsent(intValue, rc);
1953      if (existingRC != null)
1954      {
1955        return existingRC;
1956      }
1957    }
1958
1959    return rc;
1960  }
1961
1962
1963
1964  /**
1965   * Retrieves an array of all result codes defined in the LDAP SDK.  This will
1966   * not include dynamically-generated values.
1967   *
1968   * @return  An array of all result codes defined in the LDAP SDK.
1969   */
1970  public static ResultCode[] values()
1971  {
1972    return new ResultCode[]
1973    {
1974      SUCCESS,
1975      OPERATIONS_ERROR,
1976      PROTOCOL_ERROR,
1977      TIME_LIMIT_EXCEEDED,
1978      SIZE_LIMIT_EXCEEDED,
1979      COMPARE_FALSE,
1980      COMPARE_TRUE,
1981      AUTH_METHOD_NOT_SUPPORTED,
1982      STRONG_AUTH_REQUIRED,
1983      REFERRAL,
1984      ADMIN_LIMIT_EXCEEDED,
1985      UNAVAILABLE_CRITICAL_EXTENSION,
1986      CONFIDENTIALITY_REQUIRED,
1987      SASL_BIND_IN_PROGRESS,
1988      NO_SUCH_ATTRIBUTE,
1989      UNDEFINED_ATTRIBUTE_TYPE,
1990      INAPPROPRIATE_MATCHING,
1991      CONSTRAINT_VIOLATION,
1992      ATTRIBUTE_OR_VALUE_EXISTS,
1993      INVALID_ATTRIBUTE_SYNTAX,
1994      NO_SUCH_OBJECT,
1995      ALIAS_PROBLEM,
1996      INVALID_DN_SYNTAX,
1997      ALIAS_DEREFERENCING_PROBLEM,
1998      INAPPROPRIATE_AUTHENTICATION,
1999      INVALID_CREDENTIALS,
2000      INSUFFICIENT_ACCESS_RIGHTS,
2001      BUSY,
2002      UNAVAILABLE,
2003      UNWILLING_TO_PERFORM,
2004      LOOP_DETECT,
2005      SORT_CONTROL_MISSING,
2006      OFFSET_RANGE_ERROR,
2007      NAMING_VIOLATION,
2008      OBJECT_CLASS_VIOLATION,
2009      NOT_ALLOWED_ON_NONLEAF,
2010      NOT_ALLOWED_ON_RDN,
2011      ENTRY_ALREADY_EXISTS,
2012      OBJECT_CLASS_MODS_PROHIBITED,
2013      AFFECTS_MULTIPLE_DSAS,
2014      VIRTUAL_LIST_VIEW_ERROR,
2015      OTHER,
2016      SERVER_DOWN,
2017      LOCAL_ERROR,
2018      ENCODING_ERROR,
2019      DECODING_ERROR,
2020      TIMEOUT,
2021      AUTH_UNKNOWN,
2022      FILTER_ERROR,
2023      USER_CANCELED,
2024      PARAM_ERROR,
2025      NO_MEMORY,
2026      CONNECT_ERROR,
2027      NOT_SUPPORTED,
2028      CONTROL_NOT_FOUND,
2029      NO_RESULTS_RETURNED,
2030      MORE_RESULTS_TO_RETURN,
2031      CLIENT_LOOP,
2032      REFERRAL_LIMIT_EXCEEDED,
2033      CANCELED,
2034      NO_SUCH_OPERATION,
2035      TOO_LATE,
2036      CANNOT_CANCEL,
2037      ASSERTION_FAILED,
2038      AUTHORIZATION_DENIED,
2039      E_SYNC_REFRESH_REQUIRED,
2040      NO_OPERATION,
2041      INTERACTIVE_TRANSACTION_ABORTED,
2042      DATABASE_LOCK_CONFLICT,
2043      MIRRORED_SUBTREE_DIGEST_MISMATCH,
2044      TOKEN_DELIVERY_MECHANISM_UNAVAILABLE,
2045      TOKEN_DELIVERY_ATTEMPT_FAILED,
2046      TOKEN_DELIVERY_INVALID_RECIPIENT_ID,
2047      TOKEN_DELIVERY_INVALID_ACCOUNT_STATE
2048    };
2049  }
2050
2051
2052
2053  /**
2054   * Indicates whether this result code is one that should be used for
2055   * client-side errors rather than returned by the server.
2056   *
2057   * @return  {@code true} if this result code is a client-side result code, or
2058   *          {@code false} if it is one that may be returned by the server.
2059   */
2060  public boolean isClientSideResultCode()
2061  {
2062    return isClientSideResultCode(this);
2063  }
2064
2065
2066
2067  /**
2068   * Indicates whether the provided result code is one that should be used for
2069   * client-side errors rather than returned by the server.
2070   *
2071   * @param  resultCode  The result code for which to make the determination.
2072   *
2073   * @return  {@code true} if the provided result code is a client-side result
2074   *          code, or {@code false} if it is one that may be returned by the
2075   *          server.
2076   */
2077  public static boolean isClientSideResultCode(final ResultCode resultCode)
2078  {
2079    switch (resultCode.intValue())
2080    {
2081      case SERVER_DOWN_INT_VALUE:
2082      case LOCAL_ERROR_INT_VALUE:
2083      case ENCODING_ERROR_INT_VALUE:
2084      case DECODING_ERROR_INT_VALUE:
2085      case TIMEOUT_INT_VALUE:
2086      case AUTH_UNKNOWN_INT_VALUE:
2087      case FILTER_ERROR_INT_VALUE:
2088      case USER_CANCELED_INT_VALUE:
2089      case PARAM_ERROR_INT_VALUE:
2090      case NO_MEMORY_INT_VALUE:
2091      case CONNECT_ERROR_INT_VALUE:
2092      case NOT_SUPPORTED_INT_VALUE:
2093      case CONTROL_NOT_FOUND_INT_VALUE:
2094      case NO_RESULTS_RETURNED_INT_VALUE:
2095      case MORE_RESULTS_TO_RETURN_INT_VALUE:
2096      case CLIENT_LOOP_INT_VALUE:
2097      case REFERRAL_LIMIT_EXCEEDED_INT_VALUE:
2098        return true;
2099      default:
2100        return false;
2101    }
2102  }
2103
2104
2105
2106  /**
2107   * Indicates whether the connection on which this result code was received is
2108   * likely still usable.  Note that this is a best guess, and it may or may not
2109   * be correct.  It will attempt to be conservative so that a connection is
2110   * more likely to be classified as unusable when it may still be valid than to
2111   * be classified as usable when that is no longer the case.
2112   *
2113   * @return  {@code true} if it is likely that the connection on which this
2114   *          result code was received is still usable, or {@code false} if it
2115   *          may no longer be valid.
2116   */
2117  public boolean isConnectionUsable()
2118  {
2119    return isConnectionUsable(this);
2120  }
2121
2122
2123
2124  /**
2125   * Indicates whether the connection on which the provided result code was
2126   * received is likely still usable.  Note that this is a best guess based on
2127   * the provided result code, and it may or may not be correct.  It will
2128   * attempt to be conservative so that a connection is more likely to be
2129   * classified as unusable when it may still be valid than to be classified
2130   * as usable when that is no longer the case.
2131   *
2132   * @param  resultCode  The result code for which to make the determination.
2133   *
2134   * @return  {@code true} if it is likely that the connection on which the
2135   *          provided result code was received is still usable, or
2136   *          {@code false} if it may no longer be valid.
2137   */
2138  public static boolean isConnectionUsable(final ResultCode resultCode)
2139  {
2140    switch (resultCode.intValue())
2141    {
2142      case OPERATIONS_ERROR_INT_VALUE:
2143      case PROTOCOL_ERROR_INT_VALUE:
2144      case BUSY_INT_VALUE:
2145      case UNAVAILABLE_INT_VALUE:
2146      case OTHER_INT_VALUE:
2147      case SERVER_DOWN_INT_VALUE:
2148      case LOCAL_ERROR_INT_VALUE:
2149      case ENCODING_ERROR_INT_VALUE:
2150      case DECODING_ERROR_INT_VALUE:
2151      case TIMEOUT_INT_VALUE:
2152      case NO_MEMORY_INT_VALUE:
2153      case CONNECT_ERROR_INT_VALUE:
2154        return false;
2155      default:
2156        return true;
2157    }
2158  }
2159
2160
2161
2162  /**
2163   * The hash code for this result code.
2164   *
2165   * @return  The hash code for this result code.
2166   */
2167  @Override()
2168  public int hashCode()
2169  {
2170    return intValue;
2171  }
2172
2173
2174
2175  /**
2176   * Indicates whether the provided object is equal to this result code.
2177   *
2178   * @param  o  The object for which to make the determination.
2179   *
2180   * @return  {@code true} if the provided object is a result code that is equal
2181   *          to this result code, or {@code false} if not.
2182   */
2183  @Override()
2184  public boolean equals(final Object o)
2185  {
2186    if (o == null)
2187    {
2188      return false;
2189    }
2190    else if (o == this)
2191    {
2192      return true;
2193    }
2194    else if (o instanceof ResultCode)
2195    {
2196      return (intValue == ((ResultCode) o).intValue);
2197    }
2198    else
2199    {
2200      return false;
2201    }
2202  }
2203
2204
2205
2206  /**
2207   * Retrieves a string representation of this result code.
2208   *
2209   * @return  A string representation of this result code.
2210   */
2211  @Override()
2212  public String toString()
2213  {
2214    return stringRepresentation;
2215  }
2216}