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 2010 Sun Microsystems, Inc. 025 */ 026package org.forgerock.opendj.ldap.controls; 027 028/** 029 * A password policy warning type as defined in 030 * draft-behera-ldap-password-policy is used to indicate the current state of a 031 * user's password. More specifically, the number of seconds before a password 032 * will expire, or the remaining number of times a user will be allowed to 033 * authenticate with an expired password. 034 * 035 * @see PasswordPolicyRequestControl 036 * @see PasswordPolicyResponseControl 037 * @see PasswordPolicyErrorType 038 * @see <a href="http://tools.ietf.org/html/draft-behera-ldap-password-policy"> 039 * draft-behera-ldap-password-policy - Password Policy for LDAP Directories 040 * </a> 041 */ 042public enum PasswordPolicyWarningType { 043 /** 044 * Indicates the number of seconds before a password will expire. 045 */ 046 TIME_BEFORE_EXPIRATION(0, "timeBeforeExpiration"), 047 048 /** 049 * Indicates the remaining number of times a user will be allowed to 050 * authenticate with an expired password. 051 */ 052 GRACE_LOGINS_REMAINING(1, "graceAuthNsRemaining"); 053 054 private final int intValue; 055 056 private final String name; 057 058 private PasswordPolicyWarningType(final int intValue, final String name) { 059 this.intValue = intValue; 060 this.name = name; 061 } 062 063 /** {@inheritDoc} */ 064 @Override 065 public String toString() { 066 return name; 067 } 068 069 /** 070 * Returns the integer value for this password policy warning type. 071 * 072 * @return The integer value for this password policy warning type. 073 */ 074 int intValue() { 075 return intValue; 076 } 077}