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
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
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
Indicates whether this virtual attribute provider may generate multiple values.boolean
tryProcessSearch
(AttributeDescription attributeDescription, RequestContext context, SearchRequest request, Predicate<SearchResultEntry> out) Attempts to process the provided search operation using this virtual attribute, returntrue
if it was successful.
-
Constructor Details
-
VirtualAttributeProvider
public VirtualAttributeProvider()
-
-
Method Details
-
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
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
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.
-
tryProcessSearch
public boolean tryProcessSearch(AttributeDescription attributeDescription, RequestContext context, SearchRequest request, Predicate<SearchResultEntry> out) Attempts to process the provided search operation using this virtual attribute, returntrue
if it was successful.- Parameters:
attributeDescription
- the attribute description corresponding to this virtual attributecontext
- The request contextrequest
- The search requestout
- A consumer to which search result entries should be published. The predicate should returnfalse
if no more results should be computed.- Returns:
true
if this attribute may be included in search filters, orfalse
if not.
-