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

Jean-Noël Rouvignac
01.39.2016 eca4a29bf5b638e7b8f7202c593c26fa1c336240
Make DirectoryString syntax the default or the server (as it has always been)

From the start the default syntax in the SDK has been OctetString, while the server used DirectoryString IIRC.
So right now, when creating DNs, if an attribute is unknown it will use OctetString instead of DirectoryString like in 2.6 .

This change brings back the default behaviour to the server. See on 2.6:
DN.decode():
https://stash.forgerock.org/projects/OPENDJ/repos/opendj/browse/src/server/org/opends/server/types/DN.java?at=refs%2Ftags%2F2.6.0#646
calls DirectoryServer.getDefaultAttributeType():
https://stash.forgerock.org/projects/OPENDJ/repos/opendj/browse/src/server/org/opends/server/core/DirectoryServer.java?at=2.6.0#4006
which delegates to DirectoryServer.getDefaultAttributeSyntax():
https://stash.forgerock.org/projects/OPENDJ/repos/opendj/browse/src/server/org/opends/server/core/DirectoryServer.java?at=2.6.0#4135
which is initialized as DirectoryString:
https://stash.forgerock.org/projects/OPENDJ/repos/opendj/browse/src/server/org/opends/server/core/DirectoryServer.java?at=2.6.0#1688
1 files modified
25 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java 25 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
@@ -16,6 +16,17 @@
 */
package org.opends.server.types;
import static org.forgerock.opendj.ldap.schema.CoreSchema.*;
import static org.forgerock.opendj.ldap.schema.SchemaOptions.*;
import static org.opends.messages.BackendMessages.*;
import static org.opends.messages.CoreMessages.*;
import static org.opends.messages.SchemaMessages.*;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.types.CommonSchemaElements.*;
import static org.opends.server.util.CollectionUtils.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
@@ -67,14 +78,6 @@
import org.opends.server.util.Base64;
import org.opends.server.util.ServerConstants;
import static org.opends.messages.BackendMessages.*;
import static org.opends.messages.CoreMessages.*;
import static org.opends.messages.SchemaMessages.*;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.util.CollectionUtils.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
/**
 * This class defines a data structure that holds information about
 * the components of the Directory Server schema.  It includes the
@@ -150,7 +153,11 @@
   */
  public Schema(org.forgerock.opendj.ldap.schema.Schema schemaNG) throws DirectoryException
  {
    switchSchema(schemaNG);
    final org.forgerock.opendj.ldap.schema.Schema newSchemaNG =
        new SchemaBuilder(schemaNG)
        .setOption(DEFAULT_SYNTAX_OID, getDirectoryStringSyntax().getOID())
        .toSchema();
    switchSchema(newSchemaNG);
    ldapSyntaxDescriptions = new ConcurrentHashMap<String,LDAPSyntaxDescription>();
    subordinateTypes = new ConcurrentHashMap<AttributeType,List<AttributeType>>();