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