f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew/*
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * CDDL HEADER START
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew *
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * The contents of this file are subject to the terms of the
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * Common Development and Distribution License, Version 1.0 only
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * (the "License"). You may not use this file except in compliance
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * with the License.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew *
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * or http://forgerock.org/license/CDDLv1.0.html.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * See the License for the specific language governing permissions
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * and limitations under the License.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew *
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * When distributing Covered Code, include this CDDL HEADER in each
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * file and include the License file at legal-notices/CDDLv1_0.txt.
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * If applicable, add the following below this CDDL HEADER, with the
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * fields enclosed by brackets "[]" replaced with your own identifying
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * information:
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * Portions Copyright [yyyy] [name of copyright owner]
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew *
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * CDDL HEADER END
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew *
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew *
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * Copyright 2011 ForgeRock AS.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew */
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthewpackage org.opends.server.api;
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthewimport java.util.List;
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthewimport org.opends.messages.Message;
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthewimport org.opends.server.admin.std.server.AuthenticationPolicyCfg;
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthewimport org.opends.server.config.ConfigException;
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthewimport org.opends.server.types.InitializationException;
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew/**
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * A factory for creating configurable authentication policies.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * <p>
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * All implementations must have a default constructor, i.e. one that does not
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * require and arguments.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew *
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * @param <T>
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * The type of authentication policy configuration handled by this
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * factory.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew */
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthewpublic interface AuthenticationPolicyFactory<T extends AuthenticationPolicyCfg>
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew{
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew /**
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * Creates a new authentication policy using the provided configuration.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew *
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * @param configuration
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * The configuration.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * @return The new authentication policy configured using the provided
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * configuration.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * @throws ConfigException
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * If an unrecoverable problem arises during initialization of the
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * authentication policy as a result of the server configuration.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * @throws InitializationException
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * If a problem occurs during initialization of the authentication
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * policy.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew */
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew AuthenticationPolicy createAuthenticationPolicy(T configuration)
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew throws ConfigException, InitializationException;
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew /**
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * Indicates whether the provided authentication policy configuration is
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * acceptable.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew *
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * @param configuration
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * The authentication policy configuration.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * @param unacceptableReasons
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * A list that can be used to hold messages about why the provided
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * configuration is not acceptable.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * @return Returns <code>true</code> if the provided authentication policy
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew * configuration is acceptable, or <code>false</code> if it is not.
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew */
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew boolean isConfigurationAcceptable(T configuration,
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew List<Message> unacceptableReasons);
f43bf60164dfc1ac60e5332f7a17ca1425c88268matthew}