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

Nicolas Capponi
06.26.2013 0cc438b6e04dd08b17b487198669e1806a8a3a3a
Checkpoint commit for OPENDJ-1075 Port server make-ldif tool to the SDK
CR-2539

* Remove use of schema validation policy as it is useless


1 files modified
26 ■■■■■ changed files
opendj3/opendj-core/src/main/java/org/forgerock/opendj/ldif/EntryGenerator.java 26 ●●●●● patch | view | raw | blame | history
opendj3/opendj-core/src/main/java/org/forgerock/opendj/ldif/EntryGenerator.java
@@ -43,7 +43,6 @@
import org.forgerock.opendj.ldap.DecodeException;
import org.forgerock.opendj.ldap.Entry;
import org.forgerock.opendj.ldap.schema.Schema;
import org.forgerock.opendj.ldap.schema.SchemaValidationPolicy;
import org.forgerock.opendj.ldif.TemplateFile.EntryWriter;
import org.forgerock.opendj.ldif.TemplateFile.TemplateEntry;
@@ -180,7 +179,6 @@
        private int randomSeed = DEFAULT_RANDOM_SEED;
        private String resourcePath = DEFAULT_RESOURCE_PATH;
        private Schema schema;
        private SchemaValidationPolicy schemaValidationPolicy;
        private Builder(String templatePath) {
            this.templatePath = templatePath;
@@ -247,26 +245,6 @@
        }
        /**
         * Specifies the schema validation which should be used when generating
         * entries. If attribute value validation is enabled then all checks
         * will be performed.
         * <p>
         * Schema validation is disabled by default.
         * <p>
         * <b>NOTE:</b> this method copies the provided policy so changes made
         * to it after this method has been called will have no effect.
         *
         * @param policy
         *            The schema validation which should be used when generating
         *            entries.
         * @return A reference to this {@code EntryGenerator.Builder}.
         */
        public Builder setSchemaValidationPolicy(final SchemaValidationPolicy policy) {
            this.schemaValidationPolicy = SchemaValidationPolicy.copyOf(policy);
            return this;
        }
        /**
         * Return an instance of reader.
         *
         * @return a new instance of reader
@@ -279,10 +257,6 @@
            if (schema == null) {
                schema = Schema.getDefaultSchema();
            }
            if (schemaValidationPolicy != null) {
                schema = schemaValidationPolicy.checkAttributesAndObjectClasses().needsChecking() ? schema
                        .asStrictSchema() : schema.asNonStrictSchema();
            }
            templateFile = new TemplateFile(schema, resourcePath, new Random(randomSeed));
            LinkedList<LocalizableMessage> warnings = new LinkedList<LocalizableMessage>();
            try {