001    /*
002     * Copyright 2007-2015 UnboundID Corp.
003     * All Rights Reserved.
004     */
005    /*
006     * Copyright (C) 2015 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.unboundidds.controls;
022    
023    
024    
025    import com.unboundid.util.ThreadSafety;
026    import com.unboundid.util.ThreadSafetyLevel;
027    
028    
029    
030    /**
031     * <BLOCKQUOTE>
032     *   <B>NOTE:</B>  This class is part of the Commercial Edition of the UnboundID
033     *   LDAP SDK for Java.  It is not available for use in applications that
034     *   include only the Standard Edition of the LDAP SDK, and is not supported for
035     *   use in conjunction with non-UnboundID products.
036     * </BLOCKQUOTE>
037     * This enum defines a set of warning types that may be included in the password
038     * policy response control as defined in draft-behera-ldap-password-policy.
039     */
040    @ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
041    public enum PasswordPolicyWarningType
042    {
043      /**
044       * The warning type used to indicate that the user's password will expire in
045       * the near future and provide the length of time until it does expire.
046       */
047      TIME_BEFORE_EXPIRATION("time before expiration"),
048    
049    
050    
051      /**
052       * The warning type used to indicate that the user's password is expired but
053       * that the user may have grace logins remaining, or that a grace login was
054       * used in the associated bind.
055       */
056      GRACE_LOGINS_REMAINING("grace logins remaining");
057    
058    
059    
060      // The human-readable name for this password policy warning type.
061      private final String name;
062    
063    
064    
065      /**
066       * Creates a new password policy warning type with the provided name.
067       *
068       * @param  name The human-readable name for this warning type.
069       */
070      private PasswordPolicyWarningType(final String name)
071      {
072        this.name = name;
073      }
074    
075    
076    
077      /**
078       * Retrieves the human-readable name for this password policy warning type.
079       *
080       * @return  The human-readable name for this password policy warning type.
081       */
082      public String getName()
083      {
084        return name;
085      }
086    
087    
088    
089      /**
090       * Retrieves a string representation for this password policy warning type.
091       *
092       * @return  A string representation for this password policy warning type.
093       */
094      @Override()
095      public String toString()
096      {
097        return name;
098      }
099    }