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.ThreadSafety; 026import com.unboundid.util.ThreadSafetyLevel; 027 028 029 030/** 031 * This enum defines the set of access log message types. 032 * <BR> 033 * <BLOCKQUOTE> 034 * <B>NOTE:</B> This class, and other classes within the 035 * {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only 036 * supported for use against Ping Identity, UnboundID, and 037 * Nokia/Alcatel-Lucent 8661 server products. These classes provide support 038 * for proprietary functionality or for external specifications that are not 039 * considered stable or mature enough to be guaranteed to work in an 040 * interoperable way with other types of LDAP servers. 041 * </BLOCKQUOTE> 042 */ 043@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) 044public enum AccessLogMessageType 045{ 046 /** 047 * The message type that will be used for messages about the result of 048 * replication assurance processing. 049 */ 050 ASSURANCE_COMPLETE("ASSURANCE-COMPLETE"), 051 052 053 054 /** 055 * The message type that will be used for messages about connections 056 * established to the Directory Server. 057 */ 058 CLIENT_CERTIFICATE("CLIENT-CERTIFICATE"), 059 060 061 062 /** 063 * The message type that will be used for messages about connections 064 * established to the Directory Server. 065 */ 066 CONNECT("CONNECT"), 067 068 069 070 /** 071 * The message type that will be used for messages about connections 072 * disconnected from the Directory Server. 073 */ 074 DISCONNECT("DISCONNECT"), 075 076 077 078 /** 079 * The message type that will be used for messages about search result entries 080 * returned by the Directory Server. 081 */ 082 ENTRY("ENTRY"), 083 084 085 086 /** 087 * The message type that will be used for messages that provide information 088 * about the beginning of an entry-rebalancing operation. 089 */ 090 ENTRY_REBALANCING_REQUEST("ENTRY-REBALANCING-REQUEST"), 091 092 093 094 /** 095 * The message type that will be used for messages that provide information 096 * about the result of an entry-rebalancing operation. 097 */ 098 ENTRY_REBALANCING_RESULT("ENTRY-REBALANCING-RESULT"), 099 100 101 102 /** 103 * The message type that will be used for messages about operations forwarded 104 * to another server. 105 */ 106 FORWARD("FORWARD"), 107 108 109 110 /** 111 * The message type that will be used for messages about failed attempts to 112 * forward a request to another server. 113 */ 114 FORWARD_FAILED("FORWARD-FAILED"), 115 116 117 118 /** 119 * The message type that will be used for intermediate response messages. 120 */ 121 INTERMEDIATE_RESPONSE("INTERMEDIATE-RESPONSE"), 122 123 124 125 /** 126 * The message type that will be used for messages about search result 127 * references returned by the Directory Server. 128 */ 129 REFERENCE("REFERENCE"), 130 131 132 133 /** 134 * The message type that will be used for messages about operation requests 135 * received from the Directory Server. 136 */ 137 REQUEST("REQUEST"), 138 139 140 141 /** 142 * The message type that will be used for messages about operation results, 143 * which may include responses sent to clients or results for operations with 144 * no response. 145 */ 146 RESULT("RESULT"), 147 148 149 150 /** 151 * The message type that will be used for messages about the processing 152 * performed to negotiate a secure form of communication between the client 153 * and the server. 154 */ 155 SECURITY_NEGOTIATION("SECURITY-NEGOTIATION"); 156 157 158 159 // The string that will be used to identify this message type in log files. 160 private final String logIdentifier; 161 162 163 164 /** 165 * Creates a new access log message type with the provided information. 166 * 167 * @param logIdentifier The string that will be used to identify this 168 * message type in log files. 169 */ 170 AccessLogMessageType(final String logIdentifier) 171 { 172 this.logIdentifier = logIdentifier; 173 } 174 175 176 177 /** 178 * Retrieves the string that will be used to identify this message type in 179 * log files. 180 * 181 * @return The string that will be used to identify this message type in log 182 * files. 183 */ 184 public String getLogIdentifier() 185 { 186 return logIdentifier; 187 } 188 189 190 191 /** 192 * Retrieves the access log message type with the provided identifier. 193 * 194 * @param logIdentifier The identifier string for which to retrieve the 195 * corresponding access log message type. 196 * 197 * @return The appropriate message type, or {@code null} if there is no 198 * message type associated with the provided identifier. 199 */ 200 public static AccessLogMessageType forName(final String logIdentifier) 201 { 202 for (final AccessLogMessageType t : values()) 203 { 204 if (t.logIdentifier.equals(logIdentifier)) 205 { 206 return t; 207 } 208 } 209 210 return null; 211 } 212}