Template.java revision ca669ae54f86dbeea277280690584d9f591c7571
325N/A * The contents of this file are subject to the terms of the 325N/A * Common Development and Distribution License, Version 1.0 only 325N/A * (the "License"). You may not use this file except in compliance 325N/A * See the License for the specific language governing permissions 325N/A * and limitations under the License. 325N/A * When distributing Covered Code, include this CDDL HEADER in each 325N/A * If applicable, add the following below this CDDL HEADER, with the 325N/A * fields enclosed by brackets "[]" replaced with your own identifying 325N/A * Portions Copyright [yyyy] [name of copyright owner] 325N/A * Copyright 2006-2009 Sun Microsystems, Inc. 325N/A * Portions Copyright 2014-2015 ForgeRock AS 325N/A * This class defines a template, which is a pattern that may be used to 325N/A * generate entries. A template may be used either below a branch or below 325N/A // The attribute types that are used in the RDN for entries generated using 325N/A // The number of entries to create for each subordinate template. 325N/A // The name for this template. 325N/A // The names of the subordinate templates below this template. 325N/A // The subordinate templates below this template. 325N/A // The template file that contains this template. 325N/A // The set of template lines for this template. 325N/A * Creates a new template with the provided information. 325N/A * @param templateFile The template file that contains this 325N/A * @param name The name for this template. 325N/A * @param rdnAttributes The set of attribute types that are used 325N/A * in the RDN for entries generated using 325N/A * @param subordinateTemplateNames The names of the subordinate templates 325N/A * @param numEntriesPerTemplate The number of entries to create below * each subordinate template. * Creates a new template with the provided information. * @param templateFile The template file that contains this * @param name The name for this template. * @param rdnAttributes The set of attribute types that are used * in the RDN for entries generated using * @param subordinateTemplateNames The names of the subordinate templates * @param numEntriesPerTemplate The number of entries to create below * each subordinate template. * @param templateLines The set of template lines for this * Performs any necessary processing to ensure that the template * initialization is completed. In particular, it should make sure that all * referenced subordinate templates actually exist in the template file, and * that all of the RDN attributes are contained in the template lines. * @param templates The set of templates defined in the template file. * @throws MakeLDIFException If any of the subordinate templates are not * defined in the template file. // Make sure that all of the specified subordinate templates exist. // Make sure that all of the RDN attributes are defined. * Retrieves the name for this template. * @return The name for this template. * Retrieves the set of attribute types that are used in the RDN for entries * generated using this template. * @return The set of attribute types that are used in the RDN for entries * generated using this template. * Retrieves the names of the subordinate templates used to generate entries * below entries created by this template. * @return The names of the subordinate templates used to generate entries * below entries created by this template. * Retrieves the subordinate templates used to generate entries below entries * created by this template. * @return The subordinate templates used to generate entries below entries * created by this template. * Retrieves the number of entries that should be created for each subordinate * @return The number of entries that should be created for each subordinate * Retrieves the set of template lines for this template. * @return The set of template lines for this template. * Adds the provided template line to this template. * @param line The template line to add to this template. * Indicates whether this template contains any template lines that reference * the provided attribute type. * @param attributeType The attribute type for which to make the * @return <CODE>true</CODE> if this template contains one or more template * lines that reference the provided attribute type, or * <CODE>false</CODE> if not. * Writes the entry for this template, as well as all appropriate subordinate * @param entryWriter The entry writer that will be used to write the * @param parentDN The DN of the entry below which the subordinate * entries should be generated. * @param count The number of entries to generate based on this * @return The result that indicates whether processing should continue. * @throws IOException If a problem occurs while attempting to write to the * @throws MakeLDIFException If some other problem occurs. for (
int i=
0; i <
count; i++)
// We don't want to propagate a "stop processing parent" all the