Package org.opends.server.tools.makeldif
Class TemplateEntry
- java.lang.Object
-
- org.opends.server.tools.makeldif.TemplateEntry
-
public class TemplateEntry extends Object
This class defines an entry that is generated using a MakeLDIF branch or template.
-
-
Constructor Summary
Constructors Constructor Description TemplateEntry(Branch branch)Creates a new template entry that will be associated with the provided branch.TemplateEntry(Template template, DN parentDN)Creates a new template entry that will be associated with the provided template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(TemplateValue value)Adds the provided template value to this entry.BranchgetBranch()Retrieves the branch used to generate this entry.DNgetDN()Retrieves the DN for this template entry, if it is known.DNgetParentDN()Retrieves the DN of the parent entry for this template entry.TemplategetTemplate()Retrieves the template used to generate this entry.TemplateValuegetValue(AttributeType attributeType)Retrieves the value for the specified attribute, if defined.List<TemplateValue>getValues(AttributeType attributeType)Retrieves the set of values for the specified attribute, if defined.booleantoLDIF(LDIFExportConfig exportConfig)Writes this entry in LDIF form.
-
-
-
Constructor Detail
-
TemplateEntry
public TemplateEntry(Branch branch)
Creates a new template entry that will be associated with the provided branch.- Parameters:
branch- The branch to use when creating this template entry.
-
-
Method Detail
-
getBranch
public Branch getBranch()
Retrieves the branch used to generate this entry.- Returns:
- The branch used to generate this entry, or
nullif it is associated with a template instead of a branch.
-
getTemplate
public Template getTemplate()
Retrieves the template used to generate this entry.- Returns:
- The template used to generate this entry, or
nullif it is associated with a branch instead of a template.
-
getParentDN
public DN getParentDN()
Retrieves the DN of the parent entry for this template entry.- Returns:
- The DN of the parent entry for this template entry, or
nullif there is no parent DN.
-
getDN
public DN getDN()
Retrieves the DN for this template entry, if it is known.- Returns:
- The DN for this template entry if it is known, or
nullif it cannot yet be determined.
-
getValue
public TemplateValue getValue(AttributeType attributeType)
Retrieves the value for the specified attribute, if defined. If the specified attribute has multiple values, then the first will be returned.- Parameters:
attributeType- The attribute type for which to retrieve the value.- Returns:
- The value for the specified attribute, or
nullif there are no values for that attribute type.
-
getValues
public List<TemplateValue> getValues(AttributeType attributeType)
Retrieves the set of values for the specified attribute, if defined.- Parameters:
attributeType- The attribute type for which to retrieve the set of values.- Returns:
- The set of values for the specified attribute, or
nullif there are no values for that attribute type.
-
addValue
public void addValue(TemplateValue value)
Adds the provided template value to this entry.- Parameters:
value- The value to add to this entry.
-
toLDIF
public boolean toLDIF(LDIFExportConfig exportConfig) throws IOException, LDIFException
Writes this entry in LDIF form. No filtering will be performed for this entry, nor will any export plugins be invoked.- Parameters:
exportConfig- The configuration that specifies how the entry should be written.- Returns:
trueif the entry is actually written, orfalseif it is not for some reason.- Throws:
IOException- If a problem occurs while writing the information.LDIFException- If a problem occurs while trying to determine whether to write the entry.
-
-