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