org.opends.server.admin
Class LDAPProfile

java.lang.Object
  extended by org.opends.server.admin.LDAPProfile

public final class LDAPProfile
extends java.lang.Object

This class is used to map configuration elements to their LDAP schema names.

It is possible to augment the core LDAP profile with additional profile mappings at run-time using instances of LDAPProfile.Wrapper. This is useful for unit tests which need to add and remove mock components.


Nested Class Summary
static class LDAPProfile.Wrapper
          LDAP profile wrappers can be used to provide temporary LDAP profile information for components which do not have LDAP profile property files.
 
Method Summary
 java.lang.String getAttributeName(AbstractManagedObjectDefinition<?,?> d, PropertyDefinition<?> pd)
          Get the name of the LDAP attribute associated with the specified property definition.
static LDAPProfile getInstance()
          Get the global LDAP profile instance.
 java.lang.String getInstantiableRelationChildRDNType(InstantiableRelationDefinition<?,?> r)
          Gets the LDAP RDN attribute type for child entries of an instantiable relation.
 java.util.List<java.lang.String> getInstantiableRelationObjectClasses(InstantiableRelationDefinition<?,?> r)
          Gets the LDAP object classes associated with an instantiable relation branch.
 java.lang.String getObjectClass(AbstractManagedObjectDefinition<?,?> d)
          Get the principle object class associated with the specified definition.
 java.util.List<java.lang.String> getObjectClasses(AbstractManagedObjectDefinition<?,?> d)
          Get all the object classes associated with the specified definition.
 java.lang.String getRelationRDNSequence(RelationDefinition<?,?> r)
          Get an LDAP RDN sequence associatied with a relation.
 void popWrapper()
          Removes the last LDAP profile wrapper added using pushWrapper(org.opends.server.admin.LDAPProfile.Wrapper).
 void pushWrapper(LDAPProfile.Wrapper wrapper)
          Decorates the core LDAP profile with the provided LDAP profile wrapper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static LDAPProfile getInstance()
Get the global LDAP profile instance.

Returns:
Returns the global LDAP profile instance.

getAttributeName

public java.lang.String getAttributeName(AbstractManagedObjectDefinition<?,?> d,
                                         PropertyDefinition<?> pd)
                                  throws java.util.MissingResourceException
Get the name of the LDAP attribute associated with the specified property definition.

Parameters:
d - The managed object definition.
pd - The property definition.
Returns:
Returns the name of the LDAP attribute associated with the specified property definition.
Throws:
java.util.MissingResourceException - If the LDAP profile properties file associated with the provided managed object definition could not be loaded.

getInstantiableRelationChildRDNType

public java.lang.String getInstantiableRelationChildRDNType(InstantiableRelationDefinition<?,?> r)
                                                     throws java.util.MissingResourceException
Gets the LDAP RDN attribute type for child entries of an instantiable relation.

Parameters:
r - The instantiable relation.
Returns:
Returns the LDAP RDN attribute type for child entries of an instantiable relation.
Throws:
java.util.MissingResourceException - If the LDAP profile properties file associated with the provided managed object definition could not be loaded.

getInstantiableRelationObjectClasses

public java.util.List<java.lang.String> getInstantiableRelationObjectClasses(InstantiableRelationDefinition<?,?> r)
Gets the LDAP object classes associated with an instantiable relation branch. The branch is the parent entry of child managed objects.

Parameters:
r - The instantiable relation.
Returns:
Returns the LDAP object classes associated with an instantiable relation branch.

getObjectClass

public java.lang.String getObjectClass(AbstractManagedObjectDefinition<?,?> d)
                                throws java.util.MissingResourceException
Get the principle object class associated with the specified definition.

Parameters:
d - The managed object definition.
Returns:
Returns the principle object class associated with the specified definition.
Throws:
java.util.MissingResourceException - If the LDAP profile properties file associated with the provided managed object definition could not be loaded.

getObjectClasses

public java.util.List<java.lang.String> getObjectClasses(AbstractManagedObjectDefinition<?,?> d)
                                                  throws java.util.MissingResourceException
Get all the object classes associated with the specified definition.

The returned list is ordered such that the uppermost object classes appear first (e.g. top).

Parameters:
d - The managed object definition.
Returns:
Returns all the object classes associated with the specified definition.
Throws:
java.util.MissingResourceException - If the LDAP profile properties file associated with the provided managed object definition could not be loaded.

getRelationRDNSequence

public java.lang.String getRelationRDNSequence(RelationDefinition<?,?> r)
                                        throws java.util.MissingResourceException
Get an LDAP RDN sequence associatied with a relation.

Parameters:
r - The relation.
Returns:
Returns the LDAP RDN sequence associatied with a relation.
Throws:
java.util.MissingResourceException - If the LDAP profile properties file associated with the provided managed object definition could not be loaded.

popWrapper

public void popWrapper()
                throws java.util.NoSuchElementException
Removes the last LDAP profile wrapper added using pushWrapper(org.opends.server.admin.LDAPProfile.Wrapper).

Throws:
java.util.NoSuchElementException - If there are no LDAP profile wrappers.

pushWrapper

public void pushWrapper(LDAPProfile.Wrapper wrapper)
Decorates the core LDAP profile with the provided LDAP profile wrapper. All profile requests will be directed to the provided wrapper before being forwarded onto the core profile if the request could not be satisfied.

Parameters:
wrapper - The LDAP profile wrapper.