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

Nicolas Capponi
03.05.2014 b9b67dc5c60f7fd95391ff7be7ff4c343dbc22af
Checkpoint commit for OPENDJ-1308 Migrate schema support

Add configuration for schema providers

* SchemaProviderConfiguration : abstract definition of provider
* CoreSchemaProviderConfiguration : provides the core schema,
including core matching rules and syntaxes
* RootConfiguration : includes one-to-many relation to schema providers
2 files added
1 files modified
281 ■■■■■ changed files
opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/CoreSchemaConfiguration.xml 189 ●●●●● patch | view | raw | blame | history
opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/RootConfiguration.xml 13 ●●●●● patch | view | raw | blame | history
opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/SchemaProviderConfiguration.xml 79 ●●●●● patch | view | raw | blame | history
opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/CoreSchemaConfiguration.xml
New file
@@ -0,0 +1,189 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
  ! CDDL HEADER START
  !
  ! The contents of this file are subject to the terms of the
  ! Common Development and Distribution License, Version 1.0 only
  ! (the "License").  You may not use this file except in compliance
  ! with the License.
  !
  ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
  ! or http://forgerock.org/license/CDDLv1.0.html.
  ! See the License for the specific language governing permissions
  ! and limitations under the License.
  !
  ! When distributing Covered Code, include this CDDL HEADER in each
  ! file and include the License file at legal-notices/CDDLv1_0.txt.
  ! If applicable, add the following below this CDDL HEADER, with the
  ! fields enclosed by brackets "[]" replaced with your own identifying
  ! information:
  !      Portions Copyright [yyyy] [name of copyright owner]
  !
  ! CDDL HEADER END
  !
  !
  !      Copyright 2014 ForgeRock AS.
  ! -->
<adm:managed-object name="core-schema" plural-name="core-schemas"
  extends="schema-provider"
  package="org.forgerock.opendj.server.config"
  xmlns:adm="http://opendj.forgerock.org/admin"
  xmlns:ldap="http://opendj.forgerock.org/admin-ldap"
  xmlns:cli="http://opendj.forgerock.org/admin-cli">
  <adm:synopsis>
    <adm:user-friendly-name />
    define the core schema elements to load.
  </adm:synopsis>
  <adm:description>
    Core schema provider configuration.
  </adm:description>
  <adm:profile name="ldap">
    <ldap:object-class>
      <ldap:name>ds-cfg-core-schema</ldap:name>
      <ldap:superior>ds-cfg-schema-provider</ldap:superior>
    </ldap:object-class>
  </adm:profile>
  <adm:property-override name="java-class" advanced="true">
    <adm:default-behavior>
      <adm:defined>
        <adm:value>
          org.opends.server.schema.CoreSchemaProvider
        </adm:value>
      </adm:defined>
    </adm:default-behavior>
  </adm:property-override>
  <adm:property name="disabled-matching-rule" multi-valued="true">
   <adm:synopsis>
     The set of disabled matching rules.
   </adm:synopsis>
   <adm:description>
      Matching rules must be specified using the syntax: OID,
      or use the default value 'NONE' to specify no value.
   </adm:description>
   <adm:default-behavior>
     <adm:defined>
       <adm:value>NONE</adm:value>
     </adm:defined>
   </adm:default-behavior>
   <adm:syntax>
     <adm:string>
       <adm:pattern>
          <adm:regex>^([0-9.]+\\d|NONE)$</adm:regex>
          <adm:usage>OID</adm:usage>
          <adm:synopsis>
            The OID of the disabled matching rule.
          </adm:synopsis>
        </adm:pattern>
       </adm:string>
   </adm:syntax>
   <adm:profile name="ldap">
     <ldap:attribute>
       <ldap:name>ds-cfg-disabled-matching-rule</ldap:name>
     </ldap:attribute>
   </adm:profile>
 </adm:property>
 <adm:property name="disabled-syntax" multi-valued="true">
   <adm:synopsis>
     The set of disabled syntaxes.
   </adm:synopsis>
   <adm:description>
      Syntaxes must be specified using the syntax: OID,
      or use the default value 'NONE' to specify no value.
   </adm:description>
   <adm:default-behavior>
      <adm:defined>
        <adm:value>NONE</adm:value>
      </adm:defined>
   </adm:default-behavior>
   <adm:syntax>
     <adm:string>
       <adm:pattern>
          <adm:regex>^([0-9.]+\\d|NONE)$</adm:regex>
          <adm:usage>OID</adm:usage>
          <adm:synopsis>
            The OID of the disabled syntax, or NONE
          </adm:synopsis>
        </adm:pattern>
       </adm:string>
   </adm:syntax>
   <adm:profile name="ldap">
     <ldap:attribute>
       <ldap:name>ds-cfg-disabled-syntax</ldap:name>
     </ldap:attribute>
   </adm:profile>
 </adm:property>
 <adm:property name="strip-syntax-min-upper-bound-attribute-type-description" advanced="true">
    <adm:synopsis>
      Indicates whether the suggested minimum upper bound appended to an
      attribute's syntax OID in it's schema definition Attribute Type
      Description is stripped off.
    </adm:synopsis>
    <adm:description>
      When retrieving the server's schema, some APIs (JNDI) fail in
      their syntax lookup methods, because they do not parse this value
      correctly. This configuration option allows the server to be
      configured to provide schema definitions these APIs can parse
      correctly.
    </adm:description>
    <adm:default-behavior>
      <adm:defined>
        <adm:value>false</adm:value>
      </adm:defined>
    </adm:default-behavior>
    <adm:syntax>
      <adm:boolean />
    </adm:syntax>
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:name>ds-cfg-strip-syntax-min-upper-bound-attribute-type-description</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
  <adm:property name="strict-format-country-string" advanced="true">
    <adm:synopsis>
      Indicates whether or not country code values are required to
      strictly comply with the standard definition for this syntax.
    </adm:synopsis>
    <adm:description>
      When set to false, country codes will not be validated and, as
      a result any string containing 2 characters will be acceptable.
    </adm:description>
    <adm:default-behavior>
      <adm:defined>
        <adm:value>true</adm:value>
      </adm:defined>
    </adm:default-behavior>
    <adm:syntax>
      <adm:boolean />
    </adm:syntax>
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:name>ds-cfg-strict-format-country-string</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
    <adm:property name="allow-zero-length-values-directory-string" advanced="true">
    <adm:synopsis>
      Indicates whether zero-length (that is, an empty string) values are
      allowed for directory string.
    </adm:synopsis>
    <adm:description>
      This is technically not allowed by the revised LDAPv3
      specification, but some environments may require it for backward
      compatibility with servers that do allow it.
    </adm:description>
    <adm:default-behavior>
      <adm:defined>
        <adm:value>false</adm:value>
      </adm:defined>
    </adm:default-behavior>
    <adm:syntax>
      <adm:boolean />
    </adm:syntax>
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:name>ds-cfg-allow-zero-length-values-directory-string</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
</adm:managed-object>
opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/RootConfiguration.xml
@@ -23,7 +23,7 @@
  !
  !
  !      Copyright 2007-2010 Sun Microsystems, Inc.
  !      Portions Copyright 2011 ForgeRock AS
  !      Portions Copyright 2011-2014 ForgeRock AS
  ! -->
