001 /*
002 * Copyright 2007-2013 UnboundID Corp.
003 * All Rights Reserved.
004 */
005 /*
006 * Copyright (C) 2007-2013 UnboundID Corp.
007 *
008 * This program is free software; you can redistribute it and/or modify
009 * it under the terms of the GNU General Public License (GPLv2 only)
010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011 * as published by the Free Software Foundation.
012 *
013 * This program is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016 * GNU General Public License for more details.
017 *
018 * You should have received a copy of the GNU General Public License
019 * along with this program; if not, see <http://www.gnu.org/licenses>.
020 */
021 package com.unboundid.ldap.sdk.experimental;
022
023
024
025 import com.unboundid.util.ThreadSafety;
026 import com.unboundid.util.ThreadSafetyLevel;
027
028
029
030 /**
031 * This enum defines a set of warning types that may be included in the password
032 * policy response control as defined in draft-behera-ldap-password-policy-10.
033 */
034 @ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
035 public enum DraftBeheraLDAPPasswordPolicy10WarningType
036 {
037 /**
038 * The warning type used to indicate that the user's password will expire in
039 * the near future and provide the length of time until it does expire.
040 */
041 TIME_BEFORE_EXPIRATION("time before expiration"),
042
043
044
045 /**
046 * The warning type used to indicate that the user's password is expired but
047 * that the user may have grace logins remaining, or that a grace login was
048 * used in the associated bind.
049 */
050 GRACE_LOGINS_REMAINING("grace logins remaining");
051
052
053
054 // The human-readable name for this password policy warning type.
055 private final String name;
056
057
058
059 /**
060 * Creates a new password policy warning type with the provided name.
061 *
062 * @param name The human-readable name for this warning type.
063 */
064 private DraftBeheraLDAPPasswordPolicy10WarningType(final String name)
065 {
066 this.name = name;
067 }
068
069
070
071 /**
072 * Retrieves the human-readable name for this password policy warning type.
073 *
074 * @return The human-readable name for this password policy warning type.
075 */
076 public String getName()
077 {
078 return name;
079 }
080
081
082
083 /**
084 * Retrieves a string representation for this password policy warning type.
085 *
086 * @return A string representation for this password policy warning type.
087 */
088 @Override()
089 public String toString()
090 {
091 return name;
092 }
093 }