001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008 Sun Microsystems, Inc.
015 */
016package org.forgerock.opendj.server.config.meta;
017
018
019
020import org.forgerock.opendj.config.AbstractManagedObjectDefinition;
021import org.forgerock.opendj.config.AdministratorAction;
022import org.forgerock.opendj.config.ClassPropertyDefinition;
023import org.forgerock.opendj.config.PropertyOption;
024import org.forgerock.opendj.config.Tag;
025import org.forgerock.opendj.config.TopCfgDefn;
026import org.forgerock.opendj.config.UndefinedDefaultBehaviorProvider;
027import org.forgerock.opendj.server.config.client.AuthenticationPolicyCfgClient;
028import org.forgerock.opendj.server.config.server.AuthenticationPolicyCfg;
029
030
031
032/**
033 * An interface for querying the Authentication Policy managed object
034 * definition meta information.
035 * <p>
036 * Authentication Policies define the policies which should be used
037 * for authenticating users and managing the password and other account
038 * related state.
039 */
040public final class AuthenticationPolicyCfgDefn extends AbstractManagedObjectDefinition<AuthenticationPolicyCfgClient, AuthenticationPolicyCfg> {
041
042  /** The singleton configuration definition instance. */
043  private static final AuthenticationPolicyCfgDefn INSTANCE = new AuthenticationPolicyCfgDefn();
044
045
046
047  /** The "java-class" property definition. */
048  private static final ClassPropertyDefinition PD_JAVA_CLASS;
049
050
051
052  /** Build the "java-class" property definition. */
053  static {
054      ClassPropertyDefinition.Builder builder = ClassPropertyDefinition.createBuilder(INSTANCE, "java-class");
055      builder.setOption(PropertyOption.MANDATORY);
056      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "java-class"));
057      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
058      builder.addInstanceOf("org.opends.server.api.AuthenticationPolicyFactory");
059      PD_JAVA_CLASS = builder.getInstance();
060      INSTANCE.registerPropertyDefinition(PD_JAVA_CLASS);
061  }
062
063
064
065  // Register the tags associated with this managed object definition.
066  static {
067    INSTANCE.registerTag(Tag.valueOf("user-management"));
068  }
069
070
071
072  /**
073   * Get the Authentication Policy configuration definition singleton.
074   *
075   * @return Returns the Authentication Policy configuration
076   *         definition singleton.
077   */
078  public static AuthenticationPolicyCfgDefn getInstance() {
079    return INSTANCE;
080  }
081
082
083
084  /**
085   * Private constructor.
086   */
087  private AuthenticationPolicyCfgDefn() {
088    super("authentication-policy", TopCfgDefn.getInstance());
089  }
090
091
092
093  /**
094   * Get the "java-class" property definition.
095   * <p>
096   * Specifies the fully-qualified name of the Java class which
097   * provides the Authentication Policy implementation.
098   *
099   * @return Returns the "java-class" property definition.
100   */
101  public ClassPropertyDefinition getJavaClassPropertyDefinition() {
102    return PD_JAVA_CLASS;
103  }
104}