Class ReferentialIntegrityPlugin

All Implemented Interfaces:
ConfigurationChangeListener<ReferentialIntegrityPluginCfg>, ServerShutdownListener

This class implements a Directory Server post operation plugin that performs Referential Integrity processing on successful delete and modify DN operations. The plugin uses a set of configuration criteria to determine what attribute types to check referential integrity on, and, the set of base DNs to search for entries that might need referential integrity processing. If none of these base DNs are specified in the configuration, then the public naming contexts are used as the base DNs by default.

The plugin also has an option to process changes in background using a thread that wakes up periodically looking for change records in a log file.
  • Field Details

    • MODIFYDN_DNS

      public static final String MODIFYDN_DNS
      Used to save a map in the modifyDN operation attachment map that holds the old entry DNs and the new entry DNs related to a modify DN rename to new superior operation.
      See Also:
    • DELETE_DNS

      public static final String DELETE_DNS
      Used to save a set in the delete operation attachment map that holds the subordinate entry DNs related to a delete operation.
      See Also:
  • Constructor Details

    • ReferentialIntegrityPlugin

      public ReferentialIntegrityPlugin()
  • Method Details

    • initializePlugin

      public void initializePlugin(Set<PluginType> pluginTypes, ReferentialIntegrityPluginCfg pluginCfg) throws ConfigException
      Description copied from class: DirectoryServerPlugin
      Performs any initialization necessary for this plugin. This will be called as soon as the plugin has been loaded and before it is registered with the server.
      Specified by:
      initializePlugin in class DirectoryServerPlugin<ReferentialIntegrityPluginCfg>
      Parameters:
      pluginTypes - The set of plugin types that indicate the ways in which this plugin will be invoked.
      pluginCfg - The configuration for this plugin.
      Throws:
      ConfigException - If the provided entry does not contain a valid configuration for this plugin.
    • applyConfigurationChange

      public ConfigChangeResult applyConfigurationChange(ReferentialIntegrityPluginCfg newConfiguration)
      Description copied from interface: ConfigurationChangeListener
      Applies the configuration changes to this change listener.
      Specified by:
      applyConfigurationChange in interface ConfigurationChangeListener<ReferentialIntegrityPluginCfg>
      Parameters:
      newConfiguration - The new configuration containing the changes.
      Returns:
      Returns information about the result of changing the configuration.
    • isConfigurationAcceptable

      public boolean isConfigurationAcceptable(ReferentialIntegrityPluginCfg pluginCfg, List<LocalizableMessage> unacceptableReasons)
      Description copied from class: DirectoryServerPlugin
      Indicates whether the provided configuration is acceptable for this plugin. It should be possible to call this method on an uninitialized plugin instance in order to determine whether the plugin would be able to use the provided configuration.
      Overrides:
      isConfigurationAcceptable in class DirectoryServerPlugin<ReferentialIntegrityPluginCfg>
      Parameters:
      pluginCfg - The plugin configuration for which to make the determination.
      unacceptableReasons - A list that may be used to hold the reasons that the provided configuration is not acceptable.
      Returns:
      true if the provided configuration is acceptable for this plugin, or false if not.
    • isConfigurationChangeAcceptable

      public boolean isConfigurationChangeAcceptable(ReferentialIntegrityPluginCfg configuration, List<LocalizableMessage> unacceptableReasons)
      Description copied from interface: ConfigurationChangeListener
      Indicates whether the proposed change to the configuration is acceptable to this change listener.
      Specified by:
      isConfigurationChangeAcceptable in interface ConfigurationChangeListener<ReferentialIntegrityPluginCfg>
      Parameters:
      configuration - The new configuration containing the changes.
      unacceptableReasons - A list that can be used to hold messages about why the provided configuration is not acceptable.
      Returns:
      Returns true if the proposed change is acceptable, or false if it is not.
    • doPostOperation

      public void doPostOperation(PostOperationModifyDNOperation modifyDNOperation)
      Description copied from class: DirectoryServerPlugin
      Performs any necessary processing that should be done after the Directory Server has completed the core processing for a modify DN operation but before the response has been sent to the client.
      Overrides:
      doPostOperation in class DirectoryServerPlugin<ReferentialIntegrityPluginCfg>
      Parameters:
      modifyDNOperation - The modify DN operation for which processing has completed but no response has yet been sent.
    • doPostOperation

      public void doPostOperation(PostOperationDeleteOperation deleteOperation)
      Description copied from class: DirectoryServerPlugin
      Performs any necessary processing that should be done after the Directory Server has completed the core processing for a delete operation but before the response has been sent to the client.
      Overrides:
      doPostOperation in class DirectoryServerPlugin<ReferentialIntegrityPluginCfg>
      Parameters:
      deleteOperation - The delete operation for which processing has completed but no response has yet been sent.
    • processSubordinateModifyDN

      public void processSubordinateModifyDN(SubordinateModifyDNOperation modifyDNOperation, Dn oldEntryDn, Dn newEntryDn)
      Description copied from class: DirectoryServerPlugin
      Performs any necessary processing that should be done whenever a subordinate entry is moved or renamed as part of a modify DN operation. Note that if the entry is to be changed in any way, the new entry should be directly modified, and the changes made should also be added to the provided list of modifications.

      NOTE: At the present time, OpenDS does not provide support for altering entries subordinate to the target of a modify DN operation. While this may be available in the future, current plugins should not attempt to alter the new or old entries in any way, nor should they attempt to add any modifications to the provided list.
      Overrides:
      processSubordinateModifyDN in class DirectoryServerPlugin<ReferentialIntegrityPluginCfg>
      Parameters:
      modifyDNOperation - The modify DN operation with which the subordinate entry is associated.
      oldEntryDn - The name of the subordinate entry prior to the move/rename operation.
      newEntryDn - The name of the subordinate entry after the move/rename operation.
    • processSubordinateDelete

      public void processSubordinateDelete(DeleteOperation deleteOperation, Dn entryDn, boolean isCommitted)
      Description copied from class: DirectoryServerPlugin
      Performs any necessary processing that should be done whenever a subordinate entry is deleted as part of subtree delete operation.
      Overrides:
      processSubordinateDelete in class DirectoryServerPlugin<ReferentialIntegrityPluginCfg>
      Parameters:
      deleteOperation - The delete operation with which the subordinate entry is associated.
      entryDn - The name of the subordinate entry being deleted.
      isCommitted - true when a subtree delete cannot be done in a single isolated transaction. Each subordinate has already been deleted at the time this method is invoked. false when a subtree delete can be done in a single isolated transaction. All the subordinate entries will effectively be deleted at once during the transaction commit. At which point, the deletion become effective only at the time of the DirectoryServerPlugin.doPostOperation(PostOperationDeleteOperation) invocation.
    • finalizePlugin

      public void finalizePlugin()
      Description copied from class: DirectoryServerPlugin
      Performs any necessary finalization for this plugin. This will be called just after the plugin has been deregistered with the server but before it has been unloaded.
      Overrides:
      finalizePlugin in class DirectoryServerPlugin<ReferentialIntegrityPluginCfg>
    • processServerShutdown

      public void processServerShutdown(LocalizableMessage reason)
      Description copied from interface: ServerShutdownListener
      Indicates that the Directory Server has received a request to stop running and that this shutdown listener should take any action necessary to prepare for it.
      Specified by:
      processServerShutdown in interface ServerShutdownListener
      Parameters:
      reason - The human-readable reason for the shutdown.
    • doPreOperation

      public void doPreOperation(PreOperationModifyOperation modifyOperation) throws LdapException
      Description copied from class: DirectoryServerPlugin
      Performs any necessary processing that should be done just before the Directory Server performs the core processing for a modify operation. This method is not called when processing synchronization operations.
      Overrides:
      doPreOperation in class DirectoryServerPlugin<ReferentialIntegrityPluginCfg>
      Parameters:
      modifyOperation - The modify operation to be processed.
      Throws:
      LdapException - if this pre operation failed.
    • doPreOperation

      public void doPreOperation(PreOperationAddOperation addOperation) throws LdapException
      Description copied from class: DirectoryServerPlugin
      Performs any necessary processing that should be done just before the Directory Server performs the core processing for an add operation. This method is not called when processing synchronization operations.
      Overrides:
      doPreOperation in class DirectoryServerPlugin<ReferentialIntegrityPluginCfg>
      Parameters:
      addOperation - The add operation to be processed.
      Throws:
      LdapException - if this pre operation failed.