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