001/*
002 * Copyright 2009-2018 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright (C) 2015-2018 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.logs;
022
023
024
025import com.unboundid.util.StaticUtils;
026import com.unboundid.util.ThreadSafety;
027import com.unboundid.util.ThreadSafetyLevel;
028
029
030
031/**
032 * This enum defines the set of authentication types that may appear in log
033 * messages about bind operations.
034 * <BR>
035 * <BLOCKQUOTE>
036 *   <B>NOTE:</B>  This class, and other classes within the
037 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
038 *   supported for use against Ping Identity, UnboundID, and
039 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
040 *   for proprietary functionality or for external specifications that are not
041 *   considered stable or mature enough to be guaranteed to work in an
042 *   interoperable way with other types of LDAP servers.
043 * </BLOCKQUOTE>
044 */
045@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
046public enum BindRequestAuthenticationType
047{
048  /**
049   * The authentication type that will be used for authentication by an internal
050   * client.
051   */
052  INTERNAL,
053
054
055
056  /**
057   * The authentication type that will be used for SASL authentication.
058   */
059  SASL,
060
061
062
063  /**
064   * The authentication type that will be used for simple authentication.
065   */
066  SIMPLE;
067
068
069
070  /**
071   * Retrieves the authentication type with the specified name.
072   *
073   * @param  name  The name of the authentication type to retrieve.  It must not
074   *               be {@code null}.
075   *
076   * @return  The requested authentication type, or {@code null} if no such type
077   *          is defined.
078   */
079  public static BindRequestAuthenticationType forName(final String name)
080  {
081    switch (StaticUtils.toLowerCase(name))
082    {
083      case "internal":
084        return INTERNAL;
085      case "sasl":
086        return SASL;
087      case "simple":
088        return SIMPLE;
089      default:
090        return null;
091    }
092  }
093}