001 /*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License"). You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at
010 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012 * See the License for the specific language governing permissions
013 * and limitations under the License.
014 *
015 * When distributing Covered Code, include this CDDL HEADER in each
016 * file and include the License file at
017 * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
018 * add the following below this CDDL HEADER, with the fields enclosed
019 * by brackets "[]" replaced with your own identifying information:
020 * Portions Copyright [yyyy] [name of copyright owner]
021 *
022 * CDDL HEADER END
023 *
024 *
025 * Copyright 2006-2008 Sun Microsystems, Inc.
026 */
027 package org.opends.server.api.plugin;
028
029
030
031 import java.util.HashMap;
032 import java.util.HashSet;
033 import java.util.Map;
034 import java.util.Set;
035
036
037
038 /**
039 * This class defines an enumeration containing the types of plugins
040 * that are supported for use in the Directory Server.
041 */
042 @org.opends.server.types.PublicAPI(
043 stability=org.opends.server.types.StabilityLevel.UNCOMMITTED,
044 mayInstantiate=false,
045 mayExtend=false,
046 mayInvoke=true)
047 public enum PluginType
048 {
049 /**
050 * The plugin type for plugins that are invoked when the Directory
051 * Server is starting up.
052 */
053 STARTUP(PluginType.NAME_STARTUP),
054
055
056
057 /**
058 * The plugin type for plugins that are invoked when the Directory
059 * Server is performing a graceful shutdown.
060 */
061 SHUTDOWN(PluginType.NAME_SHUTDOWN),
062
063
064
065 /**
066 * The plugin type for plugins that are to be invoked whenever a new
067 * client connection is established.
068 */
069 POST_CONNECT(PluginType.NAME_POST_CONNECT),
070
071
072
073 /**
074 * The plugin type for plugins that are to be invoked whenever a
075 * client connection is closed.
076 */
077 POST_DISCONNECT(PluginType.NAME_POST_DISCONNECT),
078
079
080
081 /**
082 * The plugin type for plugins that are to be invoked for each entry
083 * read during an LDIF import.
084 */
085 LDIF_IMPORT(PluginType.NAME_LDIF_IMPORT),
086
087
088
089 /**
090 * The plugin type for plugins that are to be invoked for each entry
091 * written during an LDIF export.
092 */
093 LDIF_EXPORT(PluginType.NAME_LDIF_EXPORT),
094
095
096
097 /**
098 * The plugin type for plugins that are to be invoked before
099 * processing begins on an abandon operation.
100 */
101 PRE_PARSE_ABANDON(PluginType.NAME_PRE_PARSE_ABANDON),
102
103
104
105 /**
106 * The plugin type for plugins that are to be invoked before
107 * processing begins on an add operation.
108 */
109 PRE_PARSE_ADD(PluginType.NAME_PRE_PARSE_ADD),
110
111
112
113 /**
114 * The plugin type for plugins that are to be invoked before
115 * processing begins on a bind operation.
116 */
117 PRE_PARSE_BIND(PluginType.NAME_PRE_PARSE_BIND),
118
119
120
121 /**
122 * The plugin type for plugins that are to be invoked before
123 * processing begins on a compare operation.
124 */
125 PRE_PARSE_COMPARE(PluginType.NAME_PRE_PARSE_COMPARE),
126
127
128
129 /**
130 * The plugin type for plugins that are to be invoked before
131 * processing begins on a delete operation.
132 */
133 PRE_PARSE_DELETE(PluginType.NAME_PRE_PARSE_DELETE),
134
135
136
137 /**
138 * The plugin type for plugins that are to be invoked before
139 * processing begins on an extended operation.
140 */
141 PRE_PARSE_EXTENDED(PluginType.NAME_PRE_PARSE_EXTENDED),
142
143
144
145 /**
146 * The plugin type for plugins that are to be invoked before
147 * processing begins on a modify operation.
148 */
149 PRE_PARSE_MODIFY(PluginType.NAME_PRE_PARSE_MODIFY),
150
151
152
153 /**
154 * The plugin type for plugins that are to be invoked before
155 * processing begins on a modify DN operation.
156 */
157 PRE_PARSE_MODIFY_DN(PluginType.NAME_PRE_PARSE_MODIFY_DN),
158
159
160
161 /**
162 * The plugin type for plugins that are to be invoked before
163 * processing begins on a search operation.
164 */
165 PRE_PARSE_SEARCH(PluginType.NAME_PRE_PARSE_SEARCH),
166
167
168
169 /**
170 * The plugin type for plugins that are to be invoked before
171 * processing begins on an unbind operation.
172 */
173 PRE_PARSE_UNBIND(PluginType.NAME_PRE_PARSE_UNBIND),
174
175
176
177 /**
178 * The plugin type for plugins that are to be invoked just before
179 * the core processing for an add operation.
180 */
181 PRE_OPERATION_ADD(PluginType.NAME_PRE_OPERATION_ADD),
182
183
184
185 /**
186 * The plugin type for plugins that are to be invoked just before
187 * the core processing for a bind operation.
188 */
189 PRE_OPERATION_BIND(PluginType.NAME_PRE_OPERATION_BIND),
190
191
192
193 /**
194 * The plugin type for plugins that are to be invoked just before
195 * the core processing for a compare operation.
196 */
197 PRE_OPERATION_COMPARE(PluginType.NAME_PRE_OPERATION_COMPARE),
198
199
200
201 /**
202 * The plugin type for plugins that are to be invoked just before
203 * the core processing for a delete operation.
204 */
205 PRE_OPERATION_DELETE(PluginType.NAME_PRE_OPERATION_DELETE),
206
207
208
209 /**
210 * The plugin type for plugins that are to be invoked just before
211 * the core processing for an extended operation.
212 */
213 PRE_OPERATION_EXTENDED(PluginType.NAME_PRE_OPERATION_EXTENDED),
214
215
216
217 /**
218 * The plugin type for plugins that are to be invoked just before
219 * the core processing for a modify operation.
220 */
221 PRE_OPERATION_MODIFY(PluginType.NAME_PRE_OPERATION_MODIFY),
222
223
224
225 /**
226 * The plugin type for plugins that are to be invoked just before
227 * the core processing for a modify DN operation.
228 */
229 PRE_OPERATION_MODIFY_DN(PluginType.NAME_PRE_OPERATION_MODIFY_DN),
230
231
232
233 /**
234 * The plugin type for plugins that are to be invoked just before
235 * the core processing for a search operation.
236 */
237 PRE_OPERATION_SEARCH(PluginType.NAME_PRE_OPERATION_SEARCH),
238
239
240
241 /**
242 * The plugin type for plugins that are to be invoked just after the
243 * core processing for an abandon operation.
244 */
245 POST_OPERATION_ABANDON(PluginType.NAME_POST_OPERATION_ABANDON),
246
247
248
249 /**
250 * The plugin type for plugins that are to be invoked just after the
251 * core processing for an add operation.
252 */
253 POST_OPERATION_ADD(PluginType.NAME_POST_OPERATION_ADD),
254
255
256
257 /**
258 * The plugin type for plugins that are to be invoked just after the
259 * core processing for a bind operation.
260 */
261 POST_OPERATION_BIND(PluginType.NAME_POST_OPERATION_BIND),
262
263
264
265 /**
266 * The plugin type for plugins that are to be invoked just after the
267 * core processing for a compare operation.
268 */
269 POST_OPERATION_COMPARE(PluginType.NAME_POST_OPERATION_COMPARE),
270
271
272
273 /**
274 * The plugin type for plugins that are to be invoked just after the
275 * core processing for a delete operation.
276 */
277 POST_OPERATION_DELETE(PluginType.NAME_POST_OPERATION_DELETE),
278
279
280
281 /**
282 * The plugin type for plugins that are to be invoked just after the
283 * core processing for an extended operation.
284 */
285 POST_OPERATION_EXTENDED(PluginType.NAME_POST_OPERATION_EXTENDED),
286
287
288
289 /**
290 * The plugin type for plugins that are to be invoked just after the
291 * core processing for a modify operation.
292 */
293 POST_OPERATION_MODIFY(PluginType.NAME_POST_OPERATION_MODIFY),
294
295
296
297 /**
298 * The plugin type for plugins that are to be invoked just after the
299 * core processing for a modify DN operation.
300 */
301 POST_OPERATION_MODIFY_DN(PluginType.NAME_POST_OPERATION_MODIFY_DN),
302
303
304
305 /**
306 * The plugin type for plugins that are to be invoked just after the
307 * core processing for a search operation.
308 */
309 POST_OPERATION_SEARCH(PluginType.NAME_POST_OPERATION_SEARCH),
310
311
312
313 /**
314 * The plugin type for plugins that are to be invoked just after the
315 * core processing for an unbind operation.
316 */
317 POST_OPERATION_UNBIND(PluginType.NAME_POST_OPERATION_UNBIND),
318
319
320
321 /**
322 * The plugin type for plugins that are to be invoked just after the
323 * response is sent for an add operation.
324 */
325 POST_RESPONSE_ADD(PluginType.NAME_POST_RESPONSE_ADD),
326
327
328
329 /**
330 * The plugin type for plugins that are to be invoked just after the
331 * response is sent for a bind operation.
332 */
333 POST_RESPONSE_BIND(PluginType.NAME_POST_RESPONSE_BIND),
334
335
336
337 /**
338 * The plugin type for plugins that are to be invoked just after the
339 * response is sent for a compare operation.
340 */
341 POST_RESPONSE_COMPARE(PluginType.NAME_POST_RESPONSE_COMPARE),
342
343
344
345 /**
346 * The plugin type for plugins that are to be invoked just after the
347 * response is sent for a delete operation.
348 */
349 POST_RESPONSE_DELETE(PluginType.NAME_POST_RESPONSE_DELETE),
350
351
352
353 /**
354 * The plugin type for plugins that are to be invoked just after the
355 * response is sent for an extended operation.
356 */
357 POST_RESPONSE_EXTENDED(PluginType.NAME_POST_RESPONSE_EXTENDED),
358
359
360
361 /**
362 * The plugin type for plugins that are to be invoked just after the
363 * response is sent for a modify operation.
364 */
365 POST_RESPONSE_MODIFY(PluginType.NAME_POST_RESPONSE_MODIFY),
366
367
368
369 /**
370 * The plugin type for plugins that are to be invoked just after the
371 * response is sent for a modify DN operation.
372 */
373 POST_RESPONSE_MODIFY_DN(PluginType.NAME_POST_RESPONSE_MODIFY_DN),
374
375
376
377 /**
378 * The plugin type for plugins that are to be invoked just after the
379 * response is sent for a search operation.
380 */
381 POST_RESPONSE_SEARCH(PluginType.NAME_POST_RESPONSE_SEARCH),
382
383
384
385 /**
386 * The plugin type for plugins that are to be invoked just after an
387 * add operation has been completed via synchronization.
388 */
389 POST_SYNCHRONIZATION_ADD(PluginType.NAME_POST_SYNCHRONIZATION_ADD),
390
391
392
393 /**
394 * The plugin type for plugins that are to be invoked just after a
395 * delete operation has been completed via synchronization.
396 */
397 POST_SYNCHRONIZATION_DELETE(
398 PluginType.NAME_POST_SYNCHRONIZATION_DELETE),
399
400
401
402 /**
403 * The plugin type for plugins that are to be invoked just after a
404 * modify operation has been completed via synchronization.
405 */
406 POST_SYNCHRONIZATION_MODIFY(
407 PluginType.NAME_POST_SYNCHRONIZATION_MODIFY),
408
409
410
411 /**
412 * The plugin type for plugins that are to be invoked just after a
413 * modify DN operation has been completed via synchronization.
414 */
415 POST_SYNCHRONIZATION_MODIFY_DN(
416 PluginType.NAME_POST_SYNCHRONIZATION_MODIFY_DN),
417
418
419
420 /**
421 * The plugin type for plugins that are to be invoked before each
422 * search result entry is sent to a client.
423 */
424 SEARCH_RESULT_ENTRY(PluginType.NAME_SEARCH_ENTRY),
425
426
427
428 /**
429 * The plugin type for plugins that are to be invoked before each
430 * search result reference is sent to a client.
431 */
432 SEARCH_RESULT_REFERENCE(PluginType.NAME_SEARCH_REFERENCE),
433
434
435
436 /**
437 * The plugin type for plugins that are to be invoked on each
438 * subordinate entry that is moved or renamed as part of a modify DN
439 * operation.
440 */
441 SUBORDINATE_MODIFY_DN(PluginType.NAME_SUBORDINATE_MODIFY_DN),
442
443
444
445 /**
446 * The plugin type for plugins that are to be invoked before each
447 * intermediate response message is sent to a client.
448 */
449 INTERMEDIATE_RESPONSE(PluginType.NAME_INTERMEDIATE_RESPONSE);
450
451
452
453 /**
454 * The name that will be used for startup plugins.
455 */
456 private static final String NAME_STARTUP = "startup";
457
458
459
460 /**
461 * The name that will be used for shutdown plugins.
462 */
463 private static final String NAME_SHUTDOWN = "shutdown";
464
465
466
467 /**
468 * The name that will be used for post-connect plugins.
469 */
470 private static final String NAME_POST_CONNECT = "postconnect";
471
472
473
474 /**
475 * The name that will be used for post-disconnect plugins.
476 */
477 private static final String NAME_POST_DISCONNECT = "postdisconnect";
478
479
480
481 /**
482 * The name that will be used for LDIF import plugins.
483 */
484 private static final String NAME_LDIF_IMPORT = "ldifimport";
485
486
487
488 /**
489 * The name that will be used for LDIF export plugins.
490 */
491 private static final String NAME_LDIF_EXPORT = "ldifexport";
492
493
494
495 /**
496 * The name that will be used for pre-parse abandon plugins.
497 */
498 private static final String NAME_PRE_PARSE_ABANDON =
499 "preparseabandon";
500
501
502
503 /**
504 * The name that will be used for pre-parse add plugins.
505 */
506 private static final String NAME_PRE_PARSE_ADD = "preparseadd";
507
508
509
510 /**
511 * The name that will be used for pre-parse bind plugins.
512 */
513 private static final String NAME_PRE_PARSE_BIND = "preparsebind";
514
515
516
517 /**
518 * The name that will be used for pre-parse compare plugins.
519 */
520 private static final String NAME_PRE_PARSE_COMPARE =
521 "preparsecompare";
522
523
524
525 /**
526 * The name that will be used for pre-parse delete plugins.
527 */
528 private static final String NAME_PRE_PARSE_DELETE =
529 "preparsedelete";
530
531
532
533 /**
534 * The name that will be used for pre-parse extended plugins.
535 */
536 private static final String NAME_PRE_PARSE_EXTENDED =
537 "preparseextended";
538
539
540
541 /**
542 * The name that will be used for pre-parse modify plugins.
543 */
544 private static final String NAME_PRE_PARSE_MODIFY =
545 "preparsemodify";
546
547
548
549 /**
550 * The name that will be used for pre-parse modify DN plugins.
551 */
552 private static final String NAME_PRE_PARSE_MODIFY_DN =
553 "preparsemodifydn";
554
555
556
557 /**
558 * The name that will be used for pre-parse search plugins.
559 */
560 private static final String NAME_PRE_PARSE_SEARCH =
561 "preparsesearch";
562
563
564
565 /**
566 * The name that will be used for pre-parse unbind plugins.
567 */
568 private static final String NAME_PRE_PARSE_UNBIND =
569 "preparseunbind";
570
571
572
573 /**
574 * The name that will be used for pre-operation add plugins.
575 */
576 private static final String NAME_PRE_OPERATION_ADD =
577 "preoperationadd";
578
579
580
581 /**
582 * The name that will be used for pre-operation bind plugins.
583 */
584 private static final String NAME_PRE_OPERATION_BIND =
585 "preoperationbind";
586
587
588
589 /**
590 * The name that will be used for pre-operation compare plugins.
591 */
592 private static final String NAME_PRE_OPERATION_COMPARE =
593 "preoperationcompare";
594
595
596
597 /**
598 * The name that will be used for pre-operation delete plugins.
599 */
600 private static final String NAME_PRE_OPERATION_DELETE =
601 "preoperationdelete";
602
603
604
605 /**
606 * The name that will be used for pre-operation extended plugins.
607 */
608 private static final String NAME_PRE_OPERATION_EXTENDED =
609 "preoperationextended";
610
611
612
613 /**
614 * The name that will be used for pre-operation modify plugins.
615 */
616 private static final String NAME_PRE_OPERATION_MODIFY =
617 "preoperationmodify";
618
619
620
621 /**
622 * The name that will be used for pre-operation modify DN plugins.
623 */
624 private static final String NAME_PRE_OPERATION_MODIFY_DN =
625 "preoperationmodifydn";
626
627
628
629 /**
630 * The name that will be used for pre-operation search plugins.
631 */
632 private static final String NAME_PRE_OPERATION_SEARCH =
633 "preoperationsearch";
634
635
636
637 /**
638 * The name that will be used for post-operation abandon plugins.
639 */
640 private static final String NAME_POST_OPERATION_ABANDON =
641 "postoperationabandon";
642
643
644
645 /**
646 * The name that will be used for post-operation add plugins.
647 */
648 private static final String NAME_POST_OPERATION_ADD =
649 "postoperationadd";
650
651
652
653 /**
654 * The name that will be used for post-operation bind plugins.
655 */
656 private static final String NAME_POST_OPERATION_BIND =
657 "postoperationbind";
658
659
660
661 /**
662 * The name that will be used for post-operation compare plugins.
663 */
664 private static final String NAME_POST_OPERATION_COMPARE =
665 "postoperationcompare";
666
667
668
669 /**
670 * The name that will be used for post-operation delete plugins.
671 */
672 private static final String NAME_POST_OPERATION_DELETE =
673 "postoperationdelete";
674
675
676
677 /**
678 * The name that will be used for post-operation extended plugins.
679 */
680 private static final String NAME_POST_OPERATION_EXTENDED =
681 "postoperationextended";
682
683
684
685 /**
686 * The name that will be used for post-operation modify plugins.
687 */
688 private static final String NAME_POST_OPERATION_MODIFY =
689 "postoperationmodify";
690
691
692
693 /**
694 * The name that will be used for post-operation modify DN plugins.
695 */
696 private static final String NAME_POST_OPERATION_MODIFY_DN =
697 "postoperationmodifydn";
698
699
700
701 /**
702 * The name that will be used for post-operation search plugins.
703 */
704 private static final String NAME_POST_OPERATION_SEARCH =
705 "postoperationsearch";
706
707
708
709 /**
710 * The name that will be used for post-operation unbind plugins.
711 */
712 private static final String NAME_POST_OPERATION_UNBIND =
713 "postoperationunbind";
714
715
716
717 /**
718 * The name that will be used for post-response add plugins.
719 */
720 private static final String NAME_POST_RESPONSE_ADD =
721 "postresponseadd";
722
723
724
725 /**
726 * The name that will be used for post-response bind plugins.
727 */
728 private static final String NAME_POST_RESPONSE_BIND =
729 "postresponsebind";
730
731
732
733 /**
734 * The name that will be used for post-response compare plugins.
735 */
736 private static final String NAME_POST_RESPONSE_COMPARE =
737 "postresponsecompare";
738
739
740
741 /**
742 * The name that will be used for post-response delete plugins.
743 */
744 private static final String NAME_POST_RESPONSE_DELETE =
745 "postresponsedelete";
746
747
748
749 /**
750 * The name that will be used for post-response extended plugins.
751 */
752 private static final String NAME_POST_RESPONSE_EXTENDED =
753 "postresponseextended";
754
755
756
757 /**
758 * The name that will be used for post-response modify plugins.
759 */
760 private static final String NAME_POST_RESPONSE_MODIFY =
761 "postresponsemodify";
762
763
764
765 /**
766 * The name that will be used for post-response modify DN plugins.
767 */
768 private static final String NAME_POST_RESPONSE_MODIFY_DN =
769 "postresponsemodifydn";
770
771
772
773 /**
774 * The name that will be used for post-response search plugins.
775 */
776 private static final String NAME_POST_RESPONSE_SEARCH =
777 "postresponsesearch";
778
779
780
781 /**
782 * The name that will be used for post-synchronization add plugins.
783 */
784 private static final String NAME_POST_SYNCHRONIZATION_ADD =
785 "postsynchronizationadd";
786
787
788
789 /**
790 * The name that will be used for post-synchronization delete
791 * plugins.
792 */
793 private static final String NAME_POST_SYNCHRONIZATION_DELETE =
794 "postsynchronizationdelete";
795
796
797
798 /**
799 * The name that will be used for post-synchronization modify
800 * plugins.
801 */
802 private static final String NAME_POST_SYNCHRONIZATION_MODIFY =
803 "postsynchronizationmodify";
804
805
806
807 /**
808 * The name that will be used for post-synchronization modify DN
809 * plugins.
810 */
811 private static final String NAME_POST_SYNCHRONIZATION_MODIFY_DN =
812 "postsynchronizationmodifydn";
813
814
815
816 /**
817 * The name that will be used for search result entry plugins.
818 */
819 private static final String NAME_SEARCH_ENTRY = "searchresultentry";
820
821
822
823 /**
824 * The name that will be used for search result reference plugins.
825 */
826 private static final String NAME_SEARCH_REFERENCE =
827 "searchresultreference";
828
829
830
831 /**
832 * The name that will be used for subordinate modify DN plugins.
833 */
834 private static final String NAME_SUBORDINATE_MODIFY_DN =
835 "subordinatemodifydn";
836
837
838
839 /**
840 * The name that will be used for intermediate response plugins.
841 */
842 private static final String NAME_INTERMEDIATE_RESPONSE =
843 "intermediateresponse";
844
845
846
847 /**
848 * A hash set containing the names of all the available plugin
849 * types.
850 */
851 private static final Set<String> PLUGIN_TYPE_NAMES =
852 new HashSet<String>(50);
853
854
855
856 /**
857 * A hash map that relates the plugin type names to the
858 * corresponding plugin type.
859 */
860 private static final Map<String,PluginType> PLUGIN_TYPE_MAP =
861 new HashMap<String,PluginType>(50);
862
863
864
865 static
866 {
867 PLUGIN_TYPE_NAMES.add(PluginType.NAME_STARTUP);
868 PLUGIN_TYPE_NAMES.add(PluginType.NAME_SHUTDOWN);
869 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_CONNECT);
870 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_DISCONNECT);
871 PLUGIN_TYPE_NAMES.add(PluginType.NAME_LDIF_IMPORT);
872 PLUGIN_TYPE_NAMES.add(PluginType.NAME_LDIF_EXPORT);
873 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_PARSE_ABANDON);
874 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_PARSE_ADD);
875 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_PARSE_BIND);
876 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_PARSE_COMPARE);
877 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_PARSE_DELETE);
878 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_PARSE_EXTENDED);
879 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_PARSE_MODIFY);
880 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_PARSE_MODIFY_DN);
881 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_PARSE_SEARCH);
882 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_PARSE_UNBIND);
883 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_OPERATION_ADD);
884 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_OPERATION_BIND);
885 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_OPERATION_COMPARE);
886 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_OPERATION_DELETE);
887 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_OPERATION_EXTENDED);
888 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_OPERATION_MODIFY);
889 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_OPERATION_MODIFY_DN);
890 PLUGIN_TYPE_NAMES.add(PluginType.NAME_PRE_OPERATION_SEARCH);
891 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_OPERATION_ABANDON);
892 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_OPERATION_ADD);
893 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_OPERATION_BIND);
894 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_OPERATION_COMPARE);
895 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_OPERATION_DELETE);
896 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_OPERATION_EXTENDED);
897 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_OPERATION_MODIFY);
898 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_OPERATION_MODIFY_DN);
899 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_OPERATION_SEARCH);
900 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_OPERATION_UNBIND);
901 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_RESPONSE_ADD);
902 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_RESPONSE_BIND);
903 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_RESPONSE_COMPARE);
904 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_RESPONSE_DELETE);
905 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_RESPONSE_EXTENDED);
906 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_RESPONSE_MODIFY);
907 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_RESPONSE_MODIFY_DN);
908 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_RESPONSE_SEARCH);
909 PLUGIN_TYPE_NAMES.add(PluginType.NAME_POST_SYNCHRONIZATION_ADD);
910 PLUGIN_TYPE_NAMES.add(
911 PluginType.NAME_POST_SYNCHRONIZATION_DELETE);
912 PLUGIN_TYPE_NAMES.add(
913 PluginType.NAME_POST_SYNCHRONIZATION_MODIFY);
914 PLUGIN_TYPE_NAMES.add(
915 PluginType.NAME_POST_SYNCHRONIZATION_MODIFY_DN);
916 PLUGIN_TYPE_NAMES.add(PluginType.NAME_SEARCH_ENTRY);
917 PLUGIN_TYPE_NAMES.add(PluginType.NAME_SEARCH_REFERENCE);
918 PLUGIN_TYPE_NAMES.add(PluginType.NAME_SUBORDINATE_MODIFY_DN);
919 PLUGIN_TYPE_NAMES.add(PluginType.NAME_INTERMEDIATE_RESPONSE);
920
921 PLUGIN_TYPE_MAP.put(PluginType.NAME_STARTUP, PluginType.STARTUP);
922 PLUGIN_TYPE_MAP.put(PluginType.NAME_SHUTDOWN,
923 PluginType.SHUTDOWN);
924 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_CONNECT,
925 PluginType.POST_CONNECT);
926 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_DISCONNECT,
927 PluginType.POST_DISCONNECT);
928 PLUGIN_TYPE_MAP.put(PluginType.NAME_LDIF_IMPORT,
929 PluginType.LDIF_IMPORT);
930 PLUGIN_TYPE_MAP.put(PluginType.NAME_LDIF_EXPORT,
931 PluginType.LDIF_EXPORT);
932 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_PARSE_ABANDON,
933 PluginType.PRE_PARSE_ABANDON);
934 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_PARSE_ADD,
935 PluginType.PRE_PARSE_ADD);
936 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_PARSE_BIND,
937 PluginType.PRE_PARSE_BIND);
938 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_PARSE_COMPARE,
939 PluginType.PRE_PARSE_COMPARE);
940 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_PARSE_DELETE,
941 PluginType.PRE_PARSE_DELETE);
942 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_PARSE_EXTENDED,
943 PluginType.PRE_PARSE_EXTENDED);
944 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_PARSE_MODIFY,
945 PluginType.PRE_PARSE_MODIFY);
946 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_PARSE_MODIFY_DN,
947 PluginType.PRE_PARSE_MODIFY_DN);
948 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_PARSE_SEARCH,
949 PluginType.PRE_PARSE_SEARCH);
950 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_PARSE_UNBIND,
951 PluginType.PRE_PARSE_UNBIND);
952 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_OPERATION_ADD,
953 PluginType.PRE_OPERATION_ADD);
954 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_OPERATION_BIND,
955 PluginType.PRE_OPERATION_BIND);
956 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_OPERATION_COMPARE,
957 PluginType.PRE_OPERATION_COMPARE);
958 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_OPERATION_DELETE,
959 PluginType.PRE_OPERATION_DELETE);
960 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_OPERATION_EXTENDED,
961 PluginType.PRE_OPERATION_EXTENDED);
962 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_OPERATION_MODIFY,
963 PluginType.PRE_OPERATION_MODIFY);
964 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_OPERATION_MODIFY_DN,
965 PluginType.PRE_OPERATION_MODIFY_DN);
966 PLUGIN_TYPE_MAP.put(PluginType.NAME_PRE_OPERATION_SEARCH,
967 PluginType.PRE_OPERATION_SEARCH);
968 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_OPERATION_ABANDON,
969 PluginType.POST_OPERATION_ABANDON);
970 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_OPERATION_ADD,
971 PluginType.POST_OPERATION_ADD);
972 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_OPERATION_BIND,
973 PluginType.POST_OPERATION_BIND);
974 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_OPERATION_COMPARE,
975 PluginType.POST_OPERATION_COMPARE);
976 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_OPERATION_DELETE,
977 PluginType.POST_OPERATION_DELETE);
978 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_OPERATION_EXTENDED,
979 PluginType.POST_OPERATION_EXTENDED);
980 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_OPERATION_MODIFY,
981 PluginType.POST_OPERATION_MODIFY);
982 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_OPERATION_MODIFY_DN,
983 PluginType.POST_OPERATION_MODIFY_DN);
984 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_OPERATION_SEARCH,
985 PluginType.POST_OPERATION_SEARCH);
986 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_OPERATION_UNBIND,
987 PluginType.POST_OPERATION_UNBIND);
988 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_RESPONSE_ADD,
989 PluginType.POST_RESPONSE_ADD);
990 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_RESPONSE_BIND,
991 PluginType.POST_RESPONSE_BIND);
992 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_RESPONSE_COMPARE,
993 PluginType.POST_RESPONSE_COMPARE);
994 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_RESPONSE_DELETE,
995 PluginType.POST_RESPONSE_DELETE);
996 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_RESPONSE_EXTENDED,
997 PluginType.POST_RESPONSE_EXTENDED);
998 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_RESPONSE_MODIFY,
999 PluginType.POST_RESPONSE_MODIFY);
1000 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_RESPONSE_MODIFY_DN,
1001 PluginType.POST_RESPONSE_MODIFY_DN);
1002 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_RESPONSE_SEARCH,
1003 PluginType.POST_RESPONSE_SEARCH);
1004 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_SYNCHRONIZATION_ADD,
1005 PluginType.POST_SYNCHRONIZATION_ADD);
1006 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_SYNCHRONIZATION_DELETE,
1007 PluginType.POST_SYNCHRONIZATION_DELETE);
1008 PLUGIN_TYPE_MAP.put(PluginType.NAME_POST_SYNCHRONIZATION_MODIFY,
1009 PluginType.POST_SYNCHRONIZATION_MODIFY);
1010 PLUGIN_TYPE_MAP.put(
1011 PluginType.NAME_POST_SYNCHRONIZATION_MODIFY_DN,
1012 PluginType.POST_SYNCHRONIZATION_MODIFY_DN);
1013 PLUGIN_TYPE_MAP.put(PluginType.NAME_SEARCH_ENTRY,
1014 PluginType.SEARCH_RESULT_ENTRY);
1015 PLUGIN_TYPE_MAP.put(PluginType.NAME_SEARCH_REFERENCE,
1016 PluginType.SEARCH_RESULT_REFERENCE);
1017 PLUGIN_TYPE_MAP.put(PluginType.NAME_SUBORDINATE_MODIFY_DN,
1018 PluginType.SUBORDINATE_MODIFY_DN);
1019 PLUGIN_TYPE_MAP.put(PluginType.NAME_INTERMEDIATE_RESPONSE,
1020 PluginType.INTERMEDIATE_RESPONSE);
1021 }
1022
1023
1024
1025 // The name for this plugin type.
1026 private String name;
1027
1028
1029
1030 /**
1031 * Creates a new plugin type instance with the specified name.
1032 *
1033 * @param name The name to use for this plugin type.
1034 */
1035 private PluginType(String name)
1036 {
1037 this.name = name;
1038 }
1039
1040
1041
1042 /**
1043 * Retrieves the name for this plugin type.
1044 *
1045 * @return The name for this plugin type.
1046 */
1047 public String getName()
1048 {
1049 return name;
1050 }
1051
1052
1053
1054 /**
1055 * Retrieves a string representation of this plugin type.
1056 *
1057 * @return A string representation of this plugin type.
1058 */
1059 public String toString()
1060 {
1061 return name;
1062 }
1063
1064
1065
1066 /**
1067 * Retrieves a hash set containing the names of all the plugin
1068 * types.
1069 *
1070 * @return A hash set containing the names of all the plugin types.
1071 */
1072 public static Set<String> getPluginTypeNames()
1073 {
1074 return PLUGIN_TYPE_NAMES;
1075 }
1076
1077
1078
1079 /**
1080 * Retrieves the plugin type for the plugin with the specified name.
1081 *
1082 * @param lowerName The name of the plugin type to retrieve,
1083 * formatted in all lowercase characters.
1084 *
1085 * @return The requested plugin type, or {@code null} if there is
1086 * no type for the provided name.
1087 */
1088 public static PluginType forName(String lowerName)
1089 {
1090 return PLUGIN_TYPE_MAP.get(lowerName);
1091 }
1092 }
1093