Package org.opends.server.plugins
Class UniqueAttributePlugin
java.lang.Object
org.opends.server.api.plugin.DirectoryServerPlugin<UniqueAttributePluginCfg>
org.opends.server.plugins.UniqueAttributePlugin
- All Implemented Interfaces:
- ConfigurationChangeListener<UniqueAttributePluginCfg>,- AlertGenerator
public final class UniqueAttributePlugin
extends DirectoryServerPlugin<UniqueAttributePluginCfg>
implements ConfigurationChangeListener<UniqueAttributePluginCfg>, AlertGenerator
This class implements a Directory Server plugin that can be used to ensure that all values for a given attribute or
 set of attributes are unique within the server (or optionally, below a specified set of base DNs). It will examine
 all add, modify, and modify DN operations to determine whether any new conflicts are introduced. If a conflict is
 detected then the operation will be rejected, unless that operation is being applied through synchronization in which
 case an alert will be generated to notify administrators of the problem.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionapplyConfigurationChange(UniqueAttributePluginCfg newConfiguration) Applies the configuration changes to this change listener.doPostOperation(PostOperationAddOperation addOperation) Performs any necessary processing that should be done after the Directory Server has completed the core processing for an add operation but before the response has been sent to the client.doPostOperation(PostOperationModifyDNOperation modifyDnOp) 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.doPostOperation(PostOperationModifyOperation modifyOperation) Performs any necessary processing that should be done after the Directory Server has completed the core processing for a modify operation but before the response has been sent to the client.voiddoPostSynchronization(PostSynchronizationAddOperation addOperation) Performs any necessary processing that should be done after the Directory Server has completed processing for an add operation performed via synchronization.voidPerforms any necessary processing that should be done after the Directory Server has completed processing for a modify DN operation performed via synchronization.voiddoPostSynchronization(PostSynchronizationModifyOperation modifyOperation) Performs any necessary processing that should be done after the Directory Server has completed processing for a modify operation performed via synchronization.doPreOperation(PreOperationAddOperation addOperation) Performs any necessary processing that should be done just before the Directory Server performs the core processing for an add operation.doPreOperation(PreOperationModifyDNOperation modifyDnOp) Performs any necessary processing that should be done just before the Directory Server performs the core processing for a modify DN operation.doPreOperation(PreOperationModifyOperation modifyOperation) Performs any necessary processing that should be done just before the Directory Server performs the core processing for a modify operation.voidPerforms any necessary finalization for this plugin.Retrieves information about the set of alerts that this generator may produce.Retrieves the DN of the configuration entry with which this alert generator is associated.voidinitializePlugin(Set<PluginType> pluginTypes, UniqueAttributePluginCfg configuration) Performs any initialization necessary for this plugin.booleanisConfigurationAcceptable(UniqueAttributePluginCfg cfg, List<LocalizableMessage> unacceptableReasons) Indicates whether the provided configuration is acceptable for this plugin.booleanisConfigurationChangeAcceptable(UniqueAttributePluginCfg configuration, List<LocalizableMessage> unacceptableReasons) Indicates whether the proposed change to the configuration is acceptable to this change listener.Methods inherited from class org.opends.server.api.plugin.DirectoryServerPlugindoLDIFImport, doLDIFImportBegin, doLDIFImportEnd, doPostCommit, doPostCommit, doPostCommit, doPostCommit, doPostConnect, doPostDisconnect, doPostOperation, doPostOperation, doPostOperation, doPostOperation, doPostOperation, doPostOperation, doPostOperation, doPostResponse, doPostResponse, doPostResponse, doPostResponse, doPostResponse, doPostResponse, doPostResponse, doPostResponse, doPostSynchronization, doPreOperation, doPreOperation, doPreOperation, doPreOperation, doPreOperation, doPreParse, doPreParse, doPreParse, doPreParse, doPreParse, doPreParse, doPreParse, doPreParse, doPreParse, doPreParse, doShutdown, doStartup, getPluginEntryDN, getPluginTypes, getServerContext, initializeInternal, invokeForInternalOperations, processIntermediateResponse, processSearchEntry, processSearchReference, processSubordinateDelete, processSubordinateModifyDN, setInvokeForInternalOperationsMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opends.server.api.AlertGeneratorgetClassName
- 
Constructor Details- 
UniqueAttributePluginpublic UniqueAttributePlugin()
 
- 
- 
Method Details- 
initializePluginpublic void initializePlugin(Set<PluginType> pluginTypes, UniqueAttributePluginCfg configuration) throws ConfigException Description copied from class:DirectoryServerPluginPerforms 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:
- initializePluginin class- DirectoryServerPlugin<UniqueAttributePluginCfg>
- Parameters:
- pluginTypes- The set of plugin types that indicate the ways in which this plugin will be invoked.
- configuration- The configuration for this plugin.
- Throws:
- ConfigException- If the provided entry does not contain a valid configuration for this plugin.
 
- 
finalizePluginpublic void finalizePlugin()Description copied from class:DirectoryServerPluginPerforms 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:
- finalizePluginin class- DirectoryServerPlugin<UniqueAttributePluginCfg>
 
