Ejemplo n.º 1
0
  /**
   * Returns a schema used by upgrade(default octet string matching rule and directory string
   * syntax). Added attribute types which we know we are sensitive to in the unit tests, e.g.
   * ds-cfg-enabled (boolean syntax), ds-cfg-filter(case ingnore), ds-cfg-collation (case ignore)...
   * related to upgrade tasks. See OPENDJ-1245.
   *
   * @return A schema which may used in the upgrade context.
   */
  static Schema getUpgradeSchema() {
    final SchemaBuilder sb =
        new SchemaBuilder(Schema.getCoreSchema())
            .setOption(DEFAULT_MATCHING_RULE_OID, getCaseExactMatchingRule().getOID())
            .setOption(DEFAULT_SYNTAX_OID, getDirectoryStringSyntax().getOID());

    // Adds ds-cfg-enabled / boolean syntax
    sb.addAttributeType(
        "( 1.3.6.1.4.1.26027.1.1.2 NAME 'ds-cfg-enabled'"
            + " EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7"
            + " SINGLE-VALUE X-ORIGIN 'OpenDS Directory Server' )",
        false);

    // Adds ds-cfg-filter / ignore match syntax
    sb.addAttributeType(
        "( 1.3.6.1.4.1.26027.1.1.279 NAME 'ds-cfg-filter'"
            + " EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15"
            + " X-ORIGIN 'OpenDS Directory Server' )",
        false);

    // Adds ds-cfg-collation / ignore match syntax
    sb.addAttributeType(
        "( 1.3.6.1.4.1.26027.1.1.500 NAME 'ds-cfg-collation'"
            + " EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15"
            + " X-ORIGIN 'OpenDS Directory Server' )",
        false);

    return sb.toSchema().asNonStrictSchema();
  }
Ejemplo n.º 2
0
 /** {@inheritDoc} */
 @Override
 public Syntax getSDKSyntax(org.forgerock.opendj.ldap.schema.Schema schema) {
   return schema.getSyntax(SchemaConstants.SYNTAX_DIT_CONTENT_RULE_OID);
 }