Package org.opends.server.api
Class VirtualAttributeProvider<T extends VirtualAttributeCfg>
- java.lang.Object
-
- org.opends.server.api.VirtualAttributeProvider<T>
-
- Type Parameters:
T
- The type of configuration handled by this virtual attribute provider.
- Direct Known Subclasses:
CollectiveAttributeSubentriesVirtualAttributeProvider
,EntityTagVirtualAttributeProvider
,EntryDNVirtualAttributeProvider
,EntryUUIDVirtualAttributeProvider
,GoverningStructureRuleVirtualAttributeProvider
,HasSubordinatesVirtualAttributeProvider
,IsMemberOfVirtualAttributeProvider
,MemberVirtualAttributeProvider
,NumSubordinatesVirtualAttributeProvider
,PasswordExpirationTimeVirtualAttributeProvider
,PasswordPolicySubentryVirtualAttributeProvider
,StructuralObjectClassVirtualAttributeProvider
,SubschemaSubentryVirtualAttributeProvider
,UserDefinedVirtualAttributeProvider
,UserTemplateVirtualAttributeProvider
@PublicAPI(stability=VOLATILE, mayExtend=true) public abstract class VirtualAttributeProvider<T extends VirtualAttributeCfg> extends Object
This class defines the set of methods and structures that must be implemented by a Directory Server module that implements the functionality required for one or more virtual attributes.
-
-
Constructor Summary
Constructors Constructor Description VirtualAttributeProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
finalizeVirtualAttributeProvider()
Performs any finalization that may be necessary whenever this virtual attribute provider is taken out of service.abstract Attribute
getAttribute(Entry entry, AttributeDescription attributeDescription)
Generates an unmodifiable attribute with the values for the provided entry.protected ServerContext
getServerContext()
Return the server context.void
initializeVirtualAttributeProvider(ServerContext serverContext, T configuration)
Initializes this virtual attribute based on the information in the provided configuration entry.protected void
initializeVirtualAttributeProvider(T configuration)
Initializes this virtual attribute based on the information in the provided configuration entry.boolean
isConfigurationAcceptable(T configuration, List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this virtual attribute provider.abstract boolean
isMultiValued()
Indicates whether this virtual attribute provider may generate multiple values.boolean
isSearchable(AttributeDescription attributeDescription, SearchOperation searchOperation)
Indicates whether this attribute may be included in search filters as part of the criteria for locating entries.void
processSearch(AttributeDescription attributeDescription, SearchOperation searchOperation)
Processes the provided search operation in which the search criteria includes an operation targeted at this virtual attribute.
-
-
-
Method Detail
-
initializeVirtualAttributeProvider
public void initializeVirtualAttributeProvider(ServerContext serverContext, T configuration) throws ConfigException, InitializationException
Initializes this virtual attribute based on the information in the provided configuration entry.- Parameters:
serverContext
- The server contextconfiguration
- The configuration to use to initialize this virtual attribute provider.- Throws:
ConfigException
- If an unrecoverable problem arises in the process of performing the initialization.InitializationException
- If a problem occurs during initialization that is not related to the server configuration.
-
initializeVirtualAttributeProvider
protected void initializeVirtualAttributeProvider(T configuration) throws ConfigException, InitializationException
Initializes this virtual attribute based on the information in the provided configuration entry.- Parameters:
configuration
- The configuration to use to initialize this virtual attribute provider.- Throws:
ConfigException
- If an unrecoverable problem arises in the process of performing the initialization.InitializationException
- If a problem occurs during initialization that is not related to the server configuration.
-
getServerContext
protected ServerContext getServerContext()
Return the server context.- Returns:
- the server context
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(T configuration, List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this virtual attribute provider. It should be possible to call this method on an uninitialized virtual attribute provider instance in order to determine whether the virtual attribute provider would be able to use the provided configuration.- Parameters:
configuration
- The virtual attribute provider 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 virtual attribute provider, orfalse
if not.
-
finalizeVirtualAttributeProvider
public void finalizeVirtualAttributeProvider()
Performs any finalization that may be necessary whenever this virtual attribute provider is taken out of service.
-
getAttribute
public abstract Attribute getAttribute(Entry entry, AttributeDescription attributeDescription)
Generates an unmodifiable attribute with the values for the provided entry.- Parameters:
entry
- The entry for which the values are to be generated.attributeDescription
- 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
.
-
isMultiValued
public abstract boolean isMultiValued()
Indicates whether this virtual attribute provider may generate multiple values.- Returns:
true
if this virtual attribute provider may generate multiple values, orfalse
if not.
-
isSearchable
public boolean isSearchable(AttributeDescription attributeDescription, SearchOperation searchOperation)
Indicates whether this attribute may be included in search filters as part of the criteria for locating entries.- Parameters:
attributeDescription
- the attribute description corresponding to this virtual attributesearchOperation
- The search operation for which to make the determination.- Returns:
true
if this attribute may be included in search filters, orfalse
if not.
-
processSearch
public void processSearch(AttributeDescription attributeDescription, SearchOperation searchOperation)
Processes the provided search operation in which the search criteria includes an operation targeted at this virtual attribute. This method should only be called ifisSearchable
returns true and it is not possible to construct a manageable candidate list by processing other elements of the search criteria.- Parameters:
attributeDescription
- the attribute description corresponding to this virtual attributesearchOperation
- The search operation to be processed.
-
-