org.opends.server.extensions
Class MemberVirtualAttributeProvider

java.lang.Object
  extended by org.opends.server.api.VirtualAttributeProvider<MemberVirtualAttributeCfg>
      extended by org.opends.server.extensions.MemberVirtualAttributeProvider
All Implemented Interfaces:
ConfigurationChangeListener<MemberVirtualAttributeCfg>

public class MemberVirtualAttributeProvider
extends VirtualAttributeProvider<MemberVirtualAttributeCfg>
implements ConfigurationChangeListener<MemberVirtualAttributeCfg>

This class implements a virtual attribute provider that works in conjunction with virtual static groups to generate the values for the member or uniqueMember attribute.


Constructor Summary
MemberVirtualAttributeProvider()
          Creates a new instance of this member virtual attribute provider.
 
Method Summary
 ConfigChangeResult applyConfigurationChange(MemberVirtualAttributeCfg configuration)
          Applies the configuration changes to this change listener.
 ConditionResult approximatelyEqualTo(Entry entry, VirtualAttributeRule rule, AttributeValue value)
          Indicates whether this virtual attribute provider will generate any value for the provided entry that is approximately equal to the given value.
 java.util.LinkedHashSet<AttributeValue> getValues(Entry entry, VirtualAttributeRule rule)
          Generates a set of values for the provided entry.
 ConditionResult greaterThanOrEqualTo(Entry entry, VirtualAttributeRule rule, AttributeValue value)
          Indicates whether this virtual attribute provider will generate any value for the provided entry that is greater than or equal to the given value.
 boolean hasAnyValue(Entry entry, VirtualAttributeRule rule, java.util.Collection<AttributeValue> values)
          Indicates whether this virutal attribute provider will generate any of the values in the provided collection.
 boolean hasValue(Entry entry, VirtualAttributeRule rule)
          Indicates whether this virtual attribute provider will generate at least one value for the provided entry.
 boolean hasValue(Entry entry, VirtualAttributeRule rule, AttributeValue value)
          Indicates whether this virtual attribute provider will generate the provided value.
 void initializeVirtualAttributeProvider(MemberVirtualAttributeCfg configuration)
          Initializes this virtual attribute based on the information in the provided configuration entry.
 boolean isConfigurationChangeAcceptable(MemberVirtualAttributeCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the proposed change to the configuration is acceptable to this change listener.
 boolean isMultiValued()
          Indicates whether this virtual attribute provider may generate multiple values.
 boolean isSearchable(VirtualAttributeRule rule, SearchOperation searchOperation)
          Indicates whether this attribute may be included in search filters as part of the criteria for locating entries.
 ConditionResult lessThanOrEqualTo(Entry entry, VirtualAttributeRule rule, AttributeValue value)
          Indicates whether this virtual attribute provider will generate any value for the provided entry that is less than or equal to the given value.
 ConditionResult matchesSubstring(Entry entry, VirtualAttributeRule rule, ByteString subInitial, java.util.List<ByteString> subAny, ByteString subFinal)
          Indicates whether this virtual attribute provider will generate any value which matches the provided substring.
 void processSearch(VirtualAttributeRule rule, SearchOperation searchOperation)
          Processes the provided search operation in which the search criteria includes an operation targeted at this virtual attribute.
 
Methods inherited from class org.opends.server.api.VirtualAttributeProvider
finalizeVirtualAttributeProvider, hasAllValues, isConfigurationAcceptable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemberVirtualAttributeProvider

public MemberVirtualAttributeProvider()
Creates a new instance of this member virtual attribute provider.

Method Detail

initializeVirtualAttributeProvider

public void initializeVirtualAttributeProvider(MemberVirtualAttributeCfg configuration)
                                        throws ConfigException,
                                               InitializationException
Initializes this virtual attribute based on the information in the provided configuration entry.

Specified by:
initializeVirtualAttributeProvider in class VirtualAttributeProvider<MemberVirtualAttributeCfg>
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.

isMultiValued

public boolean isMultiValued()
Indicates whether this virtual attribute provider may generate multiple values.

Specified by:
isMultiValued in class VirtualAttributeProvider<MemberVirtualAttributeCfg>
Returns:
true if this virtual attribute provider may generate multiple values, or false if not.

getValues

public java.util.LinkedHashSet<AttributeValue> getValues(Entry entry,
                                                         VirtualAttributeRule rule)
Generates a set of values for the provided entry.

Specified by:
getValues in class VirtualAttributeProvider<MemberVirtualAttributeCfg>
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 set of 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.

Overrides:
hasValue in class VirtualAttributeProvider<MemberVirtualAttributeCfg>
Parameters:
entry - The entry for which to make the determination.
rule - The virtual attribute rule which defines the constraints for the virtual attribute.
Returns:
true if this virtual attribute provider will generate at least one value for the provided entry, or false if not.

hasValue

public boolean hasValue(Entry entry,
                        VirtualAttributeRule rule,
                        AttributeValue value)
Indicates whether this virtual attribute provider will generate the provided value.

Overrides:
hasValue in class VirtualAttributeProvider<MemberVirtualAttributeCfg>
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:
true if this virtual attribute provider will generate the specified vaule for the provided entry, or false if not.

hasAnyValue

public boolean hasAnyValue(Entry entry,
                           VirtualAttributeRule rule,
                           java.util.Collection<AttributeValue> values)
Indicates whether this virutal attribute provider will generate any of the values in the provided collection.

Overrides:
hasAnyValue in class VirtualAttributeProvider<MemberVirtualAttributeCfg>
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:
true if this attribute provider will generate at least one of the values in the provided collection, or false if it will not generate any of them.

matchesSubstring

public ConditionResult matchesSubstring(Entry entry,
                                        VirtualAttributeRule rule,
                                        ByteString subInitial,
                                        java.util.List<ByteString> subAny,
                                        ByteString subFinal)
Indicates whether this virtual attribute provider will generate any value which matches the provided substring.

Overrides:
matchesSubstring in class VirtualAttributeProvider<MemberVirtualAttributeCfg>
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:
UNDEFINED if this attribute does not have a substring matching rule, TRUE if at least one value matches the provided substring, or FALSE otherwise.

greaterThanOrEqualTo

public ConditionResult greaterThanOrEqualTo(Entry entry,
                                            VirtualAttributeRule rule,
                                            AttributeValue value)
Indicates whether this virtual attribute provider will generate any value for the provided entry that is greater than or equal to the given value.

Overrides:
greaterThanOrEqualTo in class VirtualAttributeProvider<MemberVirtualAttributeCfg>
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:
UNDEFINED if the associated attribute type does not have an ordering matching rule, TRUE if at least one of the generated values will be greater than or equal to the specified value, or FALSE if none of the generated values will be greater than or equal to the specified value.

lessThanOrEqualTo

public ConditionResult lessThanOrEqualTo(Entry entry,
                                         VirtualAttributeRule rule,
                                         AttributeValue value)
Indicates whether this virtual attribute provider will generate any value for the provided entry that is less than or equal to the given value.

Overrides:
lessThanOrEqualTo in class VirtualAttributeProvider<MemberVirtualAttributeCfg>
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:
UNDEFINED if the associated attribute type does not have an ordering matching rule, TRUE if at least one of the generated values will be less than or equal to the specified value, or FALSE if none of the generated values will be greater than or equal to the specified value.

approximatelyEqualTo

public ConditionResult approximatelyEqualTo(Entry entry,
                                            VirtualAttributeRule rule,
                                            AttributeValue value)
Indicates whether this virtual attribute provider will generate any value for the provided entry that is approximately equal to the given value.

Overrides:
approximatelyEqualTo in class VirtualAttributeProvider<MemberVirtualAttributeCfg>
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:
UNDEFINED if the associated attribute type does not have an aproximate matching rule, TRUE if at least one of the generated values will be approximately equal to the specified value, or FALSE if none of the generated values will be approximately equal to the specified value.

isSearchable

public boolean isSearchable(VirtualAttributeRule rule,
                            SearchOperation searchOperation)
Indicates whether this attribute may be included in search filters as part of the criteria for locating entries..

Specified by:
isSearchable in class VirtualAttributeProvider<MemberVirtualAttributeCfg>
Parameters:
rule - The virtual attribute rule which defines the constraints for the virtual attribute.
searchOperation - The search operation for which to make the determination.
Returns:
true if this attribute may be included in search filters, or false if not.

processSearch

public 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 if isSearchable returns true and it is not possible to construct a manageable candidate list by processing other elements of the search criteria.

Specified by:
processSearch in class VirtualAttributeProvider<MemberVirtualAttributeCfg>
Parameters:
rule - The virtual attribute rule which defines the constraints for the virtual attribute.
searchOperation - The search operation to be processed.

isConfigurationChangeAcceptable

public boolean isConfigurationChangeAcceptable(MemberVirtualAttributeCfg configuration,
                                               java.util.List<Message> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener.

Specified by:
isConfigurationChangeAcceptable in interface ConfigurationChangeListener<MemberVirtualAttributeCfg>
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, or false if it is not.

applyConfigurationChange

public ConfigChangeResult applyConfigurationChange(MemberVirtualAttributeCfg configuration)
Applies the configuration changes to this change listener.

Specified by:
applyConfigurationChange in interface ConfigurationChangeListener<MemberVirtualAttributeCfg>
Parameters:
configuration - The new configuration containing the changes.
Returns:
Returns information about the result of changing the configuration.