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