- 
doPreOperationDescription copied from class:DirectoryServerPluginPerforms 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:
- doPreOperationin class- DirectoryServerPlugin<UniqueAttributePluginCfg>
- Parameters:
- addOperation- The add operation to be processed.
- Returns:
- Information about the result of the plugin processing.
 
- 
doPreOperationDescription copied from class:DirectoryServerPluginPerforms 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:
- doPreOperationin class- DirectoryServerPlugin<UniqueAttributePluginCfg>
- Parameters:
- modifyOperation- The modify operation to be processed.
- Returns:
- Information about the result of the plugin processing.
 
- 
doPreOperationDescription copied from class:DirectoryServerPluginPerforms any necessary processing that should be done just before the Directory Server performs the core processing for a modify DN operation. This method is not called when processing synchronization operations.- Overrides:
- doPreOperationin class- DirectoryServerPlugin<UniqueAttributePluginCfg>
- Parameters:
- modifyDnOp- The modify DN operation to be processed.
- Returns:
- Information about the result of the plugin processing.
 
- 
doPostSynchronizationDescription copied from class:DirectoryServerPluginPerforms any necessary processing that should be done after the Directory Server has completed processing for an add operation performed via synchronization.- Overrides:
- doPostSynchronizationin class- DirectoryServerPlugin<UniqueAttributePluginCfg>
- Parameters:
- addOperation- The synchronized add operation for which processing has been completed.
 
- 
doPostSynchronizationDescription copied from class:DirectoryServerPluginPerforms any necessary processing that should be done after the Directory Server has completed processing for a modify operation performed via synchronization.- Overrides:
- doPostSynchronizationin class- DirectoryServerPlugin<UniqueAttributePluginCfg>
- Parameters:
- modifyOperation- The synchronized modify operation for which processing has been completed.
 
- 
doPostSynchronizationDescription copied from class:DirectoryServerPluginPerforms any necessary processing that should be done after the Directory Server has completed processing for a modify DN operation performed via synchronization.- Overrides:
- doPostSynchronizationin class- DirectoryServerPlugin<UniqueAttributePluginCfg>
- Parameters:
- modifyDnOp- The synchronized modify DN operation for which processing has been completed.
 
- 
isConfigurationAcceptablepublic boolean isConfigurationAcceptable(UniqueAttributePluginCfg cfg, List<LocalizableMessage> unacceptableReasons) Description copied from class:DirectoryServerPluginIndicates 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:
- isConfigurationAcceptablein class- DirectoryServerPlugin<UniqueAttributePluginCfg>
- Parameters:
- cfg- 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:
- trueif the provided configuration is acceptable for this plugin, or- falseif not.
 
- 
isConfigurationChangeAcceptablepublic boolean isConfigurationChangeAcceptable(UniqueAttributePluginCfg configuration, List<LocalizableMessage> unacceptableReasons) Description copied from interface:ConfigurationChangeListenerIndicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
- isConfigurationChangeAcceptablein interface- ConfigurationChangeListener<UniqueAttributePluginCfg>
- 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 trueif the proposed change is acceptable, orfalseif it is not.
 
- 
applyConfigurationChangeDescription copied from interface:ConfigurationChangeListenerApplies the configuration changes to this change listener.- Specified by:
- applyConfigurationChangein interface- ConfigurationChangeListener<UniqueAttributePluginCfg>
- Parameters:
- newConfiguration- The new configuration containing the changes.
- Returns:
- Returns information about the result of changing the configuration.
 
- 
getComponentEntryDNDescription copied from interface:AlertGeneratorRetrieves the DN of the configuration entry with which this alert generator is associated.- Specified by:
- getComponentEntryDNin interface- AlertGenerator
- Returns:
- The DN of the configuration entry with which this alert generator is associated.
 
- 
getAlertsDescription copied from interface:AlertGeneratorRetrieves information about the set of alerts that this generator may produce. The map returned should be between the notification type for a particular notification and the human-readable description for that notification. This alert generator must not generate any alerts with types that are not contained in this list.- Specified by:
- getAlertsin interface- AlertGenerator
- Returns:
- Information about the set of alerts that this generator may produce.
 
- 
doPostOperationDescription copied from class:DirectoryServerPluginPerforms any necessary processing that should be done after the Directory Server has completed the core processing for an add operation but before the response has been sent to the client.- Overrides:
- doPostOperationin class- DirectoryServerPlugin<UniqueAttributePluginCfg>
- Parameters:
- addOperation- The add operation for which processing has completed but no response has yet been sent.
- Returns:
- Information about the result of the plugin processing.
 
- 
doPostOperationDescription copied from class:DirectoryServerPluginPerforms any necessary processing that should be done after the Directory Server has completed the core processing for a modify operation but before the response has been sent to the client.- Overrides:
- doPostOperationin class- DirectoryServerPlugin<UniqueAttributePluginCfg>
- Parameters:
- modifyOperation- The modify operation for which processing has completed but no response has yet been sent.
- Returns:
- Information about the result of the plugin processing.
 
- 
doPostOperationDescription copied from class:DirectoryServerPluginPerforms 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:
- doPostOperationin class- DirectoryServerPlugin<UniqueAttributePluginCfg>
- Parameters:
- modifyDnOp- The modify DN operation for which processing has completed but no response has yet been sent.
- Returns:
- Information about the result of the plugin processing.
 
 
-