001/*
002 * Copyright 2009-2019 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright (C) 2015-2019 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 contains the set of error log categories defined in the Directory
033 * Server.
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 ErrorLogCategory
047{
048  /**
049   * The error log category used for messages related to access control.
050   */
051  ACCESS_CONTROL,
052
053
054
055  /**
056   * The error log category used for messages related to the server
057   * administration framework.
058   */
059  ADMIN,
060
061
062
063  /**
064   * The error log category used for messages related to tools used for
065   * administering the server.
066   */
067  ADMIN_TOOL,
068
069
070
071  /**
072   * The error log category used for messages generated by most types of
073   * Directory Server backends.
074   */
075  BACKEND,
076
077
078
079  /**
080   * The error log category used for messages related to the server
081   * configuration.
082   */
083  CONFIG,
084
085
086
087  /**
088   * The error log category used for messages related to the core processing of
089   * the server.
090   */
091  CORE,
092
093
094
095  /**
096   * The error log category used for messages related to the use of the dsconfig
097   * tool.
098   */
099  DSCONFIG,
100
101
102
103  /**
104   * The error log category used for messages generated by server extensions.
105   */
106  EXTENSIONS,
107
108
109
110  /**
111   * The error log category used for messages generated by the backend using the
112   * Berkeley DB Java Edition for storing data.
113   */
114  JEB,
115
116
117
118  /**
119   * The error log category used for messages generated by the logging
120   * framework.
121   */
122  LOG,
123
124
125
126  /**
127   * The error log category used for messages generated by server plugins.
128   */
129  PLUGIN,
130
131
132
133  /**
134   * The error log category used for messages about communication performed with
135   * clients.
136   */
137  PROTOCOL,
138
139
140
141  /**
142   * The error log category used for messages about the operation of the
143   * Directory Proxy Server.
144   */
145  PROXY,
146
147
148
149  /**
150   * The error log category used for messages generated by the QuickSetup tool.
151   */
152  QUICKSETUP,
153
154
155
156  /**
157   * The error log category used for messages related to replication between
158   * server instances.
159   */
160  REPLICATION,
161
162
163
164  /**
165   * The error log category used for messages related to information about the
166   * environment in which the server is running.
167   */
168  RUNTIME_INFORMATION,
169
170
171
172  /**
173   * The error log category used for messages related to the server schema.
174   */
175  SCHEMA,
176
177
178
179  /**
180   * The error log category used for messages related to processing performed by
181   * server tasks.
182   */
183  TASK,
184
185
186
187  /**
188   * The error log category used for messages generated by third-party
189   * components.
190   */
191  THIRD_PARTY,
192
193
194
195  /**
196   * The error log category used for messages generated by server tools.
197   */
198  TOOLS,
199
200
201
202  /**
203   * The error log category used for messages generated by utility classes
204   * within the server.
205   */
206  UTIL,
207
208
209
210  /**
211   * The error log category used for messages about the server version.
212   */
213  VERSION;
214
215
216
217  /**
218   * Retrieves the error log category with the specified name.
219   *
220   * @param  name  The name of the error log category to retrieve.  It must not
221   *               be {@code null}.
222   *
223   * @return  The requested error log category, or {@code null} if no such
224   *          category is defined.
225   */
226  public static ErrorLogCategory forName(final String name)
227  {
228    switch (StaticUtils.toLowerCase(name))
229    {
230      case "accesscontrol":
231      case "access-control":
232      case "access_control":
233        return ACCESS_CONTROL;
234      case "admin":
235        return ADMIN;
236      case "admintool":
237      case "admin-tool":
238      case "admin_tool":
239        return ADMIN_TOOL;
240      case "backend":
241        return BACKEND;
242      case "config":
243        return CONFIG;
244      case "core":
245        return CORE;
246      case "dsconfig":
247        return DSCONFIG;
248      case "extensions":
249        return EXTENSIONS;
250      case "jeb":
251        return JEB;
252      case "log":
253        return LOG;
254      case "plugin":
255        return PLUGIN;
256      case "protocol":
257        return PROTOCOL;
258      case "proxy":
259        return PROXY;
260      case "quicksetup":
261        return QUICKSETUP;
262      case "replication":
263        return REPLICATION;
264      case "runtimeinformation":
265      case "runtime-information":
266      case "runtime_information":
267        return RUNTIME_INFORMATION;
268      case "schema":
269        return SCHEMA;
270      case "task":
271        return TASK;
272      case "thirdparty":
273      case "third-party":
274      case "third_party":
275        return THIRD_PARTY;
276      case "tools":
277        return TOOLS;
278      case "util":
279        return UTIL;
280      case "version":
281        return VERSION;
282      default:
283        return null;
284    }
285  }
286}