opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/SchemaValidationPolicy.java
@@ -21,7 +21,7 @@ * CDDL HEADER END * * * Copyright 2011-2012 ForgeRock AS * Copyright 2011-2013 ForgeRock AS */ package org.forgerock.opendj.ldap.schema; @@ -405,6 +405,21 @@ return this; } /** * Returns a strict view of the provided schema if the this policy is * configured to check attributes and object class, or a non-strict view of * the schema if not. * * @param schema * The schema to be adapted according to this policy. * @return A strict or non-strict view of {@code schema} depending on * {@link #checkAttributesAndObjectClasses()}. */ public Schema adaptSchemaForValidation(final Schema schema) { return checkAttributesAndObjectClasses().needsChecking() ? schema.asStrictSchema() : schema .asNonStrictSchema(); } // Assigns the provided options to this set of options. SchemaValidationPolicy assign(final SchemaValidationPolicy policy) { this.checkAttributeValues = policy.checkAttributeValues; opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFChangeRecordReader.java
@@ -22,7 +22,7 @@ * * * Copyright 2009-2010 Sun Microsystems, Inc. * Portions copyright 2011-2012 ForgeRock AS * Portions copyright 2011-2013 ForgeRock AS */ package org.forgerock.opendj.ldif; @@ -375,9 +375,7 @@ */ public LDIFChangeRecordReader setSchema(final Schema schema) { Validator.ensureNotNull(schema); this.schema = schemaValidationPolicy.checkAttributesAndObjectClasses().needsChecking() ? schema .asStrictSchema() : schema.asNonStrictSchema(); this.schema = schemaValidationPolicy.adaptSchemaForValidation(schema); return this; } @@ -398,9 +396,7 @@ */ public LDIFChangeRecordReader setSchemaValidationPolicy(final SchemaValidationPolicy policy) { this.schemaValidationPolicy = SchemaValidationPolicy.copyOf(policy); this.schema = schemaValidationPolicy.checkAttributesAndObjectClasses().needsChecking() ? schema .asStrictSchema() : schema.asNonStrictSchema(); this.schema = schemaValidationPolicy.adaptSchemaForValidation(schema); return this; } opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFEntryReader.java
@@ -347,9 +347,7 @@ */ public LDIFEntryReader setSchema(final Schema schema) { Validator.ensureNotNull(schema); this.schema = schemaValidationPolicy.checkAttributesAndObjectClasses().needsChecking() ? schema .asStrictSchema() : schema.asNonStrictSchema(); this.schema = schemaValidationPolicy.adaptSchemaForValidation(schema); return this; } @@ -370,9 +368,7 @@ */ public LDIFEntryReader setSchemaValidationPolicy(final SchemaValidationPolicy policy) { this.schemaValidationPolicy = SchemaValidationPolicy.copyOf(policy); this.schema = schemaValidationPolicy.checkAttributesAndObjectClasses().needsChecking() ? schema .asStrictSchema() : schema.asNonStrictSchema(); this.schema = schemaValidationPolicy.adaptSchemaForValidation(schema); return this; }