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
@PublicAPI(stability=VOLATILE, mayInstantiate=false, mayExtend=true, mayInvoke=false) 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 ConditionResultapproximatelyEqualTo(Entry entry, VirtualAttributeRule rule, ByteString assertionValue)Indicates whether this virtual attribute provider will generate any value for the provided entry that is approximately equal to the given value.voidfinalizeVirtualAttributeProvider()Performs any finalization that may be necessary whenever this virtual attribute provider is taken out of service.abstract AttributegetValues(Entry entry, VirtualAttributeRule rule)Generates an unmodifiable attribute with the values for the provided entry.ConditionResultgreaterThanOrEqualTo(Entry entry, VirtualAttributeRule rule, ByteString assertionValue)Indicates whether this virtual attribute provider will generate any value for the provided entry that is greater than or equal to the given value.booleanhasAllValues(Entry entry, VirtualAttributeRule rule, Collection<?> values)Indicates whether this virtual attribute provider will generate all of the values in the provided collection.booleanhasValue(Entry entry, VirtualAttributeRule rule)Indicates whether this virtual attribute provider will generate at least one value for the provided entry.booleanhasValue(Entry entry, VirtualAttributeRule rule, ByteString value)Indicates whether this virtual attribute provider will generate the provided value.voidinitializeVirtualAttributeProvider(T configuration)Initializes this virtual attribute based on the information in the provided configuration entry.booleanisConfigurationAcceptable(VirtualAttributeCfg configuration, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)Indicates whether the provided configuration is acceptable for this virtual attribute provider.abstract booleanisMultiValued()Indicates whether this virtual attribute provider may generate multiple values.abstract booleanisSearchable(VirtualAttributeRule rule, SearchOperation searchOperation, boolean isPreIndexed)Indicates whether this attribute may be included in search filters as part of the criteria for locating entries.ConditionResultlessThanOrEqualTo(Entry entry, VirtualAttributeRule rule, ByteString assertionValue)Indicates whether this virtual attribute provider will generate any value for the provided entry that is less than or equal to the given value.ConditionResultmatchesEqualityAssertion(Entry entry, VirtualAttributeRule rule, ByteString assertionValue)Indicates whether this virtual attribute provider matches the assertion value.ConditionResultmatchesSubstring(Entry entry, VirtualAttributeRule rule, ByteString subInitial, List<ByteString> subAny, ByteString subFinal)Indicates whether this virtual attribute provider will generate any value which matches the provided substring.abstract voidprocessSearch(VirtualAttributeRule rule, 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(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.
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(VirtualAttributeCfg configuration, List<org.forgerock.i18n.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:
trueif the provided configuration is acceptable for this virtual attribute provider, orfalseif not.
-
finalizeVirtualAttributeProvider
public void finalizeVirtualAttributeProvider()
Performs any finalization that may be necessary whenever this virtual attribute provider is taken out of service.
-
isMultiValued
public abstract boolean isMultiValued()
Indicates whether this virtual attribute provider may generate multiple values.- Returns:
trueif this virtual attribute provider may generate multiple values, orfalseif not.
-
getValues
public abstract Attribute getValues(Entry entry, VirtualAttributeRule rule)
Generates an unmodifiable attribute with the values for the provided entry.- Parameters:
entry- The entry for which the values are to be generated.rule- The virtual attribute rule which defines the constraints for the virtual attribute.- Returns:
- The unmodifiable attribute with the values generated for the
provided entry. It may be empty, but it must not be
null.
-
hasValue
public boolean hasValue(Entry entry, VirtualAttributeRule rule)
Indicates whether this virtual attribute provider will generate at least one value for the provided entry.- Parameters:
entry- The entry for which to make the determination.rule- The virtual attribute rule which defines the constraints for the virtual attribute.- Returns:
trueif this virtual attribute provider will generate at least one value for the provided entry, orfalseif not.
-
hasValue
public boolean hasValue(Entry entry, VirtualAttributeRule rule, ByteString value)
Indicates whether this virtual attribute provider will generate the provided value.- Parameters:
entry- The entry for which to make the determination.rule- The virtual attribute rule which defines the constraints for the virtual attribute.value- The value for which to make the determination.- Returns:
trueif this virtual attribute provider will generate the specified value for the provided entry, orfalseif not.
-
matchesEqualityAssertion
public ConditionResult matchesEqualityAssertion(Entry entry, VirtualAttributeRule rule, ByteString assertionValue)
Indicates whether this virtual attribute provider matches the assertion value.- Parameters:
entry- The entry for which to make the determination.rule- The virtual attribute rule which defines the constraints for the virtual attribute.assertionValue- The assertion value for which to make the determination.- Returns:
trueif this virtual attribute provider matches the specified assertion value for the provided entry, orfalseif not.
-
hasAllValues
public boolean hasAllValues(Entry entry, VirtualAttributeRule rule, Collection<?> values)
Indicates whether this virtual attribute provider will generate all of the values in the provided collection.- Parameters:
entry- The entry for which to make the determination.rule- The virtual attribute rule which defines the constraints for the virtual attribute.values- The set of values for which to make the determination.- Returns:
trueif this attribute provider will generate all of the values in the provided collection, orfalseif it will not generate at least one of them.
-
matchesSubstring
public ConditionResult matchesSubstring(Entry entry, VirtualAttributeRule rule, ByteString subInitial, List<ByteString> subAny, ByteString subFinal)
Indicates whether this virtual attribute provider will generate any value which matches the provided substring.- Parameters:
entry- The entry for which to make the determination.rule- The virtual attribute rule which defines the constraints for the virtual attribute.subInitial- The subInitial component to use in the determination.subAny- The subAny components to use in the determination.subFinal- The subFinal component to use in the determination.- Returns:
UNDEFINEDif this attribute does not have a substring matching rule,TRUEif at least one value matches the provided substring, orFALSEotherwise.
-
greaterThanOrEqualTo
public ConditionResult greaterThanOrEqualTo(Entry entry, VirtualAttributeRule rule, ByteString assertionValue)
Indicates whether this virtual attribute provider will generate any value for the provided entry that is greater than or equal to the given value.- Parameters:
entry- The entry for which to make the determination.rule- The virtual attribute rule which defines the constraints for the virtual attribute.assertionValue- The assertion value for which to make the determination.- Returns:
UNDEFINEDif the associated attribute type does not have an ordering matching rule,TRUEif at least one of the generated values will be greater than or equal to the specified assertion value, orFALSEif none of the generated values will be greater than or equal to the specified value.
-
lessThanOrEqualTo
public ConditionResult lessThanOrEqualTo(Entry entry, VirtualAttributeRule rule, ByteString assertionValue)
Indicates whether this virtual attribute provider will generate any value for the provided entry that is less than or equal to the given value.- Parameters:
entry- The entry for which to make the determination.rule- The virtual attribute rule which defines the constraints for the virtual attribute.assertionValue- The assertion value for which to make the determination.- Returns:
UNDEFINEDif the associated attribute type does not have an ordering matching rule,TRUEif at least one of the generated values will be less than or equal to the specified assertion value, orFALSEif none of the generated values will be greater than or equal to the specified value.
-
approximatelyEqualTo
public ConditionResult approximatelyEqualTo(Entry entry, VirtualAttributeRule rule, ByteString assertionValue)
Indicates whether this virtual attribute provider will generate any value for the provided entry that is approximately equal to the given value.- Parameters:
entry- The entry for which to make the determination.rule- The virtual attribute rule which defines the constraints for the virtual attribute.assertionValue- The assertion value for which to make the determination.- Returns:
UNDEFINEDif the associated attribute type does not have an approximate matching rule,TRUEif at least one of the generated values will be approximately equal to the specified value, orFALSEif none of the generated values will be approximately equal to the specified assertion value.
-
isSearchable
public abstract boolean isSearchable(VirtualAttributeRule rule, SearchOperation searchOperation, boolean isPreIndexed)
Indicates whether this attribute may be included in search filters as part of the criteria for locating entries.- Parameters:
rule- The virtual attribute rule which defines the constraints for the virtual attribute.searchOperation- The search operation for which to make the determination.isPreIndexed- Indicates if we expect the search on the virtual attribute to be faster than an index search.- Returns:
trueif this attribute may be included in search filters, orfalseif not.
-
processSearch
public abstract void processSearch(VirtualAttributeRule rule, 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 ifisSearchablereturns true and it is not possible to construct a manageable candidate list by processing other elements of the search criteria.- Parameters:
rule- The virtual attribute rule which defines the constraints for the virtual attribute.searchOperation- The search operation to be processed.
-
-