org.opends.server.api
Class IdentityMapper<T extends IdentityMapperCfg>

java.lang.Object
  extended by org.opends.server.api.IdentityMapper<T>
Type Parameters:
T - The type of configuration handled by this identity mapper.
Direct Known Subclasses:
ExactMatchIdentityMapper, RegularExpressionIdentityMapper

@PublicAPI(stability=VOLATILE,
           mayInstantiate=false,
           mayExtend=true,
           mayInvoke=true)
public abstract class IdentityMapper<T extends IdentityMapperCfg>
extends java.lang.Object

This class defines the set of methods and structures that must be implemented by a Directory Server identity mapper. An identity mapper is used to identify exactly one user associated with a given identification value. This API may be used by a number of SASL mechanisms to identify the user that is authenticating to the server. It may also be used in other areas, like in conjunction with the proxied authorization control.


Constructor Summary
IdentityMapper()
           
 
Method Summary
 void finalizeIdentityMapper()
          Performs any finalization that may be necessary for this identity mapper.
abstract  Entry getEntryForID(java.lang.String id)
          Retrieves the user entry that was mapped to the provided identification string.
abstract  void initializeIdentityMapper(T configuration)
          Initializes this identity mapper based on the information in the provided configuration entry.
 boolean isConfigurationAcceptable(IdentityMapperCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the provided configuration is acceptable for this identity mapper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentityMapper

public IdentityMapper()
Method Detail

initializeIdentityMapper

public abstract void initializeIdentityMapper(T configuration)
                                       throws ConfigException,
                                              InitializationException
Initializes this identity mapper based on the information in the provided configuration entry.

Parameters:
configuration - The configuration for the identity mapper.
Throws:
ConfigException - If an unrecoverable problem arises in the process of performing the initialization.
InitializationException - If a problem occurs during initialization that is not related to the server configuration.

isConfigurationAcceptable

public boolean isConfigurationAcceptable(IdentityMapperCfg configuration,
                                         java.util.List<Message> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this identity mapper. It should be possible to call this method on an uninitialized identity mapper instance in order to determine whether the identity mapper would be able to use the provided configuration.

Note that implementations which use a subclass of the provided configuration class will likely need to cast the configuration to the appropriate subclass type.

Parameters:
configuration - The identity mapper configuration for which to make the determination.
unacceptableReasons - A list that may be used to hold the reasons that the provided configuration is not acceptable.
Returns:
true if the provided configuration is acceptable for this identity mapper, or false if not.

finalizeIdentityMapper

public void finalizeIdentityMapper()
Performs any finalization that may be necessary for this identity mapper. By default, no finalization is performed.


getEntryForID

public abstract Entry getEntryForID(java.lang.String id)
                             throws DirectoryException
Retrieves the user entry that was mapped to the provided identification string.

Parameters:
id - The identification string that is to be mapped to a user.
Returns:
The user entry that was mapped to the provided identification, or null if no users were found that could be mapped to the provided ID.
Throws:
DirectoryException - If a problem occurs while attempting to map the given ID to a user entry, or if there are multiple user entries that could map to the provided ID.