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.
Note: etags cannot be searched since there is no way to determine which entry is associated with a particular ETag.
-
-
Constructor Summary
Constructors Constructor Description EntityTagVirtualAttributeProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigChangeResult
applyConfigurationChange(EntityTagVirtualAttributeCfg configuration)
Applies the configuration changes to this change listener.void
finalizeVirtualAttributeProvider()
Performs any finalization that may be necessary whenever this virtual attribute provider is taken out of service.Attribute
getAttribute(Entry entry, AttributeDescription attributeDescription)
Generates an unmodifiable attribute with the values for the provided entry.void
initializeVirtualAttributeProvider(EntityTagVirtualAttributeCfg configuration)
Initializes this virtual attribute based on the information in the provided configuration entry.boolean
isConfigurationChangeAcceptable(EntityTagVirtualAttributeCfg configuration, List<LocalizableMessage> 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.-
Methods inherited from class org.opends.server.api.VirtualAttributeProvider
getServerContext, initializeVirtualAttributeProvider, isConfigurationAcceptable, isSearchable, processSearch
-
-
-
-
Method Detail
-
applyConfigurationChange
public ConfigChangeResult applyConfigurationChange(EntityTagVirtualAttributeCfg configuration)
Description copied from interface:ConfigurationChangeListener
Applies the configuration changes to this change listener.- Specified by:
applyConfigurationChange
in interfaceConfigurationChangeListener<EntityTagVirtualAttributeCfg>
- Parameters:
configuration
- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
finalizeVirtualAttributeProvider
public void finalizeVirtualAttributeProvider()
Description copied from class:VirtualAttributeProvider
Performs any finalization that may be necessary whenever this virtual attribute provider is taken out of service.- Overrides:
finalizeVirtualAttributeProvider
in classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>
-
getAttribute
public Attribute getAttribute(Entry entry, AttributeDescription attributeDescription)
Description copied from class:VirtualAttributeProvider
Generates an unmodifiable attribute with the values for the provided entry.- Specified by:
getAttribute
in classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>
- 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
.
-
initializeVirtualAttributeProvider
public void initializeVirtualAttributeProvider(EntityTagVirtualAttributeCfg configuration)
Description copied from class:VirtualAttributeProvider
Initializes this virtual attribute based on the information in the provided configuration entry.- Overrides:
initializeVirtualAttributeProvider
in classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>
- Parameters:
configuration
- The configuration to use to initialize this virtual attribute provider.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(EntityTagVirtualAttributeCfg configuration, List<LocalizableMessage> unacceptableReasons)
Description copied from interface:ConfigurationChangeListener
Indicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptable
in 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
true
if the proposed change is acceptable, orfalse
if it is not.
-
isMultiValued
public boolean isMultiValued()
Description copied from class:VirtualAttributeProvider
Indicates whether this virtual attribute provider may generate multiple values.- Specified by:
isMultiValued
in classVirtualAttributeProvider<EntityTagVirtualAttributeCfg>
- Returns:
true
if this virtual attribute provider may generate multiple values, orfalse
if not.
-
-