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

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 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 context
      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.
    • 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

      protected ServerContext 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, or false if not.
    • finalizeVirtualAttributeProvider

      public void finalizeVirtualAttributeProvider()
      Performs any finalization that may be necessary whenever this virtual attribute provider is taken out of service.
    • getAttribute

      public abstract Attribute getAttribute(Entry entry, AttributeDescription attributeDescription)
      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, or false 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, return true if it was successful.
      Parameters:
      attributeDescription - the attribute description corresponding to this virtual attribute
      context - The request context
      request - The search request
      out - A consumer to which search result entries should be published. The predicate should return false if no more results should be computed.
      Returns:
      true if this attribute may be included in search filters, or false if not.