com.sun.slamd.scripting.ldap
Class LDAPEntryTemplate

java.lang.Object
  extended bycom.sun.slamd.scripting.ldap.LDAPEntryTemplate
All Implemented Interfaces:
java.lang.Cloneable

public class LDAPEntryTemplate
extends java.lang.Object
implements java.lang.Cloneable

This class defines a template that contains the information used to generate LDAP entries.


Constructor Summary
LDAPEntryTemplate(java.lang.String templateName, java.lang.String rdnAttribute)
          Creates a new template with the specified name and RDN attribute.
LDAPEntryTemplate(java.lang.String templateName, java.lang.String rdnAttribute, java.lang.String parentTemplateName)
          Creates a new template with the specified name and RDN attribute that extends the given parent template.
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.String separator, java.lang.String value)
          Adds a new attribute definition to this template.
 void addCounter(java.lang.String attributeName, SequentialValueCounter counter)
          Adds the specified sequential value counter for use with this template.
 java.lang.Object clone()
          Creates a clone of this template.
 void completeInitialization()
          Converts the information read into lists into a two-dimensional array for more efficient processing.
 java.lang.String[][] getAttributeComponents()
          Retrieves the attribute components of this template in the form of a two-dimensional array.
 int getCounterValue(java.lang.String attributeName)
          Retrieves the next value that should be used for the specified sequential value counter.
 java.lang.String getName()
          Retrieves the name of this template.
 java.lang.String getParentTemplateName()
          Retrieves the name of the parent template for this template.
 java.lang.String getRDNAttribute()
          Retrieves the value for this template.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDAPEntryTemplate

public LDAPEntryTemplate(java.lang.String templateName,
                         java.lang.String rdnAttribute)
Creates a new template with the specified name and RDN attribute.

Parameters:
templateName - The name of this template.
rdnAttribute - The name of the attribute that will be used for the RDN component of entries created from this template.

LDAPEntryTemplate

public LDAPEntryTemplate(java.lang.String templateName,
                         java.lang.String rdnAttribute,
                         java.lang.String parentTemplateName)
Creates a new template with the specified name and RDN attribute that extends the given parent template.

Parameters:
templateName - The name of this template.
rdnAttribute - The name of the attribute that will be used for the RDN component of entries created from this template.
parentTemplateName - The name of the template that this template should extend.
Method Detail

getName

public java.lang.String getName()
Retrieves the name of this template.

Returns:
The name of this template.

getRDNAttribute

public java.lang.String getRDNAttribute()
Retrieves the value for this template.

Returns:
The value for this template.

getParentTemplateName

public java.lang.String getParentTemplateName()
Retrieves the name of the parent template for this template.

Returns:
The name of the parent template for this template.

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String separator,
                         java.lang.String value)
Adds a new attribute definition to this template.

Parameters:
name - The name of the attribute.
separator - The separator that should appear between the attribute name and value.
value - The value (or template to use for creating the value).

completeInitialization

public void completeInitialization()
Converts the information read into lists into a two-dimensional array for more efficient processing. Note that the attribute name is stored twice (once in the user-specified case and once in lowercase) for faster processing later.


getAttributeComponents

public java.lang.String[][] getAttributeComponents()
Retrieves the attribute components of this template in the form of a two-dimensional array.

Returns:
The attribute components of this template in the form of a two-dimensional array.

clone

public java.lang.Object clone()
Creates a clone of this template.

Returns:
The clone of this template.

getCounterValue

public int getCounterValue(java.lang.String attributeName)
Retrieves the next value that should be used for the specified sequential value counter. If there is no value counter defined for the specified attribute, then a value of Integer.MIN_VALUE will be returned.

Parameters:
attributeName - The name of the attribute for which to retrieve the next counter value.
Returns:
The next counter value, or Integer.MIN_VALUE if the specified attribute does not have a counter associated with it.

addCounter

public void addCounter(java.lang.String attributeName,
                       SequentialValueCounter counter)
Adds the specified sequential value counter for use with this template.

Parameters:
attributeName - The name of the attribute for which this counter is to be used.
counter - The counter to associated with the attribute.