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 legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2006-2010 Sun Microsystems, Inc.
025 *      Portions Copyright 2014-2015 ForgeRock AS
026 */
027package org.opends.server.api.plugin;
028
029import org.forgerock.i18n.LocalizableMessage;
030
031import java.util.List;
032import java.util.Set;
033
034import org.opends.server.admin.std.server.PluginCfg;
035import org.opends.server.api.ClientConnection;
036import org.forgerock.opendj.config.server.ConfigException;
037import org.opends.server.core.DeleteOperation;
038import org.opends.server.types.*;
039import org.opends.server.types.operation.*;
040
041import static org.opends.messages.PluginMessages.*;
042
043
044/**
045 * This class defines the set of methods and structures that are
046 * available for use in Directory Server plugins.  This is a single
047 * class that may be used for all types of plugins, and an individual
048 * plugin only needs to implement the specific methods that are
049 * applicable to that particular plugin type.
050 *
051 * @param  <T>  The type of configuration handled by this plugin.
052 */
053@org.opends.server.types.PublicAPI(
054     stability=org.opends.server.types.StabilityLevel.UNCOMMITTED,
055     mayInstantiate=false,
056     mayExtend=true,
057     mayInvoke=false)
058public abstract class DirectoryServerPlugin
059       <T extends PluginCfg>
060{
061  /** Indicates whether this plugin should be invoked for internal operations. */
062  private boolean invokeForInternalOps;
063
064  /** The DN of the configuration entry for this plugin. */
065  private DN pluginDN;
066
067  /** The plugin types for which this plugin is registered. */
068  private Set<PluginType> pluginTypes;
069
070
071
072  /**
073   * Creates a new instance of this Directory Server plugin.  Every
074   * plugin must implement a default constructor (it is the only one
075   * that will be used to create plugins defined in the
076   * configuration), and every plugin constructor must call
077   * {@code super()} as its first action.
078   */
079  protected DirectoryServerPlugin()
080  {
081  }
082
083
084
085  /**
086   * Indicates whether the provided configuration is acceptable for
087   * this plugin.  It should be possible to call this method on an
088   * uninitialized plugin instance in order to determine whether the
089   * plugin would be able to use the provided configuration.
090   *
091   * @param  configuration        The plugin configuration for which
092   *                              to make the determination.
093   * @param  unacceptableReasons  A list that may be used to hold the
094   *                              reasons that the provided
095   *                              configuration is not acceptable.
096   *
097   * @return  {@code true} if the provided configuration is acceptable
098   *          for this plugin, or {@code false} if not.
099   */
100  public boolean isConfigurationAcceptable(PluginCfg configuration,
101                      List<LocalizableMessage> unacceptableReasons)
102  {
103    // This default implementation does not perform any special
104    // validation.  It should be overridden by plugin implementations
105    // that wish to perform more detailed validation.
106    return true;
107  }
108
109
110
111  /**
112   * Performs any initialization that should be done for all types of
113   * plugins regardless of type. This should only be called by the
114   * core Directory Server code during the course of loading a plugin.
115   *
116   * @param pluginDN
117   *          The configuration entry name of this plugin.
118   * @param pluginTypes
119   *          The set of plugin types for which this plugin is
120   *          registered.
121   * @param invokeForInternalOps
122   *          Indicates whether this plugin should be invoked for
123   *          internal operations.
124   */
125  @org.opends.server.types.PublicAPI(
126       stability=org.opends.server.types.StabilityLevel.PRIVATE,
127       mayInstantiate=false,
128       mayExtend=false,
129       mayInvoke=false)
130  public final void initializeInternal(DN pluginDN,
131      Set<PluginType> pluginTypes, boolean invokeForInternalOps)
132  {
133    this.pluginDN = pluginDN;
134    this.pluginTypes = pluginTypes;
135    this.invokeForInternalOps = invokeForInternalOps;
136  }
137
138
139
140  /**
141   * Performs any initialization necessary for this plugin.  This will
142   * be called as soon as the plugin has been loaded and before it is
143   * registered with the server.
144   *
145   * @param  pluginTypes    The set of plugin types that indicate the
146   *                        ways in which this plugin will be invoked.
147   * @param  configuration  The configuration for this plugin.
148   *
149   * @throws  ConfigException  If the provided entry does not contain
150   *                           a valid configuration for this plugin.
151   *
152   * @throws  InitializationException  If a problem occurs while
153   *                                   initializing the plugin that is
154   *                                   not related to the server
155   *                                   configuration.
156   */
157  public abstract void initializePlugin(Set<PluginType> pluginTypes,
158                                        T configuration)
159         throws ConfigException, InitializationException;
160
161
162
163  /**
164   * Performs any necessary finalization for this plugin.  This will
165   * be called just after the plugin has been deregistered with the
166   * server but before it has been unloaded.
167   */
168  public void finalizePlugin()
169  {
170    // No implementation is required by default.
171  }
172
173
174
175  /**
176   * Retrieves the DN of the configuration entry for this plugin.
177   *
178   * @return  The DN of the configuration entry for this plugin.
179   */
180  public final DN getPluginEntryDN()
181  {
182    return pluginDN;
183  }
184
185
186
187  /**
188   * Retrieves the plugin types for which this plugin is registered.
189   * This set must not be modified.
190   *
191   * @return  The plugin types for which this plugin is registered.
192   */
193  public final Set<PluginType> getPluginTypes()
194  {
195    return pluginTypes;
196  }
197
198
199
200  /**
201   * Indicates whether this plugin should be invoked for internal
202   * operations.
203   *
204   * @return  {@code true} if this plugin should be invoked for
205   *          internal operations, or {@code false} if not.
206   */
207  public final boolean invokeForInternalOperations()
208  {
209    return invokeForInternalOps;
210  }
211
212
213
214  /**
215   * Specifies whether this plugin should be invoked for internal
216   * operations.
217   *
218   * @param  invokeForInternalOps  Indicates whether this plugin
219   *                               should be invoked for internal
220   *                               operations.
221   */
222  @org.opends.server.types.PublicAPI(
223       stability=org.opends.server.types.StabilityLevel.PRIVATE,
224       mayInstantiate=false,
225       mayExtend=false,
226       mayInvoke=false)
227  public final void setInvokeForInternalOperations(
228                         boolean invokeForInternalOps)
229  {
230    this.invokeForInternalOps = invokeForInternalOps;
231  }
232
233
234
235  /**
236   * Performs any processing that should be done when the Directory
237   * Server is in the process of starting.  This method will be called
238   * after virtually all other initialization has been performed but
239   * before the connection handlers are started.
240   *
241   * @return  The result of the startup plugin processing.
242   */
243  public PluginResult.Startup doStartup()
244  {
245    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
246        pluginDN, PluginType.STARTUP.getName()).toString());
247  }
248
249
250
251  /**
252   * Performs any processing that should be done when the Directory
253   * Server is in the process of performing a graceful shutdown.  This
254   * method will be called early in the shutdown process after the
255   * connection handlers are stopped but before other finalization is
256   * performed.
257   *
258   * @param  reason  The human-readable reason for the shutdown.
259   */
260  public void doShutdown(LocalizableMessage reason)
261  {
262    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
263        pluginDN, PluginType.SHUTDOWN.getName()).toString());
264  }
265
266
267
268  /**
269   * Performs any processing that should be done when the Directory
270   * Server accepts a new connection from a client.  This method will
271   * be called after additional verification is performed to ensure
272   * that the connection should be accepted.
273   *
274   * @param  clientConnection  The client connection that has been
275   *                           accepted.
276   *
277   * @return  The result of the plugin processing.
278   */
279  public PluginResult.PostConnect doPostConnect(ClientConnection
280                                                    clientConnection)
281  {
282    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
283        pluginDN, PluginType.POST_CONNECT.getName()).toString());
284  }
285
286
287
288  /**
289   * Performs any processing that should be done whenever a client
290   * connection is closed (regardless of whether the closure is
291   * initiated by the client or the server).
292   *
293   * @param  clientConnection  The client connection that has been
294   *                           closed.
295   * @param  disconnectReason  The disconnect reason for the closure.
296   * @param  message           A message providing additional
297   *                           information about the closure, or
298   *                           {@code null} if there is none.
299   *
300   * @return  The result of the plugin processing.
301   */
302  public PluginResult.PostDisconnect
303              doPostDisconnect(ClientConnection clientConnection,
304                               DisconnectReason disconnectReason,
305                               LocalizableMessage message)
306  {
307    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
308        pluginDN, PluginType.POST_DISCONNECT.getName()).toString());
309  }
310
311
312  /**
313   * Performs any necessary processing that should be done during an
314   * LDIF import operation immediately after reading an entry and
315   * confirming that it should be imported based on the provided
316   * configuration.
317   *
318   * @param  importConfig  The configuration used for the LDIF import.
319   * @param  entry         The entry that has been read to the LDIF
320   *                       file.
321   *
322   * @return  The result of the plugin processing.
323   */
324  public PluginResult.ImportLDIF
325    doLDIFImport(LDIFImportConfig importConfig, Entry entry)
326  {
327    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
328        pluginDN, PluginType.LDIF_IMPORT.getName()).toString());
329  }
330
331  /**
332   * Terminates an import session.
333   * Performs any necessary processing that should be done at the end
334   * of an LDIF import session based on the provided configuration.
335   *
336   * @param  importConfig  The configuration used for the LDIF import.
337   */
338  public void doLDIFImportEnd(LDIFImportConfig importConfig)
339  {
340    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
341        pluginDN, PluginType.LDIF_IMPORT_END.getName()).toString());
342  }
343
344  /**
345   * Starts an import session.
346   * Performs any necessary processing that should be done at the
347   * beginning of an LDIF import session based on the provided
348   * configuration.
349   *
350   * @param  importConfig  The configuration used for the LDIF import.
351   */
352  public void doLDIFImportBegin(LDIFImportConfig importConfig)
353  {
354    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
355        pluginDN, PluginType.LDIF_IMPORT_BEGIN.getName()).toString());
356  }
357
358  /**
359   * Performs any necessary processing that should be done during an
360   * LDIF export operation immediately after determining that the
361   * provided entry should be included in the export.
362   *
363   * @param  exportConfig  The configuration used for the LDIF export.
364   * @param  entry         The entry to be written to the LDIF file.
365   *
366   * @return  The result of the plugin processing.
367   */
368  public PluginResult.ImportLDIF
369    doLDIFExport(LDIFExportConfig exportConfig, Entry entry)
370  {
371    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
372        pluginDN, PluginType.LDIF_EXPORT.getName()).toString());
373  }
374
375
376
377  /**
378   * Performs any necessary processing that should be done before the
379   * Directory Server parses the elements of an abandon request.
380   *
381   * @param  abandonOperation  The abandon operation that has been
382   *                           requested.
383   *
384   * @return  Information about the result of the plugin processing.
385   */
386  public PluginResult.PreParse
387       doPreParse(PreParseAbandonOperation abandonOperation)
388  {
389    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
390        pluginDN, PluginType.PRE_PARSE_ABANDON.getName()).toString());
391  }
392
393
394
395  /**
396   * Performs any necessary processing that should be done after the
397   * Directory Server has completed processing for an abandon
398   * operation.
399   *
400   * @param  abandonOperation  The abandon operation for which
401   *                           processing has completed.
402   *
403   * @return  Information about the result of the plugin processing.
404   */
405  public PluginResult.PostOperation
406       doPostOperation(PostOperationAbandonOperation abandonOperation)
407  {
408    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
409        pluginDN, PluginType.POST_OPERATION_ABANDON.getName()).toString());
410  }
411
412
413
414  /**
415   * Performs any necessary processing that should be done before the
416   * Directory Server parses the elements of an add request.
417   *
418   * @param  addOperation  The add operation that has been requested.
419   *
420   * @return  Information about the result of the plugin processing.
421   *
422   * @throws CanceledOperationException if this operation should
423   * be cancelled.
424   */
425  public PluginResult.PreParse
426       doPreParse(PreParseAddOperation addOperation)
427       throws CanceledOperationException {
428    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
429        pluginDN, PluginType.PRE_PARSE_ADD.getName()).toString());
430  }
431
432
433
434  /**
435   * Performs any necessary processing that should be done just before
436   * the Directory Server performs the core processing for an add
437   * operation.
438   * This method is not called when processing synchronization
439   * operations.
440   *
441   * @param  addOperation  The add operation to be processed.
442   *
443   * @return  Information about the result of the plugin processing.
444   *
445   * @throws CanceledOperationException if this operation should
446   * be cancelled.
447   */
448  public PluginResult.PreOperation
449       doPreOperation(PreOperationAddOperation addOperation)
450      throws CanceledOperationException {
451    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
452        pluginDN, PluginType.PRE_OPERATION_ADD.getName()).toString());
453  }
454
455
456
457  /**
458   * Performs any necessary processing that should be done after the
459   * Directory Server has completed the core processing for an add
460   * operation but before the response has been sent to the client.
461   *
462   * @param  addOperation  The add operation for which processing has
463   *                       completed but no response has yet been
464   *                       sent.
465   *
466   * @return  Information about the result of the plugin processing.
467   */
468  public PluginResult.PostOperation
469       doPostOperation(PostOperationAddOperation addOperation)
470  {
471    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
472        pluginDN, PluginType.POST_OPERATION_ADD.getName()).toString());
473  }
474
475
476
477  /**
478   * Performs any necessary processing that should be done after the
479   * Directory Server has completed all processing for an add
480   * operation and has sent the response to the client.
481   *
482   * @param  addOperation  The add operation for which processing has
483   *                       completed and the response has been sent to
484   *                       the client.
485   *
486   * @return  Information about the result of the plugin processing.
487   */
488  public PluginResult.PostResponse
489       doPostResponse(PostResponseAddOperation addOperation)
490  {
491    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
492        pluginDN, PluginType.POST_RESPONSE_ADD.getName()).toString());
493  }
494
495
496
497  /**
498   * Performs any necessary processing that should be done after the
499   * Directory Server has completed processing for an add operation
500   * performed via synchronization.
501   *
502   * @param  addOperation  The synchronized add operation for which
503   *                       processing has been completed.
504   */
505  public void doPostSynchronization(
506                   PostSynchronizationAddOperation addOperation)
507  {
508    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
509        pluginDN, PluginType.POST_SYNCHRONIZATION_ADD.getName()).toString());
510  }
511
512
513
514  /**
515   * Performs any necessary processing that should be done before the
516   * Directory Server parses the elements of a bind request.
517   *
518   * @param  bindOperation  The bind operation that has been
519   *                        requested.
520   *
521   * @return  Information about the result of the plugin processing.
522   */
523  public PluginResult.PreParse
524       doPreParse(PreParseBindOperation bindOperation)
525  {
526    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
527        pluginDN, PluginType.PRE_PARSE_BIND.getName()).toString());
528  }
529
530
531
532  /**
533   * Performs any necessary processing that should be done just before
534   * the Directory Server performs the core processing for a bind
535   * operation.
536   *
537   * @param  bindOperation  The bind operation to be processed.
538   *
539   * @return  Information about the result of the plugin processing.
540   */
541  public PluginResult.PreOperation
542       doPreOperation(PreOperationBindOperation bindOperation)
543  {
544    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
545        pluginDN, PluginType.PRE_OPERATION_BIND.getName()).toString());
546  }
547
548
549
550  /**
551   * Performs any necessary processing that should be done after the
552   * Directory Server has completed the core processing for a bind
553   * operation but before the response has been sent to the client.
554   *
555   * @param  bindOperation  The bind operation for which processing
556   *                        has completed but no response has yet been
557   *                        sent.
558   *
559   * @return  Information about the result of the plugin processing.
560   */
561  public PluginResult.PostOperation
562       doPostOperation(PostOperationBindOperation bindOperation)
563  {
564    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
565        pluginDN, PluginType.POST_OPERATION_BIND.getName()).toString());
566  }
567
568
569
570  /**
571   * Performs any necessary processing that should be done after the
572   * Directory Server has completed all processing for a bind
573   * operation and has sent the response to the client.
574   *
575   * @param  bindOperation  The bind operation for which processing
576   *                        has completed and the response has been
577   *                        sent to the client.
578   *
579   * @return  Information about the result of the plugin processing.
580   */
581  public PluginResult.PostResponse
582       doPostResponse(PostResponseBindOperation bindOperation)
583  {
584    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
585        pluginDN, PluginType.POST_RESPONSE_BIND.getName()).toString());
586  }
587
588
589
590  /**
591   * Performs any necessary processing that should be done before the
592   * Directory Server parses the elements of a compare request.
593   *
594   * @param  compareOperation  The compare operation that has been
595   *                           requested.
596   *
597   * @return  Information about the result of the plugin processing.
598   *
599   * @throws CanceledOperationException if this operation should
600   * be cancelled.
601   */
602  public PluginResult.PreParse
603       doPreParse(PreParseCompareOperation compareOperation)
604       throws CanceledOperationException {
605    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
606        pluginDN, PluginType.PRE_PARSE_COMPARE.getName()).toString());
607  }
608
609
610
611  /**
612   * Performs any necessary processing that should be done just before
613   * the Directory Server performs the core processing for a compare
614   * operation.
615   *
616   * @param  compareOperation  The compare operation to be processed.
617   *
618   * @return  Information about the result of the plugin processing.
619   *
620   * @throws CanceledOperationException if this operation should
621   * be cancelled.
622   */
623  public PluginResult.PreOperation
624       doPreOperation(PreOperationCompareOperation compareOperation)
625      throws CanceledOperationException {
626    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
627        pluginDN, PluginType.PRE_OPERATION_COMPARE.getName()).toString());
628  }
629
630
631
632  /**
633   * Performs any necessary processing that should be done after the
634   * Directory Server has completed the core processing for a compare
635   * operation but before the response has been sent to the client.
636   *
637   * @param  compareOperation  The compare operation for which
638   *                           processing has completed but no
639   *                           response has yet been sent.
640   *
641   * @return  Information about the result of the plugin processing.
642   */
643  public PluginResult.PostOperation
644       doPostOperation(PostOperationCompareOperation compareOperation)
645  {
646    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
647        pluginDN, PluginType.POST_OPERATION_COMPARE.getName()).toString());
648  }
649
650
651
652  /**
653   * Performs any necessary processing that should be done after the
654   * Directory Server has completed all processing for a compare
655   * operation and has sent the response to the client.
656   *
657   * @param  compareOperation  The compare operation for which
658   *                           processing has completed and the
659   *                           response has been sent to the client.
660   *
661   * @return  Information about the result of the plugin processing.
662   */
663  public PluginResult.PostResponse
664       doPostResponse(PostResponseCompareOperation compareOperation)
665  {
666    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
667        pluginDN, PluginType.POST_RESPONSE_COMPARE.getName()).toString());
668  }
669
670
671
672  /**
673   * Performs any necessary processing that should be done before the
674   * Directory Server parses the elements of a delete request.
675   *
676   * @param  deleteOperation  The delete operation that has been
677   *                          requested.
678   *
679   * @return  Information about the result of the plugin processing.
680   *
681   * @throws CanceledOperationException if this operation should
682   * be cancelled.
683   */
684  public PluginResult.PreParse
685       doPreParse(PreParseDeleteOperation deleteOperation)
686       throws CanceledOperationException {
687    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
688        pluginDN, PluginType.PRE_PARSE_DELETE.getName()).toString());
689  }
690
691
692
693  /**
694   * Performs any necessary processing that should be done just before
695   * the Directory Server performs the core processing for a delete
696   * operation.
697   * This method is not called when processing synchronization
698   * operations.
699   *
700   * @param  deleteOperation  The delete operation to be processed.
701   *
702   * @return  Information about the result of the plugin processing.
703   *
704   * @throws CanceledOperationException if this operation should
705   * be cancelled.
706   */
707  public PluginResult.PreOperation
708       doPreOperation(PreOperationDeleteOperation deleteOperation)
709      throws CanceledOperationException {
710    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
711        pluginDN, PluginType.PRE_OPERATION_DELETE.getName()).toString());
712  }
713
714
715
716  /**
717   * Performs any necessary processing that should be done after the
718   * Directory Server has completed the core processing for a delete
719   * operation but before the response has been sent to the client.
720   *
721   * @param  deleteOperation  The delete operation for which
722   *                          processing has completed but no
723   *                          response has yet been sent.
724   *
725   * @return  Information about the result of the plugin processing.
726   */
727  public PluginResult.PostOperation
728       doPostOperation(PostOperationDeleteOperation deleteOperation)
729  {
730    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
731        pluginDN, PluginType.POST_OPERATION_DELETE.getName()).toString());
732  }
733
734
735
736  /**
737   * Performs any necessary processing that should be done after the
738   * Directory Server has completed all processing for a delete
739   * operation and has sent the response to the client.
740   *
741   * @param  deleteOperation  The delete operation for which
742   *                          processing has completed and the
743   *                          response has been sent to the client.
744   *
745   * @return  Information about the result of the plugin processing.
746   */
747  public PluginResult.PostResponse
748       doPostResponse(PostResponseDeleteOperation deleteOperation)
749  {
750    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
751        pluginDN, PluginType.POST_RESPONSE_DELETE.getName()).toString());
752  }
753
754
755
756  /**
757   * Performs any necessary processing that should be done after the
758   * Directory Server has completed processing for a delete operation
759   * performed via synchronization.
760   *
761   * @param  deleteOperation  The synchronized delete operation for
762   *                          which processing has been completed.
763   */
764  public void doPostSynchronization(
765                   PostSynchronizationDeleteOperation deleteOperation)
766  {
767    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
768        pluginDN, PluginType.POST_SYNCHRONIZATION_DELETE.getName()).toString());
769  }
770
771
772
773  /**
774   * Performs any necessary processing that should be done before the
775   * Directory Server parses the elements of an extended request.
776   *
777   * @param  extendedOperation  The extended operation that has been
778   *                            requested.
779   *
780   * @return  Information about the result of the plugin processing.
781   *
782   * @throws CanceledOperationException if this operation should
783   * be cancelled.
784   */
785  public PluginResult.PreParse
786       doPreParse(PreParseExtendedOperation extendedOperation)
787       throws CanceledOperationException {
788    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
789        pluginDN, PluginType.PRE_PARSE_EXTENDED.getName()).toString());
790  }
791
792
793
794  /**
795   * Performs any necessary processing that should be done just before
796   * the Directory Server performs the core processing for an extended
797   * operation.
798   *
799   * @param  extendedOperation  The extended operation to be
800   *                            processed.
801   *
802   * @return  Information about the result of the plugin processing.
803   *
804   * @throws CanceledOperationException if this operation should
805   * be cancelled.
806   */
807  public PluginResult.PreOperation
808       doPreOperation(PreOperationExtendedOperation extendedOperation)
809      throws CanceledOperationException {
810    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
811        pluginDN, PluginType.PRE_OPERATION_EXTENDED.getName()).toString());
812  }
813
814
815
816  /**
817   * Performs any necessary processing that should be done after the
818   * Directory Server has completed the core processing for an
819   * extended operation but before the response has been sent to the
820   * client.
821   *
822   * @param  extendedOperation  The extended operation for which
823   *                            processing has completed but no
824   *                            response has yet been sent.
825   *
826   * @return  Information about the result of the plugin processing.
827   */
828  public PluginResult.PostOperation
829       doPostOperation(PostOperationExtendedOperation
830                            extendedOperation)
831  {
832    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
833        pluginDN, PluginType.POST_OPERATION_EXTENDED.getName()).toString());
834  }
835
836
837
838  /**
839   * Performs any necessary processing that should be done after the
840   * Directory Server has completed all processing for an extended
841   * operation and has sent the response to the client.
842   *
843   * @param  extendedOperation  The extended operation for which
844   *                            processing has completed and the
845   *                            response has been sent to the client.
846   *
847   * @return  Information about the result of the plugin processing.
848   */
849  public PluginResult.PostResponse
850       doPostResponse(PostResponseExtendedOperation extendedOperation)
851  {
852    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
853        pluginDN, PluginType.POST_RESPONSE_EXTENDED.getName()).toString());
854  }
855
856
857
858  /**
859   * Performs any necessary processing that should be done before the
860   * Directory Server parses the elements of a modify request.
861   *
862   * @param  modifyOperation  The modify operation that has been
863   *                          requested.
864   *
865   * @return  Information about the result of the plugin processing.
866   *
867   * @throws CanceledOperationException if this operation should
868   * be cancelled.
869   */
870  public PluginResult.PreParse
871       doPreParse(PreParseModifyOperation modifyOperation)
872       throws CanceledOperationException {
873    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
874        pluginDN, PluginType.PRE_PARSE_MODIFY.getName()).toString());
875  }
876
877
878
879  /**
880   * Performs any necessary processing that should be done just before
881   * the Directory Server performs the core processing for a modify
882   * operation.
883   *
884   * This method is not called when processing synchronization
885   * operations.
886   * @param  modifyOperation  The modify operation to be processed.
887   *
888   * @return  Information about the result of the plugin processing.
889   *
890   * @throws CanceledOperationException if this operation should
891   * be cancelled.
892   */
893  public PluginResult.PreOperation
894       doPreOperation(PreOperationModifyOperation modifyOperation)
895      throws CanceledOperationException {
896    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
897        pluginDN, PluginType.PRE_OPERATION_MODIFY.getName()).toString());
898  }
899
900
901
902  /**
903   * Performs any necessary processing that should be done after the
904   * Directory Server has completed the core processing for a modify
905   * operation but before the response has been sent to the client.
906   *
907   * @param  modifyOperation  The modify operation for which
908   *                          processing has completed but no response
909   *                          has yet been sent.
910   *
911   * @return  Information about the result of the plugin processing.
912   */
913  public PluginResult.PostOperation
914       doPostOperation(PostOperationModifyOperation modifyOperation)
915  {
916    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
917        pluginDN, PluginType.POST_OPERATION_MODIFY.getName()).toString());
918  }
919
920
921
922  /**
923   * Performs any necessary processing that should be done after the
924   * Directory Server has completed all processing for a modify
925   * operation and has sent the response to the client.
926   *
927   * @param  modifyOperation  The modify operation for which
928   *                          processing has completed and the
929   *                          response has been sent to the client.
930   *
931   * @return  Information about the result of the plugin processing.
932   */
933  public PluginResult.PostResponse
934       doPostResponse(PostResponseModifyOperation modifyOperation)
935  {
936    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
937        pluginDN, PluginType.POST_RESPONSE_MODIFY.getName()).toString());
938  }
939
940
941
942  /**
943   * Performs any necessary processing that should be done after the
944   * Directory Server has completed processing for a modify operation
945   * performed via synchronization.
946   *
947   * @param  modifyOperation  The synchronized modify operation for
948   *                          which processing has been completed.
949   */
950  public void doPostSynchronization(
951                   PostSynchronizationModifyOperation modifyOperation)
952  {
953    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
954        pluginDN, PluginType.POST_SYNCHRONIZATION_MODIFY.getName()).toString());
955  }
956
957
958
959  /**
960   * Performs any necessary processing that should be done before the
961   * Directory Server parses the elements of a modify DN request.
962   *
963   * @param  modifyDNOperation  The modify DN operation that has been
964   *                            requested.
965   *
966   * @return  Information about the result of the plugin processing.
967   *
968   * @throws CanceledOperationException if this operation should
969   * be cancelled.
970   */
971  public PluginResult.PreParse
972       doPreParse(PreParseModifyDNOperation modifyDNOperation)
973       throws CanceledOperationException {
974    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
975        pluginDN, PluginType.PRE_PARSE_MODIFY_DN.getName()).toString());
976  }
977
978
979
980  /**
981   * Performs any necessary processing that should be done just before
982   * the Directory Server performs the core processing for a modify DN
983   * operation.
984   * This method is not called when processing synchronization
985   * operations.
986   *
987   * @param  modifyDNOperation  The modify DN operation to be
988   *                            processed.
989   *
990   * @return  Information about the result of the plugin processing.
991   *
992   * @throws CanceledOperationException if this operation should
993   * be cancelled.
994   */
995  public PluginResult.PreOperation
996       doPreOperation(PreOperationModifyDNOperation modifyDNOperation)
997      throws CanceledOperationException {
998    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
999        pluginDN, PluginType.PRE_OPERATION_MODIFY_DN.getName()).toString());
1000  }
1001
1002
1003
1004  /**
1005   * Performs any necessary processing that should be done whenever a
1006   * subordinate entry is moved or renamed as part of a modify DN
1007   * operation.  Note that if the entry is to be changed in any way,
1008   * the new entry should be directly modified, and the changes made
1009   * should also be added to the provided list of modifications.
1010   * <BR><BR>
1011   * NOTE:  At the present time, OpenDS does not provide support for
1012   * altering entries subordinate to the target of a modify DN
1013   * operation.  While this may be available in the future, current
1014   * plugins should not attempt to alter the new or old entries in any
1015   * way, nor should they attempt to add any modifications to the
1016   * provided list.
1017   *
1018   * @param  modifyDNOperation  The modify DN operation with which the
1019   *                            subordinate entry is associated.
1020   * @param  oldEntry           The subordinate entry prior to the
1021   *                            move/rename operation.
1022   * @param  newEntry           The subordinate enry after the
1023   *                            move/rename operation.
1024   * @param  modifications      A list into which any modifications
1025   *                            made to the target entry should be
1026   *                            placed.
1027   *
1028   * @return  Information about the result of the plugin processing.
1029   */
1030  public PluginResult.SubordinateModifyDN
1031       processSubordinateModifyDN(SubordinateModifyDNOperation
1032                                       modifyDNOperation,
1033                                  Entry oldEntry, Entry newEntry,
1034                                  List<Modification> modifications)
1035  {
1036    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1037        pluginDN, PluginType.SUBORDINATE_MODIFY_DN.getName()).toString());
1038  }
1039
1040
1041
1042  /**
1043   * Performs any necessary processing that should be done whenever a
1044   * subordinate entry is deleted as part of subtree delete operation.
1045   *
1046   * @param  deleteOperation  The delete operation with which the
1047   *                          subordinate entry is associated.
1048   * @param  entry            The subordinate entry being deleted.
1049   *
1050   * @return Information about the result of the plugin processing.
1051   */
1052  public PluginResult.SubordinateDelete
1053       processSubordinateDelete(DeleteOperation
1054         deleteOperation, Entry entry)
1055  {
1056    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1057        pluginDN, PluginType.SUBORDINATE_MODIFY_DN.getName()).toString());
1058  }
1059
1060
1061
1062  /**
1063   * Performs any necessary processing that should be done after the
1064   * Directory Server has completed the core processing for a modify
1065   * DN operation but before the response has been sent to the client.
1066   *
1067   * @param  modifyDNOperation  The modify DN operation for which
1068   *                            processing has completed but no
1069   *                            response has yet been sent.
1070   *
1071   * @return  Information about the result of the plugin processing.
1072   */
1073  public PluginResult.PostOperation
1074       doPostOperation(PostOperationModifyDNOperation
1075                            modifyDNOperation)
1076  {
1077    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1078        pluginDN, PluginType.POST_OPERATION_MODIFY_DN.getName()).toString());
1079  }
1080
1081
1082
1083  /**
1084   * Performs any necessary processing that should be done after the
1085   * Directory Server has completed all processing for a modify DN
1086   * operation and has sent the response to the client.
1087   *
1088   * @param  modifyDNOperation  The modifyDN operation for which
1089   *                            processing has completed and the
1090   *                            response has been sent to the client.
1091   *
1092   * @return  Information about the result of the plugin processing.
1093   */
1094  public PluginResult.PostResponse
1095       doPostResponse(PostResponseModifyDNOperation modifyDNOperation)
1096  {
1097    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1098        pluginDN, PluginType.POST_RESPONSE_MODIFY_DN.getName()).toString());
1099  }
1100
1101
1102
1103  /**
1104   * Performs any necessary processing that should be done after the
1105   * Directory Server has completed processing for a modify DN
1106   * operation performed via synchronization.
1107   *
1108   * @param  modifyDNOperation  The synchronized modify DN operation
1109   *                            for which processing has been
1110   *                            completed.
1111   */
1112  public void doPostSynchronization(
1113              PostSynchronizationModifyDNOperation modifyDNOperation)
1114  {
1115    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1116        pluginDN, PluginType.POST_SYNCHRONIZATION_MODIFY_DN.getName()).toString());
1117  }
1118
1119
1120
1121  /**
1122   * Performs any necessary processing that should be done before the
1123   * Directory Server parses the elements of a search request.
1124   *
1125   * @param  searchOperation  The search operation that has been
1126   *                          requested.
1127   *
1128   * @return  Information about the result of the plugin processing.
1129   *
1130   * @throws CanceledOperationException if this operation should
1131   * be cancelled.
1132   */
1133  public PluginResult.PreParse
1134       doPreParse(PreParseSearchOperation searchOperation)
1135       throws CanceledOperationException {
1136    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1137        pluginDN, PluginType.PRE_PARSE_SEARCH.getName()).toString());
1138  }
1139
1140
1141
1142  /**
1143   * Performs any necessary processing that should be done just before
1144   * the Directory Server performs the core processing for a search
1145   * operation.
1146   *
1147   * @param  searchOperation  The search operation to be processed.
1148   *
1149   * @return  Information about the result of the plugin processing.
1150   *
1151   * @throws CanceledOperationException if this operation should
1152   * be cancelled.
1153   */
1154  public PluginResult.PreOperation
1155       doPreOperation(PreOperationSearchOperation searchOperation)
1156      throws CanceledOperationException {
1157    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1158        pluginDN, PluginType.PRE_OPERATION_SEARCH.getName()).toString());
1159  }
1160
1161
1162
1163  /**
1164   * Performs any necessary processing that should be done before a
1165   * search result entry is sent to a client.  This will be called
1166   * after it has been verified that the entry does actually match the
1167   * search criteria and after access control has been enforced to
1168   * ensure that the entry should be sent and/or to strip out
1169   * attributes/values that the user should not see.
1170   *
1171   * @param  searchOperation  The search operation with which the
1172   *                          search entry is associated.
1173   * @param  searchEntry      The search result entry that is to be
1174   *                          sent to the client.  Its contents may be
1175   *                          altered by the plugin if necessary.
1176   *
1177   * @return  Information about the result of the plugin processing.
1178   */
1179  public PluginResult.IntermediateResponse
1180       processSearchEntry(SearchEntrySearchOperation searchOperation,
1181                          SearchResultEntry searchEntry)
1182  {
1183    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1184        pluginDN, PluginType.SEARCH_RESULT_ENTRY.getName()).toString());
1185  }
1186
1187
1188
1189  /**
1190   * Performs any necessary processing that should be done before a
1191   * search result reference is sent to a client.
1192   *
1193   * @param  searchOperation  The search operation with which the
1194   *                          search result reference is associated.
1195   * @param  searchReference  The search result reference that is to
1196   *                          be sent to the client.  Its contents may
1197   *                          be altered by the plugin if necessary.
1198   *
1199   * @return  Information about the result of the plugin processing.
1200   */
1201  public PluginResult.IntermediateResponse
1202       processSearchReference(SearchReferenceSearchOperation
1203                                   searchOperation,
1204                              SearchResultReference searchReference)
1205  {
1206    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1207        pluginDN, PluginType.SEARCH_RESULT_REFERENCE.getName()).toString());
1208  }
1209
1210
1211
1212  /**
1213   * Performs any necessary processing that should be done after the
1214   * Directory Server has completed the core processing for a search
1215   * operation but before the response has been sent to the client.
1216   *
1217   * @param  searchOperation  The search operation for which
1218   *                          processing has completed but no response
1219   *                          has yet been sent.
1220   *
1221   * @return  Information about the result of the plugin processing.
1222   */
1223  public PluginResult.PostOperation
1224       doPostOperation(PostOperationSearchOperation searchOperation)
1225  {
1226    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1227        pluginDN, PluginType.POST_OPERATION_SEARCH.getName()).toString());
1228  }
1229
1230
1231
1232  /**
1233   * Performs any necessary processing that should be done after the
1234   * Directory Server has completed all processing for a search
1235   * operation and has sent the response to the client.
1236   *
1237   * @param  searchOperation  The search operation for which
1238   *                          processing has completed and the
1239   *                          response has been sent to the client.
1240   *
1241   * @return  Information about the result of the plugin processing.
1242   */
1243  public PluginResult.PostResponse
1244       doPostResponse(PostResponseSearchOperation searchOperation)
1245  {
1246    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1247        pluginDN, PluginType.POST_RESPONSE_SEARCH.getName()).toString());
1248  }
1249
1250
1251
1252  /**
1253   * Performs any necessary processing that should be done before the
1254   * Directory Server parses the elements of an unbind request.
1255   *
1256   * @param  unbindOperation  The unbind operation that has been
1257   *                          requested.
1258   *
1259   * @return  Information about the result of the plugin processing.
1260   */
1261  public PluginResult.PreParse
1262       doPreParse(PreParseUnbindOperation unbindOperation)
1263  {
1264    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1265        pluginDN, PluginType.PRE_PARSE_UNBIND.getName()).toString());
1266  }
1267
1268
1269
1270  /**
1271   * Performs any necessary processing that should be done after the
1272   * Directory Server has completed processing for an unbind
1273   * operation.
1274   *
1275   * @param  unbindOperation  The unbind operation for which
1276   *                          processing has completed.
1277   *
1278   * @return  Information about the result of the plugin processing.
1279   */
1280  public PluginResult.PostOperation
1281       doPostOperation(PostOperationUnbindOperation unbindOperation)
1282  {
1283    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1284        pluginDN, PluginType.POST_OPERATION_UNBIND.getName()).toString());
1285  }
1286
1287
1288
1289  /**
1290   * Performs any necessary processing that should be done before an
1291   * intermediate response message is sent to a client.
1292   *
1293   * @param  intermediateResponse  The intermediate response to be
1294   *                               sent to the client.
1295   *
1296   * @return  Information about the result of the plugin processing.
1297   */
1298  public PluginResult.IntermediateResponse
1299              processIntermediateResponse(
1300                   IntermediateResponse intermediateResponse)
1301  {
1302    throw new UnsupportedOperationException(ERR_PLUGIN_TYPE_NOT_SUPPORTED.get(
1303        pluginDN, PluginType.INTERMEDIATE_RESPONSE.getName()).toString());
1304  }
1305}
1306