Class LdapProfile

java.lang.Object
org.forgerock.opendj.config.LdapProfile

public final class LdapProfile extends Object
This class is used to map configuration elements to their LDAP schema names.

It is possible to augment the core LDAP profile with additional profile mappings at run-time using instances of LdapProfile.Wrapper. This is useful for unit tests which need to add and remove mock components.

  • Method Details

    • getInstance

      public static LdapProfile getInstance()
      Get the global LDAP profile instance.
      Returns:
      Returns the global LDAP profile instance.
    • getAttributeName

      public String getAttributeName(AbstractManagedObjectDefinition<?,?> d, PropertyDefinition<?> pd)
      Get the name of the LDAP attribute associated with the specified property definition.
      Parameters:
      d - The managed object definition.
      pd - The property definition.
      Returns:
      Returns the name of the LDAP attribute associated with the specified property definition.
      Throws:
      MissingResourceException - If the LDAP profile properties file associated with the provided managed object definition could not be loaded.
    • getRelationChildRdnType

      public String getRelationChildRdnType(InstantiableRelationDefinition<?,?> r)
      Gets the LDAP RDN attribute type for child entries of an instantiable relation.
      Parameters:
      r - The instantiable relation.
      Returns:
      Returns the LDAP RDN attribute type for child entries of an instantiable relation.
      Throws:
      MissingResourceException - If the LDAP profile properties file associated with the provided managed object definition could not be loaded.
    • getRelationObjectClasses

      public List<String> getRelationObjectClasses()
      Gets the LDAP object classes associated with an instantiable or set relation branch. The branch is the parent entry of child managed objects.
      Returns:
      Returns the LDAP object classes associated with an instantiable or set relation branch.
    • getRelationChildRdnType

      public String getRelationChildRdnType(SetRelationDefinition<?,?> r)
      Gets the LDAP RDN attribute type for child entries of an set relation.
      Parameters:
      r - The set relation.
      Returns:
      Returns the LDAP RDN attribute type for child entries of an set relation.
      Throws:
      MissingResourceException - If the LDAP profile properties file associated with the provided managed object definition could not be loaded.
    • getObjectClass

      public String getObjectClass(AbstractManagedObjectDefinition<?,?> d)
      Get the principle object class associated with the specified definition.
      Parameters:
      d - The managed object definition.
      Returns:
      Returns the principle object class associated with the specified definition.
      Throws:
      MissingResourceException - If the LDAP profile properties file associated with the provided managed object definition could not be loaded.
    • getObjectClasses

      public List<String> getObjectClasses(AbstractManagedObjectDefinition<?,?> d)
      Get all the object classes associated with the specified definition.

      The returned list is ordered such that the uppermost object classes appear first (e.g. top).

      Parameters:
      d - The managed object definition.
      Returns:
      Returns all the object classes associated with the specified definition.
      Throws:
      MissingResourceException - If the LDAP profile properties file associated with the provided managed object definition could not be loaded.
    • getRelationRdnSequence

      public String getRelationRdnSequence(RelationDefinition<?,?> r)
      Get an LDAP RDN sequence associated with a relation.
      Parameters:
      r - The relation.
      Returns:
      Returns the LDAP RDN sequence associated with a relation.
      Throws:
      MissingResourceException - If the LDAP profile properties file associated with the provided managed object definition could not be loaded.
    • popWrapper

      public void popWrapper()
      Removes the last LDAP profile wrapper added using pushWrapper(LdapProfile.Wrapper).
      Throws:
      NoSuchElementException - If there are no LDAP profile wrappers.
    • pushWrapper

      public void pushWrapper(LdapProfile.Wrapper wrapper)
      Decorates the core LDAP profile with the provided LDAP profile wrapper. All profile requests will be directed to the provided wrapper before being forwarded onto the core profile if the request could not be satisfied.
      Parameters:
      wrapper - The LDAP profile wrapper.