001/* 002 * Copyright 2007-2017 Ping Identity Corporation 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright (C) 2015-2017 Ping Identity Corporation 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 */ 021package com.unboundid.ldap.sdk.unboundidds.controls; 022 023 024 025import com.unboundid.util.ThreadSafety; 026import 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. 033 * <BR> 034 * <BLOCKQUOTE> 035 * <B>NOTE:</B> This class, and other classes within the 036 * {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only 037 * supported for use against Ping Identity, UnboundID, and Alcatel-Lucent 8661 038 * server products. These classes provide support for proprietary 039 * functionality or for external specifications that are not considered stable 040 * or mature enough to be guaranteed to work in an interoperable way with 041 * other types of LDAP servers. 042 * </BLOCKQUOTE> 043 */ 044@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) 045public enum PasswordPolicyWarningType 046{ 047 /** 048 * The warning type used to indicate that the user's password will expire in 049 * the near future and provide the length of time until it does expire. 050 */ 051 TIME_BEFORE_EXPIRATION("time before expiration"), 052 053 054 055 /** 056 * The warning type used to indicate that the user's password is expired but 057 * that the user may have grace logins remaining, or that a grace login was 058 * used in the associated bind. 059 */ 060 GRACE_LOGINS_REMAINING("grace logins remaining"); 061 062 063 064 // The human-readable name for this password policy warning type. 065 private final String name; 066 067 068 069 /** 070 * Creates a new password policy warning type with the provided name. 071 * 072 * @param name The human-readable name for this warning type. 073 */ 074 PasswordPolicyWarningType(final String name) 075 { 076 this.name = name; 077 } 078 079 080 081 /** 082 * Retrieves the human-readable name for this password policy warning type. 083 * 084 * @return The human-readable name for this password policy warning type. 085 */ 086 public String getName() 087 { 088 return name; 089 } 090 091 092 093 /** 094 * Retrieves a string representation for this password policy warning type. 095 * 096 * @return A string representation for this password policy warning type. 097 */ 098 @Override() 099 public String toString() 100 { 101 return name; 102 } 103}