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