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

Nicolas Capponi
12.50.2016 0ea193c303a1553fbde5a1637d40bfb46c8e5b73
opendj-server-legacy/src/main/java/org/opends/server/util/SchemaUtils.java
@@ -54,6 +54,8 @@
    // No implementation required.
  }
  private static final String CONFIG_SCHEMA_ELEMENTS_FILE = "02-config.ldif";
  /** Represents a password type, including a "not a password" value. */
  public enum PasswordType
  {
@@ -124,7 +126,7 @@
  public static String getElementDefinitionWithFileName(SchemaElement element)
  {
    final String definition = element.toString();
    return addSchemaFileToElementDefinitionIfAbsent(definition, SchemaUtils.getElementSchemaFile(element));
    return addSchemaFileToElementDefinitionIfAbsent(definition, getElementSchemaFile(element));
  }
  /**
@@ -489,4 +491,21 @@
      throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, parsingErrorMsg.get(definition), e);
    }
  }
  /**
   * Indicates if the provided schema file corresponds to the configuration schema.
   * <p>
   * The file containing the definitions of the schema elements used for configuration must not be
   * imported nor propagated to other servers because these definitions may vary between versions of
   * OpenDJ.
   *
   * @param schemaFile
   *            The name of a file defining schema elements
   * @return {@code true} if the file defines configuration elements,
   *         {@code false} otherwise
   */
  public static boolean is02ConfigLdif(String schemaFile)
  {
    return CONFIG_SCHEMA_ELEMENTS_FILE.equals(schemaFile);
  }
}