0N/A/*
0N/A * CDDL HEADER START
0N/A *
0N/A * The contents of this file are subject to the terms of the
0N/A * Common Development and Distribution License, Version 1.0 only
0N/A * (the "License"). You may not use this file except in compliance
0N/A * with the License.
0N/A *
0N/A * You can obtain a copy of the license at
0N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE
0N/A * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
0N/A * See the License for the specific language governing permissions
0N/A * and limitations under the License.
0N/A *
0N/A * When distributing Covered Code, include this CDDL HEADER in each
0N/A * file and include the License file at
0N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
0N/A * add the following below this CDDL HEADER, with the fields enclosed
873N/A * by brackets "[]" replaced with your own identifying information:
0N/A * Portions Copyright [yyyy] [name of copyright owner]
0N/A *
0N/A * CDDL HEADER END
0N/A *
0N/A *
3215N/A * Copyright 2006-2008 Sun Microsystems, Inc.
0N/A */
0N/Apackage org.opends.server.api;
2086N/Aimport org.opends.messages.Message;
0N/A
0N/A
0N/A
1787N/Aimport java.util.List;
1787N/A
1008N/Aimport org.opends.server.admin.std.server.IdentityMapperCfg;
0N/Aimport org.opends.server.config.ConfigException;
338N/Aimport org.opends.server.types.DirectoryException;
0N/Aimport org.opends.server.types.Entry;
338N/Aimport org.opends.server.types.InitializationException;
0N/A
0N/A
0N/A
0N/A/**
0N/A * This class defines the set of methods and structures that must be
0N/A * implemented by a Directory Server identity mapper. An identity
0N/A * mapper is used to identify exactly one user associated with a given
0N/A * identification value. This API may be used by a number of SASL
0N/A * mechanisms to identify the user that is authenticating to the
0N/A * server. It may also be used in other areas, like in conjunction
0N/A * with the proxied authorization control.
1008N/A *
1008N/A * @param <T> The type of configuration handled by this identity
1008N/A * mapper.
0N/A */
2095N/A@org.opends.server.types.PublicAPI(
2095N/A stability=org.opends.server.types.StabilityLevel.VOLATILE,
2095N/A mayInstantiate=false,
2095N/A mayExtend=true,
2095N/A mayInvoke=true)
0N/Apublic abstract class IdentityMapper
1008N/A <T extends IdentityMapperCfg>
0N/A{
0N/A /**
0N/A * Initializes this identity mapper based on the information in the
0N/A * provided configuration entry.
0N/A *
1008N/A * @param configuration The configuration for the identity mapper.
0N/A *
0N/A * @throws ConfigException If an unrecoverable problem arises in
0N/A * the process of performing the
0N/A * initialization.
0N/A *
0N/A * @throws InitializationException If a problem occurs during
0N/A * initialization that is not
0N/A * related to the server
0N/A * configuration.
0N/A */
1008N/A public abstract void initializeIdentityMapper(T configuration)
0N/A throws ConfigException, InitializationException;
0N/A
0N/A
0N/A
0N/A /**
1787N/A * Indicates whether the provided configuration is acceptable for
1787N/A * this identity mapper. It should be possible to call this method
1787N/A * on an uninitialized identity mapper instance in order to
1787N/A * determine whether the identity mapper would be able to use the
1787N/A * provided configuration.
1787N/A * <BR><BR>
1787N/A * Note that implementations which use a subclass of the provided
1787N/A * configuration class will likely need to cast the configuration
1787N/A * to the appropriate subclass type.
1787N/A *
1787N/A * @param configuration The identity mapper configuration
1787N/A * for which to make the determination.
1787N/A * @param unacceptableReasons A list that may be used to hold the
1787N/A * reasons that the provided
1787N/A * configuration is not acceptable.
1787N/A *
1787N/A * @return {@code true} if the provided configuration is acceptable
1787N/A * for this identity mapper, or {@code false} if not.
1787N/A */
1787N/A public boolean isConfigurationAcceptable(
1787N/A IdentityMapperCfg configuration,
2086N/A List<Message> unacceptableReasons)
1787N/A {
1787N/A // This default implementation does not perform any special
1787N/A // validation. It should be overridden by identity mapper
1787N/A // implementations that wish to perform more detailed validation.
1787N/A return true;
1787N/A }
1787N/A
1787N/A
1787N/A
1787N/A /**
0N/A * Performs any finalization that may be necessary for this identity
0N/A * mapper. By default, no finalization is performed.
0N/A */
205N/A public void finalizeIdentityMapper()
0N/A {
0N/A // No implementation is required by default.
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Retrieves the user entry that was mapped to the provided
0N/A * identification string.
0N/A *
0N/A * @param id The identification string that is to be mapped to a
0N/A * user.
0N/A *
0N/A * @return The user entry that was mapped to the provided
2095N/A * identification, or {@code null} if no users were found
2095N/A * that could be mapped to the provided ID.
0N/A *
0N/A * @throws DirectoryException If a problem occurs while attempting
0N/A * to map the given ID to a user entry,
0N/A * or if there are multiple user
0N/A * entries that could map to the
0N/A * provided ID.
0N/A */
0N/A public abstract Entry getEntryForID(String id)
0N/A throws DirectoryException;
0N/A}
0N/A