001/*
002 * Copyright 2014-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;
022
023
024
025import com.unboundid.util.ThreadSafety;
026import com.unboundid.util.ThreadSafetyLevel;
027
028
029
030/**
031 * This class provides information about the types of alarm severities that may
032 * be included in alarm entries.
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 AlarmSeverity
046{
047  /**
048   * The alarm severity that indicates that the severity cannot be determined.
049   */
050  INDETERMINATE,
051
052
053
054  /**
055   * The alarm severity that indicates that the associated condition is normal.
056   */
057  NORMAL,
058
059
060
061  /**
062   * The alarm severity that indicates there is a warning condition.
063   */
064  WARNING,
065
066
067
068  /**
069   * The alarm severity that indicates there is a minor error condition.
070   */
071  MINOR,
072
073
074
075  /**
076   * The alarm severity that indicates there is a major error condition.
077   */
078  MAJOR,
079
080
081
082  /**
083   * The alarm severity that indicates there is a critical error condition.
084   */
085  CRITICAL;
086
087
088
089  /**
090   * Retrieves the alarm severity with the specified name.
091   *
092   * @param  name  The name of the alarm severity to retrieve.
093   *
094   * @return  The alarm severity with the specified name, or {@code null} if
095   *          there is no alarm severity with the given name.
096   */
097  public static AlarmSeverity forName(final String name)
098  {
099    final String upperName = name.toUpperCase();
100    for (final AlarmSeverity s : values())
101    {
102      if (upperName.equals(s.name()))
103      {
104        return s;
105      }
106    }
107
108    return null;
109  }
110}