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