<adm:root-managed-object xmlns:adm="http://opendj.forgerock.org/admin"
  xmlns:ldap="http://opendj.forgerock.org/admin-ldap"
@@ -40,6 +40,17 @@
      <ldap:rdn-sequence>cn=config</ldap:rdn-sequence>
    </adm:profile>
  </adm:relation>
  <adm:relation name="schema-provider">
    <adm:one-to-many />
    <adm:profile name="ldap">
      <ldap:rdn-sequence>cn=Schema Providers,cn=config</ldap:rdn-sequence>
    </adm:profile>
     <adm:profile name="cli">
      <cli:relation>
        <cli:default-property name="enabled" />
      </cli:relation>
    </adm:profile>
  </adm:relation>
  <adm:relation name="connection-handler">
    <adm:one-to-many />
    <adm:profile name="ldap">
opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/SchemaProviderConfiguration.xml
New file
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
  ! CDDL HEADER START
  !
  ! The contents of this file are subject to the terms of the
  ! Common Development and Distribution License, Version 1.0 only
  ! (the "License").  You may not use this file except in compliance
  ! with the License.
  !
  ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
  ! or http://forgerock.org/license/CDDLv1.0.html.
  ! See the License for the specific language governing permissions
  ! and limitations under the License.
  !
  ! When distributing Covered Code, include this CDDL HEADER in each
  ! file and include the License file at legal-notices/CDDLv1_0.txt.
  ! If applicable, add the following below this CDDL HEADER, with the
  ! fields enclosed by brackets "[]" replaced with your own identifying
  ! information:
  !      Portions Copyright [yyyy] [name of copyright owner]
  !
  ! CDDL HEADER END
  !
  !
  !      Copyright 2014 ForgeRock AS.
  ! -->
<adm:managed-object name="schema-provider" plural-name="schema-providers"
    package="org.forgerock.opendj.server.config"
  xmlns:adm="http://opendj.forgerock.org/admin"
  xmlns:ldap="http://opendj.forgerock.org/admin-ldap"
  xmlns:cli="http://opendj.forgerock.org/admin-cli">
  <adm:synopsis>
    <adm:user-friendly-plural-name />
    define the schema elements to load.
  </adm:synopsis>
  <adm:description>
    Schema provider configuration.
  </adm:description>
  <adm:profile name="ldap">
    <ldap:object-class>
      <ldap:name>ds-cfg-schema-provider</ldap:name>
      <ldap:superior>top</ldap:superior>
    </ldap:object-class>
  </adm:profile>
    <adm:property name="enabled" mandatory="true">
    <adm:synopsis>
      Indicates whether the
      <adm:user-friendly-name />
      is enabled for use.
    </adm:synopsis>
    <adm:syntax>
      <adm:boolean />
    </adm:syntax>
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:name>ds-cfg-enabled</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
  <adm:property name="java-class" mandatory="true">
    <adm:synopsis>
      Specifies the fully-qualified name of the Java class that provides the
      <adm:user-friendly-name />
      implementation.
    </adm:synopsis>
    <adm:syntax>
      <adm:java-class>
        <adm:instance-of>
          org.opends.server.schema.SchemaProvider
        </adm:instance-of>
      </adm:java-class>
    </adm:syntax>
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:name>ds-cfg-java-class</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
</adm:managed-object>