mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

matthew_swift
03.37.2009 95df5cfdba474acb03076953e992b898fbb277a8
opends/src/server/org/opends/server/admin/LDAPProfile.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
@@ -104,7 +104,7 @@
     *         the instantiable relation is not handled by this LDAP
     *         profile wrapper.
     */
    public String getInstantiableRelationChildRDNType(
    public String getRelationChildRDNType(
        InstantiableRelationDefinition<?, ?> r) {
      return null;
    }
@@ -112,6 +112,26 @@
    /**
     * Gets the LDAP RDN attribute type for child entries of an set
     * relation.
     * <p>
     * The default implementation of this method is to return
     * <code>null</code>.
     *
     * @param r
     *          The set relation.
     * @return Returns the LDAP RDN attribute type for child entries of
     *         an set relation, or <code>null</code> if the set relation
     *         is not handled by this LDAP profile wrapper.
     */
    public String getRelationChildRDNType(SetRelationDefinition<?, ?> r)
    {
      return null;
    }
    /**
     * Get the principle object class associated with the specified
     * definition.
     * <p>
@@ -217,7 +237,7 @@
   *           If the LDAP profile properties file associated with the
   *           provided managed object definition could not be loaded.
   */
  public String getInstantiableRelationChildRDNType(
  public String getRelationChildRDNType(
      InstantiableRelationDefinition<?, ?> r) throws MissingResourceException {
    if (r.getNamingPropertyDefinition() != null) {
      // Use the attribute associated with the naming property.
@@ -225,7 +245,7 @@
          .getNamingPropertyDefinition());
    } else {
      for (Wrapper profile : profiles) {
        String rdnType = profile.getInstantiableRelationChildRDNType(r);
        String rdnType = profile.getRelationChildRDNType(r);
        if (rdnType != null) {
          return rdnType;
        }
@@ -238,23 +258,52 @@
  /**
   * Gets the LDAP object classes associated with an instantiable
   * Gets the LDAP object classes associated with an instantiable or set
   * relation branch. The branch is the parent entry of child managed
   * objects.
   *
   * @param r
   *          The instantiable relation.
   *          The instantiable or set relation.
   * @return Returns the LDAP object classes associated with an
   *         instantiable relation branch.
   *         instantiable or set relation branch.
   */
  public List<String> getInstantiableRelationObjectClasses(
      InstantiableRelationDefinition<?, ?> r) {
  public List<String> getRelationObjectClasses(
      RelationDefinition<?, ?> r) {
    return Arrays.asList(new String[] { "top", "ds-cfg-branch" });
  }
  /**
   * Gets the LDAP RDN attribute type for child entries of an set
   * relation.
   *
   * @param r
   *          The set relation.
   * @return 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.
   */
  public String getRelationChildRDNType(SetRelationDefinition<?, ?> r)
      throws MissingResourceException
  {
    for (Wrapper profile : profiles)
    {
      String rdnType = profile.getRelationChildRDNType(r);
      if (rdnType != null)
      {
        return rdnType;
      }
    }
    return resource.getString(r.getParentDefinition(),
        "naming-attribute." + r.getName());
  }
  /**
   * Get the principle object class associated with the specified
   * definition.
   *