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