Package org.opends.server.extensions
Class UserDefinedVirtualAttributeProvider
java.lang.Object
org.opends.server.api.VirtualAttributeProvider<UserDefinedVirtualAttributeCfg>
org.opends.server.extensions.UserDefinedVirtualAttributeProvider
- All Implemented Interfaces:
ConfigurationChangeListener<UserDefinedVirtualAttributeCfg>
public final class UserDefinedVirtualAttributeProvider
extends VirtualAttributeProvider<UserDefinedVirtualAttributeCfg>
implements ConfigurationChangeListener<UserDefinedVirtualAttributeCfg>
This class implements a virtual attribute provider that allows administrators to define their own values that will be
inserted into any entry that matches the criteria defined in the virtual attribute rule. This can be used to provide
functionality like Class of Service (CoS) in the Sun Java System Directory Server.
Note: We will not allow searches based only on user-defined virtual attributes.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapplyConfigurationChange
(UserDefinedVirtualAttributeCfg configuration) Applies the configuration changes to this change listener.void
Performs any finalization that may be necessary whenever this virtual attribute provider is taken out of service.getAttribute
(Entry entry, AttributeDescription attrDesc) Generates an unmodifiable attribute with the values for the provided entry.void
initializeVirtualAttributeProvider
(UserDefinedVirtualAttributeCfg configuration) Initializes this virtual attribute based on the information in the provided configuration entry.boolean
isConfigurationChangeAcceptable
(UserDefinedVirtualAttributeCfg configuration, List<LocalizableMessage> unacceptableReasons) Indicates whether the proposed change to the configuration is acceptable to this change listener.boolean
Indicates whether this virtual attribute provider may generate multiple values.Methods inherited from class org.opends.server.api.VirtualAttributeProvider
getServerContext, initializeVirtualAttributeProvider, isConfigurationAcceptable, tryProcessSearch
-
Constructor Details
-
UserDefinedVirtualAttributeProvider
public UserDefinedVirtualAttributeProvider()
-
-
Method Details
-
initializeVirtualAttributeProvider
Description copied from class:VirtualAttributeProvider
Initializes this virtual attribute based on the information in the provided configuration entry.- Overrides:
initializeVirtualAttributeProvider
in classVirtualAttributeProvider<UserDefinedVirtualAttributeCfg>
- Parameters:
configuration
- The configuration to use to initialize this virtual attribute provider.
-
finalizeVirtualAttributeProvider
public void finalizeVirtualAttributeProvider()Description copied from class:VirtualAttributeProvider
Performs any finalization that may be necessary whenever this virtual attribute provider is taken out of service.- Overrides:
finalizeVirtualAttributeProvider
in classVirtualAttributeProvider<UserDefinedVirtualAttributeCfg>
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(UserDefinedVirtualAttributeCfg 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 interfaceConfigurationChangeListener<UserDefinedVirtualAttributeCfg>
- 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, orfalse
if it is not.
-
applyConfigurationChange
Description copied from interface:ConfigurationChangeListener
Applies the configuration changes to this change listener.- Specified by:
applyConfigurationChange
in interfaceConfigurationChangeListener<UserDefinedVirtualAttributeCfg>
- Parameters:
configuration
- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
isMultiValued
public boolean isMultiValued()Description copied from class:VirtualAttributeProvider
Indicates whether this virtual attribute provider may generate multiple values.- Specified by:
isMultiValued
in classVirtualAttributeProvider<UserDefinedVirtualAttributeCfg>
- Returns:
true
if this virtual attribute provider may generate multiple values, orfalse
if not.
-
getAttribute
Description copied from class:VirtualAttributeProvider
Generates an unmodifiable attribute with the values for the provided entry.- Specified by:
getAttribute
in classVirtualAttributeProvider<UserDefinedVirtualAttributeCfg>
- Parameters:
entry
- The entry for which the values are to be generated.attrDesc
- the attribute description corresponding to this virtual attribute- Returns:
- The unmodifiable attribute with the values generated for the provided entry. It may be empty, but it must
not be
null
.
-