001/*
002 * Copyright 2009-2020 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright 2009-2020 Ping Identity Corporation
007 *
008 * Licensed under the Apache License, Version 2.0 (the "License");
009 * you may not use this file except in compliance with the License.
010 * You may obtain a copy of the License at
011 *
012 *    http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing, software
015 * distributed under the License is distributed on an "AS IS" BASIS,
016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017 * See the License for the specific language governing permissions and
018 * limitations under the License.
019 */
020/*
021 * Copyright (C) 2015-2020 Ping Identity Corporation
022 *
023 * This program is free software; you can redistribute it and/or modify
024 * it under the terms of the GNU General Public License (GPLv2 only)
025 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
026 * as published by the Free Software Foundation.
027 *
028 * This program is distributed in the hope that it will be useful,
029 * but WITHOUT ANY WARRANTY; without even the implied warranty of
030 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
031 * GNU General Public License for more details.
032 *
033 * You should have received a copy of the GNU General Public License
034 * along with this program; if not, see <http://www.gnu.org/licenses>.
035 */
036package com.unboundid.ldap.sdk.unboundidds.logs;
037
038
039
040import com.unboundid.util.StaticUtils;
041import com.unboundid.util.ThreadSafety;
042import com.unboundid.util.ThreadSafetyLevel;
043
044
045
046/**
047 * This enum contains the set of error log categories defined in the Directory
048 * Server.
049 * <BR>
050 * <BLOCKQUOTE>
051 *   <B>NOTE:</B>  This class, and other classes within the
052 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
053 *   supported for use against Ping Identity, UnboundID, and
054 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
055 *   for proprietary functionality or for external specifications that are not
056 *   considered stable or mature enough to be guaranteed to work in an
057 *   interoperable way with other types of LDAP servers.
058 * </BLOCKQUOTE>
059 */
060@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
061public enum ErrorLogCategory
062{
063  /**
064   * The error log category used for messages related to access control.
065   */
066  ACCESS_CONTROL,
067
068
069
070  /**
071   * The error log category used for messages related to the server
072   * administration framework.
073   */
074  ADMIN,
075
076
077
078  /**
079   * The error log category used for messages related to tools used for
080   * administering the server.
081   */
082  ADMIN_TOOL,
083
084
085
086  /**
087   * The error log category used for messages generated by most types of
088   * Directory Server backends.
089   */
090  BACKEND,
091
092
093
094  /**
095   * The error log category used for messages related to the server
096   * configuration.
097   */
098  CONFIG,
099
100
101
102  /**
103   * The error log category used for messages related to the core processing of
104   * the server.
105   */
106  CORE,
107
108
109
110  /**
111   * The error log category used for messages related to the use of the dsconfig
112   * tool.
113   */
114  DSCONFIG,
115
116
117
118  /**
119   * The error log category used for messages generated by server extensions.
120   */
121  EXTENSIONS,
122
123
124
125  /**
126   * The error log category used for messages generated by the backend using the
127   * Berkeley DB Java Edition for storing data.
128   */
129  JEB,
130
131
132
133  /**
134   * The error log category used for messages generated by the logging
135   * framework.
136   */
137  LOG,
138
139
140
141  /**
142   * The error log category used for messages generated by server plugins.
143   */
144  PLUGIN,
145
146
147
148  /**
149   * The error log category used for messages about communication performed with
150   * clients.
151   */
152  PROTOCOL,
153
154
155
156  /**
157   * The error log category used for messages about the operation of the
158   * Directory Proxy Server.
159   */
160  PROXY,
161
162
163
164  /**
165   * The error log category used for messages generated by the QuickSetup tool.
166   */
167  QUICKSETUP,
168
169
170
171  /**
172   * The error log category used for messages related to replication between
173   * server instances.
174   */
175  REPLICATION,
176
177
178
179  /**
180   * The error log category used for messages related to information about the
181   * environment in which the server is running.
182   */
183  RUNTIME_INFORMATION,
184
185
186
187  /**
188   * The error log category used for messages related to the server schema.
189   */
190  SCHEMA,
191
192
193
194  /**
195   * The error log category used for messages related to processing performed by
196   * server tasks.
197   */
198  TASK,
199
200
201
202  /**
203   * The error log category used for messages generated by third-party
204   * components.
205   */
206  THIRD_PARTY,
207
208
209
210  /**
211   * The error log category used for messages generated by server tools.
212   */
213  TOOLS,
214
215
216
217  /**
218   * The error log category used for messages generated by utility classes
219   * within the server.
220   */
221  UTIL,
222
223
224
225  /**
226   * The error log category used for messages about the server version.
227   */
228  VERSION;
229
230
231
232  /**
233   * Retrieves the error log category with the specified name.
234   *
235   * @param  name  The name of the error log category to retrieve.  It must not
236   *               be {@code null}.
237   *
238   * @return  The requested error log category, or {@code null} if no such
239   *          category is defined.
240   */
241  public static ErrorLogCategory forName(final String name)
242  {
243    switch (StaticUtils.toLowerCase(name))
244    {
245      case "accesscontrol":
246      case "access-control":
247      case "access_control":
248        return ACCESS_CONTROL;
249      case "admin":
250        return ADMIN;
251      case "admintool":
252      case "admin-tool":
253      case "admin_tool":
254        return ADMIN_TOOL;
255      case "backend":
256        return BACKEND;
257      case "config":
258        return CONFIG;
259      case "core":
260        return CORE;
261      case "dsconfig":
262        return DSCONFIG;
263      case "extensions":
264        return EXTENSIONS;
265      case "jeb":
266        return JEB;
267      case "log":
268        return LOG;
269      case "plugin":
270        return PLUGIN;
271      case "protocol":
272        return PROTOCOL;
273      case "proxy":
274        return PROXY;
275      case "quicksetup":
276        return QUICKSETUP;
277      case "replication":
278        return REPLICATION;
279      case "runtimeinformation":
280      case "runtime-information":
281      case "runtime_information":
282        return RUNTIME_INFORMATION;
283      case "schema":
284        return SCHEMA;
285      case "task":
286        return TASK;
287      case "thirdparty":
288      case "third-party":
289      case "third_party":
290        return THIRD_PARTY;
291      case "tools":
292        return TOOLS;
293      case "util":
294        return UTIL;
295      case "version":
296        return VERSION;
297      default:
298        return null;
299    }
300  }
301}