Package org.opends.server.extensions
Class EntityTagVirtualAttributeProvider
- java.lang.Object
-
- org.opends.server.api.VirtualAttributeProvider<EntityTagVirtualAttributeCfg>
-
- org.opends.server.extensions.EntityTagVirtualAttributeProvider
-
- All Implemented Interfaces:
ConfigurationChangeListener<EntityTagVirtualAttributeCfg>
public final class EntityTagVirtualAttributeProvider extends VirtualAttributeProvider<EntityTagVirtualAttributeCfg> implements ConfigurationChangeListener<EntityTagVirtualAttributeCfg>
This class implements a virtual attribute provider which ensures that all entries contain an "entity tag" or "Etag" as defined in section 3.11 of RFC 2616.The entity tag may be used by clients, in conjunction with the assertion control, for optimistic concurrency control, as a way to help prevent simultaneous updates of an entry from conflicting with each other.
-
-
Constructor Summary
Constructors Constructor Description EntityTagVirtualAttributeProvider()Default constructor invoked by reflection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigChangeResultapplyConfigurationChange(EntityTagVirtualAttributeCfg configuration)Applies the configuration changes to this change listener.ConditionResultapproximatelyEqualTo(Entry entry, VirtualAttributeRule rule, ByteString value)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.AttributegetValues(Entry entry, VirtualAttributeRule rule)Generates an unmodifiable attribute with the values for the provided entry.ConditionResultgreaterThanOrEqualTo(Entry entry, VirtualAttributeRule rule, ByteString 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.booleanhasValue(Entry entry, VirtualAttributeRule rule)Indicates whether this virtual attribute provider will generate at least one value for the provided entry.voidinitializeVirtualAttributeProvider(EntityTagVirtualAttributeCfg configuration)Initializes this virtual attribute based on the information in the provided configuration entry.booleanisConfigurationChangeAcceptable(EntityTagVirtualAttributeCfg configuration, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)Indicates whether the proposed change to the configuration is acceptable to this change listener.booleanisMultiValued()Indicates whether this virtual attribute provider may generate multiple values.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 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.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.voidprocessSearch(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
hasAllValues, hasValue, isConfigurationAcceptable, matchesEqualityAssertion
-
-
-
-
Method Detail
-
applyConfigurationChange
public ConfigChangeResult applyConfigurationChange(EntityTagVirtualAttributeCfg configuration)
Description copied from interface:ConfigurationChangeListenerApplies the configuration changes to this change listener.- Specified by:
applyConfigurationChangein interfaceConfigurationChangeListener<EntityTagVirtualAttributeCfg>- Parameters:
configuration- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
approximatelyEqualTo
public ConditionResult approximatelyEqualTo(Entry entry, VirtualAttributeRule rule, ByteString value)
Description copied from class:VirtualAttributeProviderIndicates whether this virtual attribute provider will generate any value for the provided entry that is approximately equal to the given value.- Overrides:
approximatelyEqualToin classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>- 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 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.
-
finalizeVirtualAttributeProvider
public void finalizeVirtualAttributeProvider()
Description copied from class:VirtualAttributeProviderPerforms any finalization that may be necessary whenever this virtual attribute provider is taken out of service.- Overrides:
finalizeVirtualAttributeProviderin classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>
-
getValues
public Attribute getValues(Entry entry, VirtualAttributeRule rule)
Description copied from class:VirtualAttributeProviderGenerates an unmodifiable attribute with the values for the provided entry.- Specified by:
getValuesin classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>- 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.
-
greaterThanOrEqualTo
public ConditionResult greaterThanOrEqualTo(Entry entry, VirtualAttributeRule rule, ByteString value)
Description copied from class:VirtualAttributeProviderIndicates whether this virtual attribute provider will generate any value for the provided entry that is greater than or equal to the given value.- Overrides:
greaterThanOrEqualToin classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>- 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 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.
-
hasValue
public boolean hasValue(Entry entry, VirtualAttributeRule rule)
Description copied from class:VirtualAttributeProviderIndicates whether this virtual attribute provider will generate at least one value for the provided entry.- Overrides:
hasValuein classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>- 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.
-
initializeVirtualAttributeProvider
public void initializeVirtualAttributeProvider(EntityTagVirtualAttributeCfg configuration) throws ConfigException, InitializationException
Description copied from class:VirtualAttributeProviderInitializes this virtual attribute based on the information in the provided configuration entry.- Overrides:
initializeVirtualAttributeProviderin classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>- 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.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(EntityTagVirtualAttributeCfg configuration, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)
Description copied from interface:ConfigurationChangeListenerIndicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptablein interfaceConfigurationChangeListener<EntityTagVirtualAttributeCfg>- 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
trueif the proposed change is acceptable, orfalseif it is not.
-
isMultiValued
public boolean isMultiValued()
Description copied from class:VirtualAttributeProviderIndicates whether this virtual attribute provider may generate multiple values.- Specified by:
isMultiValuedin classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>- Returns:
trueif this virtual attribute provider may generate multiple values, orfalseif not.
-
isSearchable
public boolean isSearchable(VirtualAttributeRule rule, SearchOperation searchOperation, boolean isPreIndexed)
Description copied from class:VirtualAttributeProviderIndicates whether this attribute may be included in search filters as part of the criteria for locating entries.- Specified by:
isSearchablein classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>- 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.
-
lessThanOrEqualTo
public ConditionResult lessThanOrEqualTo(Entry entry, VirtualAttributeRule rule, ByteString value)
Description copied from class:VirtualAttributeProviderIndicates whether this virtual attribute provider will generate any value for the provided entry that is less than or equal to the given value.- Overrides:
lessThanOrEqualToin classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>- 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 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.
-
matchesSubstring
public ConditionResult matchesSubstring(Entry entry, VirtualAttributeRule rule, ByteString subInitial, List<ByteString> subAny, ByteString subFinal)
Description copied from class:VirtualAttributeProviderIndicates whether this virtual attribute provider will generate any value which matches the provided substring.- Overrides:
matchesSubstringin classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>- 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.
-
processSearch
public void processSearch(VirtualAttributeRule rule, SearchOperation searchOperation)
Description copied from class:VirtualAttributeProviderProcesses 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.- Specified by:
processSearchin classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>- Parameters:
rule- The virtual attribute rule which defines the constraints for the virtual attribute.searchOperation- The search operation to be processed.
-
-