001/*
002 * Copyright 2022-2024 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright 2022-2024 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) 2022-2024 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.v2.text;
037
038
039
040import java.util.Collections;
041import java.util.Map;
042import java.util.TreeMap;
043import java.util.concurrent.ConcurrentHashMap;
044import java.util.concurrent.atomic.AtomicReference;
045
046import com.unboundid.ldap.sdk.unboundidds.logs.v2.LogField;
047import com.unboundid.ldap.sdk.unboundidds.logs.v2.syntax.BooleanLogFieldSyntax;
048import com.unboundid.ldap.sdk.unboundidds.logs.v2.syntax.
049            CommaDelimitedStringListLogFieldSyntax;
050import com.unboundid.ldap.sdk.unboundidds.logs.v2.syntax.DNLogFieldSyntax;
051import com.unboundid.ldap.sdk.unboundidds.logs.v2.syntax.FilterLogFieldSyntax;
052import com.unboundid.ldap.sdk.unboundidds.logs.v2.syntax.
053            FloatingPointLogFieldSyntax;
054import com.unboundid.ldap.sdk.unboundidds.logs.v2.syntax.IntegerLogFieldSyntax;
055import com.unboundid.ldap.sdk.unboundidds.logs.v2.syntax.LogFieldSyntax;
056import com.unboundid.ldap.sdk.unboundidds.logs.v2.syntax.StringLogFieldSyntax;
057import com.unboundid.util.NotNull;
058import com.unboundid.util.Nullable;
059import com.unboundid.util.StaticUtils;
060import com.unboundid.util.ThreadSafety;
061import com.unboundid.util.ThreadSafetyLevel;
062
063
064
065/**
066 * This class defines a number of constants that represent fields that may
067 * appear in text-formatted access log messages.
068 * <BR>
069 * <BLOCKQUOTE>
070 *   <B>NOTE:</B>  This class, and other classes within the
071 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
072 *   supported for use against Ping Identity, UnboundID, and
073 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
074 *   for proprietary functionality or for external specifications that are not
075 *   considered stable or mature enough to be guaranteed to work in an
076 *   interoperable way with other types of LDAP servers.
077 * </BLOCKQUOTE>
078 *
079 * @see  LogField
080 */
081@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
082public final class TextFormattedAccessLogFields
083{
084  /**
085   * The default value to use for the maximum number of characters per string.
086   */
087  private static final int DEFAULT_MAX_CHARACTERS_PER_STRING = 2_000;
088
089
090
091  /**
092   * A map containing all of the defined fields in this class.
093   */
094  @NotNull() private static final Map<String,LogField> DEFINED_FIELDS =
095       new ConcurrentHashMap<>();
096
097
098
099  /**
100   * A map containing all of the defined fields in this class.
101   */
102  @NotNull() private static final AtomicReference<Map<String,LogField>>
103       READ_ONLY_DEFINED_FIELDS_REF = new AtomicReference<>();
104
105
106
107  /**
108   * The default syntax instance that will be used for fields with Boolean
109   * values.
110   */
111  @NotNull private static final BooleanLogFieldSyntax BOOLEAN_SYNTAX =
112       BooleanLogFieldSyntax.getInstance();
113
114
115
116  /**
117   * The default syntax instance that will be used for fields whose values are
118   * a comma-delimited list of strings.
119   */
120  @NotNull private static final CommaDelimitedStringListLogFieldSyntax
121       COMMA_DELIMITED_STRING_LIST_SYNTAX =
122            new CommaDelimitedStringListLogFieldSyntax(
123                 DEFAULT_MAX_CHARACTERS_PER_STRING);
124
125
126
127  /**
128   * The default syntax instance that will be used for fields whose values are
129   * expected to be DNs.  This instance does not specify any included or
130   * excluded sensitive attributes, so all attribute values will be redacted
131   * or tokenized when calling methods that redact or tokenize components.  It
132   * will also use a default escaping strategy for determining which special
133   * characters should be escaped.
134   */
135  @NotNull private static final DNLogFieldSyntax DN_SYNTAX =
136       new DNLogFieldSyntax(DEFAULT_MAX_CHARACTERS_PER_STRING, null, null,
137            null);
138
139
140
141  /**
142   * The default syntax instance that will be used for fields whose values are
143   * expected to be search filters.  This instance does not specify any included
144   * or excluded sensitive attributes, so all attribute values will be redacted
145   * or tokenized when calling methods that redact or tokenize components.
146   */
147  @NotNull private static final FilterLogFieldSyntax FILTER_SYNTAX =
148       new FilterLogFieldSyntax(DEFAULT_MAX_CHARACTERS_PER_STRING, null,
149            null, null);
150
151
152
153  /**
154   * The default syntax instance that will be used for fields whose values are
155   * floating-point numbers.
156   */
157  @NotNull private static final FloatingPointLogFieldSyntax
158       FLOATING_POINT_SYNTAX = FloatingPointLogFieldSyntax.getInstance();
159
160
161
162  /**
163   * The default syntax instance that will be used for fields whose values are
164   * integers.
165   */
166  @NotNull private static final IntegerLogFieldSyntax INTEGER_SYNTAX =
167       IntegerLogFieldSyntax.getInstance();
168
169
170
171  /**
172   * The default syntax instance that will be used for fields whose values are
173   * strings.
174   */
175  @NotNull private static final StringLogFieldSyntax STRING_SYNTAX =
176       new StringLogFieldSyntax(DEFAULT_MAX_CHARACTERS_PER_STRING);
177
178
179
180  /**
181   * A field that holds the message ID for an operation to be abandoned.  This
182   * field may appear in access log messages for abandon operations.
183   */
184  @NotNull public static final LogField ABANDON_MESSAGE_ID =
185       createField("ABANDON_MESSAGE_ID", "idToAbandon", INTEGER_SYNTAX);
186
187
188
189  /**
190   * A field that holds a comma-delimited list of the names of the attributes to
191   * be added.  This field may appear in access log messages for add operations.
192   */
193  @NotNull public static final LogField ADD_ATTRIBUTES = createField(
194       "ADD_ATTRIBUTES", "attrs", COMMA_DELIMITED_STRING_LIST_SYNTAX);
195
196
197
198  /**
199   * A field that holds the DN of the entry to be added.  This field may appear
200   * in access log messages for add operations.
201   */
202  @NotNull public static final LogField ADD_ENTRY_DN =
203       createField("ADD_ENTRY_DN", "dn", DN_SYNTAX);
204
205
206
207  /**
208   * A field that holds the DN of the soft-deleted entry being undeleted.  This
209   * field may appear in access log messages for add operations.
210   */
211  @NotNull public static final LogField ADD_UNDELETE_FROM_DN =
212       createField("ADD_UNDELETE_FROM_DN", "undeleteFromDN", DN_SYNTAX);
213
214
215
216  /**
217   * A field that holds a message with additional information about the server's
218   * processing for an operation.  This message will not be returned to the
219   * client.  This field may appear in all types of operation result access log
220   * messages.
221   */
222  @NotNull public static final LogField ADDITIONAL_INFO =
223       createField("ADDITIONAL_INFO", "additionalInfo", STRING_SYNTAX);
224
225
226
227  /**
228   * A field that indicates that the associated operation includes an
229   * administrative operation request control.  The value of the field is the
230   * message (if any) contained in that control.  This field may appear in all
231   * types of access log messages that are associated with an operation.
232   */
233  @NotNull public static final LogField ADMINISTRATIVE_OPERATION =
234       createField("ADMINISTRATIVE_OPERATION", "administrativeOperation",
235            STRING_SYNTAX);
236
237
238
239  /**
240   * A field that holds the requested replication assurance timeout, in
241   * milliseconds.  This field may appear in all types of operation result
242   * access log messages.
243   */
244  @NotNull public static final LogField ASSURANCE_TIMEOUT_MILLIS =
245       createField("ASSURANCE_TIMEOUT_MILLIS", "assuranceTimeoutMillis",
246            INTEGER_SYNTAX);
247
248
249
250  /**
251   * A field that holds the DN that was used as the alternative authorization
252   * identity for the operation.  This field may appear in all types of
253   * operation result access log messages.
254   */
255  @NotNull public static final LogField AUTHORIZATION_DN =
256       createField("AUTHORIZATION_DN", "authzDN", DN_SYNTAX);
257
258
259
260  /**
261   * A field that holds the DN of the user that was automatically authenticated
262   * to the server based on the certificate chain the client presented during
263   * security negotiation.  This field may appear in SECURITY-NEGOTIATION
264   * access log messages.
265   */
266  @NotNull public static final LogField AUTO_AUTHENTICATED_AS =
267       createField("AUTO_AUTHENTICATED_AS", "autoAuthenticatedAs", DN_SYNTAX);
268
269
270
271  /**
272   * A field that holds the DN of the user that was authenticated in a bind
273   * operation.  This field may appear in bind result access log messages.
274   */
275  @NotNull public static final LogField BIND_AUTHENTICATION_DN =
276       createField("BIND_AUTHENTICATION_DN", "authDN", DN_SYNTAX);
277
278
279
280  /**
281   * A field that holds a numeric identifier that is associated with the
282   * general reason for the authentication failure.  This field may appear in
283   * bind result access log messages.
284   */
285  @NotNull public static final LogField BIND_AUTHENTICATION_FAILURE_ID =
286       createField("BIND_AUTHENTICATION_FAILURE_ID", "authFailureID",
287            INTEGER_SYNTAX);
288
289
290
291  /**
292   * A field that holds a numeric identifier that is associated with the
293   * general reason for the authentication failure.  This field may appear in
294   * bind result access log messages.
295   */
296  @NotNull public static final LogField BIND_AUTHENTICATION_FAILURE_NAME =
297       createField("BIND_AUTHENTICATION_FAILURE_NAME", "authFailureName",
298            STRING_SYNTAX);
299
300
301
302  /**
303   * A field that holds a message providing a reason for a failed authentication
304   * attempt.  This field may appear in bind result access log messages.
305   */
306  @NotNull public static final LogField BIND_AUTHENTICATION_FAILURE_REASON =
307       createField("BIND_AUTHENTICATION_FAILURE_REASON", "authFailureReason",
308            STRING_SYNTAX);
309
310
311
312  /**
313   * A field that holds the authentication type for a bind request.  This field
314   * may appear in access log messages for bind operations.
315   */
316  @NotNull public static final LogField BIND_AUTHENTICATION_TYPE =
317       createField("BIND_AUTHENTICATION_TYPE", "authType", STRING_SYNTAX);
318
319
320
321  /**
322   * A field that holds the DN of the authorization identity resulting from a
323   * bind operation.  This field may appear in bind result access log messages.
324   */
325  @NotNull public static final LogField BIND_AUTHORIZATION_DN =
326       createField("BIND_AUTHORIZATION_DN", "authzDN", DN_SYNTAX);
327
328
329
330  /**
331   * A field that holds the bind DN for a bind request.  This field may appear
332   * in access log messages for bind operations.
333   */
334  @NotNull public static final LogField BIND_DN =
335       createField("BIND_DN", "dn", DN_SYNTAX);
336
337
338
339  /**
340   * A field that holds the protocol version for a bind request.  This field may
341   * appear in access log messages for bind operations.
342   */
343  @NotNull public static final LogField BIND_PROTOCOL_VERSION =
344       createField("BIND_PROTOCOL_VERSION", "version", STRING_SYNTAX);
345
346
347
348  /**
349   * A field that indicates whether a retired password was used in the course of
350   * processing a bind operation.  This field may appear in bind result access
351   * log messages.
352   */
353  @NotNull public static final LogField BIND_RETIRED_PASSWORD_USED =
354       createField("BIND_RETIRED_PASSWORD_USED", "retiredPasswordUsed",
355            BOOLEAN_SYNTAX);
356
357
358
359  /**
360   * A field that holds the name of the SASL mechanism used for a bind request.
361   * This field may appear in access log messages for bind operations.
362   */
363  @NotNull public static final LogField BIND_SASL_MECHANISM =
364       createField("BIND_SASL_MECHANISM", "saslMechanism", STRING_SYNTAX);
365
366
367
368  /**
369   * A field that indicates whether the associated operation updated or removed
370   * a soft-deleted entry.  This field may appear in access log messages for
371   * modify and delete operations.
372   */
373  @NotNull public static final LogField CHANGE_TO_SOFT_DELETED_ENTRY =
374       createField("CHANGE_TO_SOFT_DELETED_ENTRY", "changeToSoftDeletedEntry",
375            BOOLEAN_SYNTAX);
376
377
378
379  /**
380   * A field that holds the name of the cipher algorithm that was negotiated for
381   * the client connection.  This field may appear in SECURITY-NEGOTIATION
382   * access log messages.
383   */
384  @NotNull public static final LogField CIPHER =
385       createField("CIPHER", "cipher", STRING_SYNTAX);
386
387
388
389  /**
390   * A field that holds the name of the client connection policy that has been
391   * assigned to the associated connection.  This field may appear in CONNECT
392   * access log messages, as well as in result access log messages for
393   * operations that may cause a new client connection policy to be assigned
394   * to the connection (including bind and StartTLS).
395   */
396  @NotNull public static final LogField CLIENT_CONNECTION_POLICY =
397       createField("CLIENT_CONNECTION_POLICY", "clientConnectionPolicy",
398            STRING_SYNTAX);
399
400
401
402  /**
403   * A field that holds the assertion value included in a compare operation.
404   * This field may appear in access log messages for compare operations.
405   */
406  @NotNull public static final LogField COMPARE_ASSERTION_VALUE =
407       createField("COMPARE_ASSERTION_VALUE", "assertionValue", STRING_SYNTAX);
408
409
410
411  /**
412   * A field that holds the name of the attribute targeted by a compare
413   * operation.  This field may appear in access log messages for compare
414   * operations.
415   */
416  @NotNull public static final LogField COMPARE_ATTRIBUTE_NAME =
417       createField("COMPARE_ATTRIBUTE_NAME", "attr", STRING_SYNTAX);
418
419
420
421  /**
422   * A field that holds the DN of the entry targeted by a compare operation.
423   * This field may appear in access log messages for compare operations.
424   */
425  @NotNull public static final LogField COMPARE_ENTRY_DN =
426       createField("COMPARE_ENTRY_DN", "dn", DN_SYNTAX);
427
428
429
430  /**
431   * A field that holds the address of the client from which a connection has
432   * been established.  This field may appear in CONNECT access log messages.
433   */
434  @NotNull public static final LogField CONNECT_FROM_ADDRESS =
435       createField("CONNECT_FROM_ADDRESS", "from", STRING_SYNTAX);
436
437
438
439  /**
440   * A field that holds the remote port for a client connection that has been
441   * established.  This field may appear in CONNECT access log messages.
442   */
443  @NotNull public static final LogField CONNECT_FROM_PORT =
444       createField("CONNECT_FROM_PORT", "fromPort", INTEGER_SYNTAX);
445
446
447
448  /**
449   * A field that holds the server address to which a connection has been
450   * established.  This field may appear in CONNECT access log messages.
451   */
452  @NotNull public static final LogField CONNECT_TO_ADDRESS =
453       createField("CONNECT_TO_ADDRESS", "to", STRING_SYNTAX);
454
455
456
457  /**
458   * A field that holds the server port to which a connection has been
459   * established.  This field may appear in CONNECT access log messages.
460   */
461  @NotNull public static final LogField CONNECT_TO_PORT =
462       createField("CONNECT_TO_PORT", "toPort", INTEGER_SYNTAX);
463
464
465
466  /**
467   * A field that holds a numeric identifier for the associated client
468   * connection.  All access log messages associated with a given connection
469   * will share the same connection ID, so this field may be used to identify
470   * messages associated with that connection.  Note, however, that the
471   * connection ID counter is reset when the server is restarted, so the
472   * {@link #STARTUP_ID} field may also be necessary to further distinguish
473   * between connections across restarts.  Further, connection ID values may be
474   * reused across instances, so the {@link #INSTANCE_NAME} field may also be
475   * needed to distinguish between connections to different instances.  This
476   * field may appear in all types of access log messages.
477   */
478  @NotNull public static final LogField CONNECTION_ID =
479       createField("CONNECTION_ID", "conn", INTEGER_SYNTAX);
480
481
482
483  /**
484   * A field that holds the DN of the entry targeted by a delete operation.
485   * This field may appear in access log messages for delete operations.
486   */
487  @NotNull public static final LogField DELETE_ENTRY_DN =
488       createField("DELETE_ENTRY_DN", "dn", DN_SYNTAX);
489
490
491
492  /**
493   * A field that holds the DN of a soft-deleted entry resulting from a delete
494   * operation.  This field may appear in access log messages for delete
495   * operations.
496   */
497  @NotNull public static final LogField DELETE_SOFT_DELETED_ENTRY_DN =
498       createField("DELETE_SOFT_DELETED_ENTRY_DN", "softDeleteEntryDN",
499            DN_SYNTAX);
500
501
502
503 /**
504  * A field that holds the diagnostic message for an operation, which is a
505  * message that is returned to the client.  This field may appear in all types
506  * of operation result access log messages.
507   */
508  @NotNull public static final LogField DIAGNOSTIC_MESSAGE =
509      createField("DIAGNOSTIC_MESSAGE", "message", STRING_SYNTAX);
510
511
512
513 /**
514  * A field that holds an additional message for a connection closure, which may
515  * provide additional details about the disconnect.  This field may appear in
516  * DISCONNECT access log messages.
517   */
518  @NotNull public static final LogField DISCONNECT_MESSAGE =
519       createField("DISCONNECT_MESSAGE", "msg", STRING_SYNTAX);
520
521
522
523  /**
524   * A field that holds a reason for a connection closure.  This field may
525   * appear in DISCONNECT access log messages.
526   */
527  @NotNull public static final LogField DISCONNECT_REASON =
528       createField("DISCONNECT_REASON", "reason", STRING_SYNTAX);
529
530
531
532  /**
533   * A field that holds a message about any administrative action that may be
534   * required after an entry rebalancing operation.  This field may appear in
535   * entry rebalancing access log messages.
536   */
537  @NotNull public static final LogField ENTRY_REBALANCING_ADMIN_ACTION_MESSAGE =
538       createField("ENTRY_REBALANCING_ADMIN_ACTION_MESSAGE",
539            "adminActionRequired", STRING_SYNTAX);
540
541
542
543  /**
544   * A field that holds the base DN for an entry rebalancing operation.  This
545   * field may appear in entry rebalancing access log messages.
546   */
547  @NotNull public static final LogField ENTRY_REBALANCING_BASE_DN =
548       createField("ENTRY_REBALANCING_BASE_DN", "baseDN", DN_SYNTAX);
549
550
551
552  /**
553   * A field that holds the number of entries added to the target server in the
554   * course of processing an entry rebalancing operation.  This field may appear
555   * in entry rebalancing access log messages.
556   */
557  @NotNull public static final LogField
558       ENTRY_REBALANCING_ENTRIES_ADDED_TO_TARGET = createField(
559            "ENTRY_REBALANCING_ENTRIES_ADDED_TO_TARGET", "entriesAddedToTarget",
560            INTEGER_SYNTAX);
561
562
563
564  /**
565   * A field that holds the number of entries deleted from the source server in
566   * the course of processing an entry rebalancing operation.  This field may
567   * appear in entry rebalancing access log messages.
568   */
569  @NotNull public static final LogField
570       ENTRY_REBALANCING_ENTRIES_DELETED_FROM_SOURCE = createField(
571            "ENTRY_REBALANCING_ENTRIES_DELETED_FROM_SOURCE",
572            "entriesDeletedFromSource", INTEGER_SYNTAX);
573
574
575
576  /**
577   * A field that holds the number of entries read from the source server in the
578   * course of processing an entry rebalancing operation.  This field may appear
579   * in entry rebalancing access log messages.
580   */
581  @NotNull public static final LogField
582       ENTRY_REBALANCING_ENTRIES_READ_FROM_SOURCE = createField(
583            "ENTRY_REBALANCING_ENTRIES_READ_FROM_SOURCE",
584            "entriesReadFromSource", INTEGER_SYNTAX);
585
586
587
588  /**
589   * A field that holds an error message for an entry rebalancing operation.
590   * This field may appear in entry rebalancing access log messages.
591   */
592  @NotNull public static final LogField ENTRY_REBALANCING_ERROR_MESSAGE =
593       createField("ENTRY_REBALANCING_ERROR_MESSAGE", "errorMessage",
594            STRING_SYNTAX);
595
596
597
598  /**
599   * A field that holds the operation ID for an entry rebalancing operation.
600   * This field may appear in entry rebalancing access log messages.
601   */
602  @NotNull public static final LogField ENTRY_REBALANCING_OPERATION_ID =
603       createField("ENTRY_REBALANCING_OPERATION_ID", "rebalancingOp",
604            INTEGER_SYNTAX);
605
606
607
608  /**
609   * A field that holds the size limit for an entry rebalancing operation.
610   * This field may appear in entry rebalancing access log messages.
611   */
612  @NotNull public static final LogField ENTRY_REBALANCING_SIZE_LIMIT =
613       createField("ENTRY_REBALANCING_SIZE_LIMIT", "sizeLimit", INTEGER_SYNTAX);
614
615
616
617  /**
618   * A field that holds the name of the source backend set for an entry
619   * rebalancing operation.  This field may appear in entry rebalancing access
620   * log messages.
621   */
622  @NotNull public static final LogField ENTRY_REBALANCING_SOURCE_BACKEND_SET =
623       createField("ENTRY_REBALANCING_SOURCE_BACKEND_SET", "sourceBackendSet",
624            STRING_SYNTAX);
625
626
627
628  /**
629   * A field that holds the address and port of the source server for an entry
630   * rebalancing operation.  This field may appear in entry rebalancing access
631   * log messages.
632   */
633  @NotNull public static final LogField ENTRY_REBALANCING_SOURCE_SERVER =
634       createField("ENTRY_REBALANCING_SOURCE_SERVER", "sourceServer",
635            STRING_SYNTAX);
636
637
638
639  /**
640   * A field that indicates whether the source server was altered in the course
641   * of processing an entry rebalancing operation.  This field may appear in
642   * entry rebalancing access log messages.
643   */
644  @NotNull public static final LogField
645       ENTRY_REBALANCING_SOURCE_SERVER_ALTERED = createField(
646            "ENTRY_REBALANCING_SOURCE_SERVER_ALTERED", "sourceAltered",
647            BOOLEAN_SYNTAX);
648
649
650
651  /**
652   * A field that holds the name of the target backend set for an entry
653   * rebalancing operation.  This field may appear in entry rebalancing access
654   * log messages.
655   */
656  @NotNull public static final LogField ENTRY_REBALANCING_TARGET_BACKEND_SET =
657       createField("ENTRY_REBALANCING_TARGET_BACKEND_SET", "targetBackendSet",
658            STRING_SYNTAX);
659
660
661
662  /**
663   * A field that holds the address and port of the target server for an entry
664   * rebalancing operation.  This field may appear in entry rebalancing access
665   * log messages.
666   */
667  @NotNull public static final LogField ENTRY_REBALANCING_TARGET_SERVER =
668       createField("ENTRY_REBALANCING_TARGET_SERVER", "targetServer",
669            STRING_SYNTAX);
670
671
672
673  /**
674   * A field that indicates whether the target server was altered in the course
675   * of processing an entry rebalancing operation.  This field may appear in
676   * entry rebalancing access log messages.
677   */
678  @NotNull public static final LogField
679       ENTRY_REBALANCING_TARGET_SERVER_ALTERED = createField(
680            "ENTRY_REBALANCING_TARGET_SERVER_ALTERED", "targetAltered",
681            BOOLEAN_SYNTAX);
682
683
684
685  /**
686   * A field that holds the request OID for an extended operation.  This field
687   * may appear in access log messages for extended operations.
688   */
689  @NotNull public static final LogField EXTENDED_REQUEST_OID =
690       createField("EXTENDED_REQUEST_OID", "requestOID", STRING_SYNTAX);
691
692
693
694  /**
695   * A field that holds the name for an extended request.  This field may
696   * appear in access log messages for extended operations.
697   */
698  @NotNull public static final LogField EXTENDED_REQUEST_TYPE =
699       createField("EXTENDED_REQUEST_TYPE", "requestType", STRING_SYNTAX);
700
701
702
703  /**
704   * A field that holds the response OID for an extended operation.  This field
705   * may appear in access log messages for extended operations.
706   */
707  @NotNull public static final LogField EXTENDED_RESPONSE_OID =
708       createField("EXTENDED_RESPONSE_OID", "responseOID", STRING_SYNTAX);
709
710
711
712  /**
713   * A field that holds the name for an extended response.  This field may
714   * appear in access log messages for extended operations.
715   */
716  @NotNull public static final LogField EXTENDED_RESPONSE_TYPE =
717       createField("EXTENDED_RESPONSE_TYPE", "responseType", STRING_SYNTAX);
718
719
720
721  /**
722   * A field that holds a comma-delimited list of the names of any indexes
723   * accessed in the course of processing operation that had exceeded the index
724   * entry limit.  This field may appear operation result access log messages.
725   */
726  @NotNull public static final LogField
727       INDEXES_WITH_KEYS_ACCESSED_EXCEEDING_ENTRY_LIMIT = createField(
728            "INDEXES_WITH_KEYS_ACCESSED_EXCEEDING_ENTRY_LIMIT",
729            "indexesWithKeysAccessedExceedingEntryLimit",
730            COMMA_DELIMITED_STRING_LIST_SYNTAX);
731
732
733
734  /**
735   * A field that holds a comma-delimited list of the names of any indexes
736   * accessed in the course of processing operation that were near the index
737   * entry limit.  This field may appear operation result access log messages.
738   */
739  @NotNull public static final LogField
740       INDEXES_WITH_KEYS_ACCESSED_NEAR_ENTRY_LIMIT = createField(
741            "INDEXES_WITH_KEYS_ACCESSED_NEAR_ENTRY_LIMIT",
742            "indexesWithKeysAccessedNearEntryLimit",
743            COMMA_DELIMITED_STRING_LIST_SYNTAX);
744
745
746
747  /**
748   * A field that holds the name of the server instance that logged the message.
749   * This field may appear in all types of access log messages.
750   */
751  @NotNull public static final LogField INSTANCE_NAME =
752       createField("INSTANCE_NAME", "instanceName", STRING_SYNTAX);
753
754
755
756  /**
757   * A field that holds the name of the name of the component that generated an
758   * inter-server request control.  This field amy appear in all types of
759   * access log messages that are associated with operations.
760   */
761  @NotNull public static final LogField INTER_SERVER_COMPONENT =
762       createField("INTER_SERVER_COMPONENT", "interServerComponent",
763            STRING_SYNTAX);
764
765
766
767  /**
768   * A field that holds a string representation of the properties included in an
769   * inter-server request control.  This field amy appear in all types of
770   * access log messages that are associated with operations.
771   */
772  @NotNull public static final LogField INTER_SERVER_PROPERTIES =
773       createField("INTER_SERVER_PROPERTIES", "interServerProperties",
774            STRING_SYNTAX);
775
776
777
778  /**
779   * A field that holds the operation purpose string included in an
780   * inter-server request control.  This field amy appear in all types of
781   * access log messages that are associated with operations.
782   */
783  @NotNull public static final LogField INTER_SERVER_OPERATION_PURPOSE =
784       createField("INTER_SERVER_OPERATION_PURPOSE",
785            "interServerOperationPurpose", STRING_SYNTAX);
786
787
788
789  /**
790   * A field that holds a string representation of any intermediate client
791   * request control included in the operation.  This field may appear in all
792   * types of access log messages that are associated with operations.
793   */
794  @NotNull public static final LogField INTERMEDIATE_CLIENT_REQUEST =
795       createField("INTERMEDIATE_CLIENT_REQUEST", "via", STRING_SYNTAX);
796
797
798
799  /**
800   * A field that holds a string representation of any intermediate client
801   * response control returned to the client.  This field may appear in all
802   * types of operation result access log messages.
803   */
804  @NotNull public static final LogField INTERMEDIATE_CLIENT_RESULT =
805       createField("INTERMEDIATE_CLIENT_RESULT", "from", STRING_SYNTAX);
806
807
808
809  /**
810   * A field that holds the name for an intermediate response returned to the
811   * client.  This field may appear in intermediate response access log
812   * messages.
813   */
814  @NotNull public static final LogField INTERMEDIATE_RESPONSE_NAME =
815       createField("INTERMEDIATE_RESPONSE_NAME", "name", STRING_SYNTAX);
816
817
818
819  /**
820   * A field that holds the OID for an intermediate response returned to the
821   * client.  This field may appear in intermediate response access log
822   * messages.
823   */
824  @NotNull public static final LogField INTERMEDIATE_RESPONSE_OID =
825       createField("INTERMEDIATE_RESPONSE_OID", "oid", STRING_SYNTAX);
826
827
828
829  /**
830   * A field that holds a string representation of the value for an intermediate
831   * response returned to the client.  This field may appear in intermediate
832   * response access log messages.
833   */
834  @NotNull public static final LogField INTERMEDIATE_RESPONSE_VALUE =
835       createField("INTERMEDIATE_RESPONSE_VALUE", "value", STRING_SYNTAX);
836
837
838
839  /**
840   * A field that holds the number of intermediate response messages returned to
841   * the client in the course of processing the operation.  This field may
842   * appear in all types of operation result access log messages.
843   */
844  @NotNull public static final LogField INTERMEDIATE_RESPONSES_RETURNED =
845       createField("INTERMEDIATE_RESPONSES_RETURNED",
846            "intermediateResponsesReturned", INTEGER_SYNTAX);
847
848
849
850  /**
851   * A field that holds the subject DN for an issuer certificate presented in
852   * the client certificate chain during security negotiation.  This field may
853   * appear in CLIENT-CERTIFICATE access log messages, and it may appear
854   * multiple times if the presented certificate chain included three or more
855   * certificates.
856   */
857  @NotNull public static final LogField ISSUER_CERTIFICATE_SUBJECT_DN =
858       createField("ISSUER_CERTIFICATE_SUBJECT_DN", "issuerSubject", DN_SYNTAX);
859
860
861
862  /**
863   * A field that holds the name of the requested local replication assurance
864   * level for the operation.  This field may appear in all types of operation
865   * result access log messages.
866   */
867  @NotNull public static final LogField LOCAL_ASSURANCE_LEVEL =
868       createField("LOCAL_ASSURANCE_LEVEL", "localAssuranceLevel",
869            STRING_SYNTAX);
870
871
872
873  /**
874   * A field that indicates whether the requested local assurance level was
875   * satisfied in the course of processing the operation.  This field may appear
876   * in assurance completed access log messages.
877   */
878  @NotNull public static final LogField LOCAL_ASSURANCE_SATISFIED =
879       createField("LOCAL_ASSURANCE_SATISFIED", "localAssuranceSatisfied",
880            BOOLEAN_SYNTAX);
881
882
883
884  /**
885   * A field that holds the matched DN for the operation, which is the DN for
886   * the closest ancestor of an entry that does not exist.  This field may
887   * appear in all types of operation result access log messages.
888   */
889  @NotNull public static final LogField MATCHED_DN =
890       createField("MATCHED_DN", "matchedDN", DN_SYNTAX);
891
892
893
894  /**
895   * A field that holds the numeric message ID for the associated operation on
896   * the client connection.  For LDAP operations, this is the message ID
897   * included in the LDAP request and response messages for that operation.
898   * This field may appear in all types of access log messages that are
899   * associated with operations.
900   */
901  @NotNull public static final LogField MESSAGE_ID =
902       createField("MESSAGE_ID", "msgID", INTEGER_SYNTAX);
903
904
905
906  /**
907   * A field that holds a comma-delimited list of the names of any privileges
908   * that were required for the processing the operation that the requester did
909   * not have.  This field may appear in all types of operation result access
910   * log messages.
911   */
912  @NotNull public static final LogField MISSING_PRIVILEGES =
913       createField("MISSING_PRIVILEGES", "missingPrivileges",
914            COMMA_DELIMITED_STRING_LIST_SYNTAX);
915
916
917
918  /**
919   * A field that indicates whether old RDN attribute values should be removed
920   * from the entry.  This field may appear in access log messages for modify DN
921   * operations.
922   */
923  @NotNull public static final LogField MODDN_DELETE_OLD_RDN =
924       createField("MODDN_DELETE_OLD_RDN", "deleteOldRDN", BOOLEAN_SYNTAX);
925
926
927
928  /**
929   * A field that holds the DN of the entry to be renamed.  This field may
930   * appear in access log messages for modify DN operations.
931   */
932  @NotNull public static final LogField MODDN_ENTRY_DN =
933       createField("MODDN_ENTRY_DN", "dn", DN_SYNTAX);
934
935
936
937  /**
938   * A field that holds the new RDN to use for the entry to be renamed.  This
939   * field may appear in access log messages for modify DN operations.
940   */
941  @NotNull public static final LogField MODDN_NEW_RDN =
942       createField("MODDN_NEW_RDN", "newRDN", DN_SYNTAX);
943
944
945
946  /**
947   * A field that holds the new superior entry DN to use for the entry to be
948   * renamed.  This field may appear in access log messages for modify DN
949   * operations.
950   */
951  @NotNull public static final LogField MODDN_NEW_SUPERIOR_DN =
952       createField("MODDN_NEW_SUPERIOR_DN", "newSuperior", DN_SYNTAX);
953
954
955
956  /**
957   * A field that holds a comma-delimited list of the names of the attributes to
958   * be modified.  This field may appear in access log messages for modify
959   * operations.
960   */
961  @NotNull public static final LogField MODIFY_ATTRIBUTES = createField(
962       "MODIFY_ATTRIBUTES", "attrs", COMMA_DELIMITED_STRING_LIST_SYNTAX);
963
964
965
966  /**
967   * A field that holds the DN of the entry to be modified.  This field may
968   * appear in access log messages for modify operations.
969   */
970  @NotNull public static final LogField MODIFY_ENTRY_DN =
971       createField("MODIFY_ENTRY_DN", "dn", DN_SYNTAX);
972
973
974
975  /**
976   * A field that holds a numeric identifier for the associated operation on the
977   * client connection.  If there are multiple access log messages for a given
978   * operation (for example, if both request and response messages should be
979   * logged), then each of those log messages will have the same connection ID
980   * and operation ID values, so those fields may be used to identify messages
981   * for that operation.  Note, however, that the connection ID counter is reset
982   * when the server is restarted, so the {@link #STARTUP_ID} field may also be
983   * necessary to further distinguish between connections across restarts.
984   * Further, connection ID values may be reused across instances, so the
985   * {@link #INSTANCE_NAME} field may also be needed to distinguish between
986   * connections to different instances.  This field may appear in all types of
987   * access log messages that are associated with operations.
988   */
989  @NotNull public static final LogField OPERATION_ID =
990       createField("OPERATION_ID", "op", INTEGER_SYNTAX);
991
992
993
994  /**
995   * A field that holds a string representation of an operation purpose request
996   * control included in the operation.  This field may appear in all types of
997   * access log messages that are associated with operations.
998   */
999  @NotNull public static final LogField OPERATION_PURPOSE =
1000       createField("OPERATION_PURPOSE", "opPurpose", STRING_SYNTAX);
1001
1002
1003
1004  /**
1005   * A field that holds information about the origin of the associated
1006   * operation.  This is especially common for things like internal operations
1007   * or operations processed by the replication subsystem.  This field may
1008   * appear in all types of access log messages that are associated with
1009   * operations.
1010   */
1011  @NotNull public static final LogField ORIGIN =
1012       createField("ORIGIN", "origin", STRING_SYNTAX);
1013
1014
1015
1016  /**
1017   * A field that holds the subject DN for the peer certificate presented in the
1018   * client certificate chain during security negotiation.  This field may
1019   * appear in CLIENT-CERTIFICATE access log messages.
1020   */
1021  @NotNull public static final LogField PEER_CERTIFICATE_SUBJECT_DN =
1022       createField("PEER_CERTIFICATE_SUBJECT_DN", "peerSubject", DN_SYNTAX);
1023
1024
1025
1026  /**
1027   * A field whose value is a comma-delimited list of the names of any
1028   * privileges used prior to processing a control that applies an alternative
1029   * authorization identity to the operation.  This field may appear in all
1030   * types of operation result access log messages.
1031   */
1032  @NotNull public static final LogField PRE_AUTHORIZATION_USED_PRIVILEGES =
1033       createField("PRE_AUTHORIZATION_USED_PRIVILEGES",
1034            "preAuthZUsedPrivileges", COMMA_DELIMITED_STRING_LIST_SYNTAX);
1035
1036
1037
1038  /**
1039   * A field that holds the length of time (in milliseconds) that a worker
1040   * thread spent processing the operation.  This field may appear in all types
1041   * of operation result access log messages.
1042   */
1043  @NotNull public static final LogField PROCESSING_TIME_MILLIS =
1044       createField("PROCESSING_TIME_MILLIS", "etime", FLOATING_POINT_SYNTAX);
1045
1046
1047
1048  /**
1049   * A field that holds the name of the product that logged the message.  This
1050   * field may appear in all types of access log messages.
1051   */
1052  @NotNull public static final LogField PRODUCT_NAME =
1053       createField("PRODUCT_NAME", "product", STRING_SYNTAX);
1054
1055
1056
1057  /**
1058   * A field that holds the name of the protocol a client is using to
1059   * communicate with the server.  This field may appear in CONNECT and
1060   * SECURITY-NEGOTIATION access log messages.
1061   */
1062  @NotNull public static final LogField PROTOCOL =
1063       createField("PROTOCOL", "protocol", STRING_SYNTAX);
1064
1065
1066
1067  /**
1068   * A field that holds a comma-delimited list of referral URLs for an
1069   * operation, which indicate that the requested operation should be attempted
1070   * elsewhere.  This field may appear in all types of operation result access
1071   * log messages.
1072   */
1073  @NotNull public static final LogField REFERRAL_URLS = createField(
1074       "REFERRAL_URLS", "referralURLs", COMMA_DELIMITED_STRING_LIST_SYNTAX);
1075
1076
1077
1078  /**
1079   * A field that holds the name of the requested remote replication assurance
1080   * level for the operation.  This field may appear in all types of operation
1081   * result access log messages.
1082   */
1083  @NotNull public static final LogField REMOTE_ASSURANCE_LEVEL =
1084       createField("REMOTE_ASSURANCE_LEVEL", "remoteAssuranceLevel",
1085            STRING_SYNTAX);
1086
1087
1088
1089  /**
1090   * A field that indicates whether the requested remote assurance level was
1091   * satisfied in the course of processing the operation.  This field may appear
1092   * in assurance completed access log messages.
1093   */
1094  @NotNull public static final LogField REMOTE_ASSURANCE_SATISFIED =
1095       createField("REMOTE_ASSURANCE_SATISFIED", "remoteAssuranceSatisfied",
1096            BOOLEAN_SYNTAX);
1097
1098
1099
1100  /**
1101   * A field that holds the replication change ID for a replicated operation.
1102   * This field may appear in all types of operation result access log messages.
1103   */
1104  @NotNull public static final LogField REPLICATION_CHANGE_ID =
1105       createField("REPLICATION_CHANGE_ID", "replicationChangeID",
1106            STRING_SYNTAX);
1107
1108
1109
1110  /**
1111   * A field that holds a comma-delimited list of the OIDs of any controls
1112   * included in the request.  This field may appear in all types of access log
1113   * messages that are associated with operations.
1114   */
1115  @NotNull public static final LogField REQUEST_CONTROL_OIDS =
1116       createField("REQUEST_CONTROL_OIDS", "requestControls",
1117            COMMA_DELIMITED_STRING_LIST_SYNTAX);
1118
1119
1120
1121  /**
1122   * A field that holds the DN of the user that requested the associated
1123   * operation.  This field may appear in all types of access log messages that
1124   * are associated with operations.
1125   */
1126  @NotNull public static final LogField REQUESTER_DN =
1127       createField("REQUESTER_DN", "requesterDN", DN_SYNTAX);
1128
1129
1130
1131  /**
1132   * A field that holds the IP address of the client that requested the
1133   * associated operation.  This field may appear in all types of access log
1134   * messages that are associated with operations.
1135   */
1136  @NotNull public static final LogField REQUESTER_IP_ADDRESS =
1137       createField("REQUESTER_IP_ADDRESS", "requesterIP", STRING_SYNTAX);
1138
1139
1140
1141  /**
1142   * A field that holds a comma-delimited list of the OIDs of any controls
1143   * included in the response.  This field may appear in all types of operation
1144   * result access log messages.
1145   */
1146  @NotNull public static final LogField RESPONSE_CONTROL_OIDS =
1147       createField("RESPONSE_CONTROL_OIDS", "responseControls",
1148            COMMA_DELIMITED_STRING_LIST_SYNTAX);
1149
1150
1151
1152  /**
1153   * A field that indicates whether the response to the operation was delayed
1154   * by replication assurance processing.  This field may appear in all types
1155   * of operation result access log messages.
1156   */
1157  @NotNull public static final LogField RESPONSE_DELAYED_BY_ASSURANCE =
1158       createField("RESPONSE_DELAYED_BY_ASSURANCE",
1159            "responseDelayedByAssurance", BOOLEAN_SYNTAX);
1160
1161
1162
1163  /**
1164   * A field that holds the name of the result code for the associated
1165   * operation.  This field may appear in all types of operation result access
1166   * log messages.
1167   */
1168  @NotNull public static final LogField RESULT_CODE_NAME =
1169       createField("RESULT_CODE_NAME", "resultCodeName", STRING_SYNTAX);
1170
1171
1172
1173  /**
1174   * A field that holds the numeric value of the result code for the associated
1175   * operation.  This field may appear in all types of operation result access
1176   * log messages.
1177   */
1178  @NotNull public static final LogField RESULT_CODE_VALUE =
1179       createField("RESULT_CODE_VALUE", "resultCode", INTEGER_SYNTAX);
1180
1181
1182
1183  /**
1184   * A field that holds the base DN for a search operation.  This field may
1185   * appear in access log messages for search operations.
1186   */
1187  @NotNull public static final LogField SEARCH_BASE_DN =
1188       createField("SEARCH_BASE_DN", "base", DN_SYNTAX);
1189
1190
1191
1192  /**
1193   * A field that holds the name of the policy to use for dereferencing aliases
1194   * for a search operation.  This field may appear in access log messages for
1195   * search operations.
1196   */
1197  @NotNull public static final LogField SEARCH_DEREF_POLICY =
1198       createField("SEARCH_DEREF_POLICY", "deref", STRING_SYNTAX);
1199
1200
1201
1202  /**
1203   * A field that holds the number of search result entries that were returned
1204   * to the client.  This field may appear in search result access log messages.
1205   */
1206  @NotNull public static final LogField SEARCH_ENTRIES_RETURNED =
1207       createField("SEARCH_ENTRIES_RETURNED", "entriesReturned",
1208            INTEGER_SYNTAX);
1209
1210
1211
1212  /**
1213   * A field that holds a string representation of the filter for a search
1214   * operation.  This field may appear in access log messages for search
1215   * operations.
1216   */
1217  @NotNull public static final LogField SEARCH_FILTER =
1218       createField("SEARCH_FILTER", "filter", FILTER_SYNTAX);
1219
1220
1221
1222  /**
1223   * A field that holds a comma-delimited list of the names of the attributes
1224   * requested to be included in search result entries.  This field may appear
1225   * in access log messages for search operations.
1226   */
1227  @NotNull public static final LogField SEARCH_REQUESTED_ATTRIBUTES =
1228       createField("SEARCH_REQUESTED_ATTRIBUTES", "attrs",
1229            COMMA_DELIMITED_STRING_LIST_SYNTAX);
1230
1231
1232
1233  /**
1234   * A field that holds the DN for a search result entry.  This field may appear
1235   * in access log messages for search result entries.
1236   */
1237  @NotNull public static final LogField SEARCH_RESULT_ENTRY_DN =
1238       createField("SEARCH_RESULT_ENTRY_DN", "dn", DN_SYNTAX);
1239
1240
1241
1242  /**
1243   * A field whose value is a comma-delimited list of the names of the
1244   * attributes returned to the client in a search result entry.  This field may
1245   * appear in access log messages for search operations.
1246   */
1247  @NotNull public static final LogField SEARCH_RESULT_ENTRY_ATTRIBUTES =
1248       createField("SEARCH_RESULT_ENTRY_ATTRIBUTES", "attrsReturned",
1249            COMMA_DELIMITED_STRING_LIST_SYNTAX);
1250
1251
1252
1253  /**
1254   * A field that holds the numeric value of the scope for a search operation.
1255   * This field may appear in access log messages for search operations.
1256   */
1257  @NotNull public static final LogField SEARCH_SCOPE_VALUE =
1258       createField("SEARCH_SCOPE_VALUE", "scope", INTEGER_SYNTAX);
1259
1260
1261
1262  /**
1263   * A field that holds the requested size limit for a search operation.  This
1264   * field may appear in access log messages for search operations.
1265   */
1266  @NotNull public static final LogField SEARCH_SIZE_LIMIT =
1267       createField("SEARCH_SIZE_LIMIT", "sizeLimit", INTEGER_SYNTAX);
1268
1269
1270
1271  /**
1272   * A field that holds the requested time limit (in seconds) for a search
1273   * operation.  This field may appear in access log messages for search
1274   * operations.
1275   */
1276  @NotNull public static final LogField SEARCH_TIME_LIMIT_SECONDS =
1277       createField("SEARCH_TIME_LIMIT_SECONDS", "timeLimit", INTEGER_SYNTAX);
1278
1279
1280
1281  /**
1282   * A field that indicates whether search result entries should only include
1283   * attribute types or both types and values.  This field may appear in access
1284   * log messages for search operations.
1285   */
1286  @NotNull public static final LogField SEARCH_TYPES_ONLY =
1287       createField("SEARCH_TYPES_ONLY", "typesOnly", BOOLEAN_SYNTAX);
1288
1289
1290
1291  /**
1292   * A field that indicates whether the search operation was considered
1293   * unindexed.  This field may appear in search result access log messages.
1294   */
1295  @NotNull public static final LogField SEARCH_UNINDEXED =
1296       createField("SEARCH_UNINDEXED", "unindexed", BOOLEAN_SYNTAX);
1297
1298
1299
1300  /**
1301   * A field that holds a comma-delimited list of the assurance results from
1302   * each of the servers.  This field may appear in assurance completed access
1303   * log messages.
1304   */
1305  @NotNull public static final LogField SERVER_ASSURANCE_RESULTS =
1306       createField("SERVER_ASSURANCE_RESULTS", "serverAssuranceResults",
1307            COMMA_DELIMITED_STRING_LIST_SYNTAX);
1308
1309
1310
1311  /**
1312   * A field that holds a comma-delimited list of the external servers accessed
1313   * during the course of processing the operation.  Each server in the list
1314   * will consist of the name or IP address, a colon, and the port number.  This
1315   * field may appear in all types of operation result access log messages.
1316   */
1317  @NotNull public static final LogField SERVERS_ACCESSED =
1318       createField("SERVERS_ACCESSED", "serversAccessed",
1319            COMMA_DELIMITED_STRING_LIST_SYNTAX);
1320
1321
1322
1323  /**
1324   * A field that holds a unique value generated when the server started.  This
1325   * can help differentiate messages with the same connection ID and
1326   * operation ID (if applicable) because those values are reset upon a server
1327   * restart.  This field may appear in all types of access log messages.
1328   */
1329  @NotNull public static final LogField STARTUP_ID =
1330       createField("STARTUP_ID", "startupID", STRING_SYNTAX);
1331
1332
1333
1334  /**
1335   * A field that holds the address of a server to which the operation was
1336   * forwarded for processing.  This field may appear in access log messages for
1337   * operations that were forwarded to a remote system.
1338   */
1339  @NotNull public static final LogField TARGET_HOST =
1340       createField("TARGET_HOST", "targetHost", STRING_SYNTAX);
1341
1342
1343
1344  /**
1345   * A field that holds the port of a server to which the operation was
1346   * forwarded for processing.  This field may appear in access log messages for
1347   * operations that were forwarded to a remote system.
1348   */
1349  @NotNull public static final LogField TARGET_PORT =
1350       createField("TARGET_PORT", "targetPort", INTEGER_SYNTAX);
1351
1352
1353
1354  /**
1355   * A field that holds the protocol used to communicate with a remote server
1356   * for an operation that was forwarded for processing.  This field may appear
1357   * in access log messages for operations that were forwarded to a remote
1358   * system.
1359   */
1360  @NotNull public static final LogField TARGET_PROTOCOL =
1361       createField("TARGET_PROTOCOL", "targetProtocol", STRING_SYNTAX);
1362
1363
1364
1365  /**
1366   * A field that holds a numeric identifier for the thread that generated the
1367   * log message, which is also likely the thread that performed the associated
1368   * processing for the connection or operation).  This field may appear in all
1369   * types of access log messages.
1370   */
1371  @NotNull public static final LogField THREAD_ID =
1372       createField("THREAD_ID", "threadID", INTEGER_SYNTAX);
1373
1374
1375
1376  /**
1377   * A field that holds the connection ID for another operation that triggered
1378   * the associated operation.  This field may appear in all types of access log
1379   * messages that are associated with operations.
1380   */
1381  @NotNull public static final LogField TRIGGERED_BY_CONNECTION_ID =
1382       createField("TRIGGERED_BY_CONNECTION_ID", "triggeredByConn",
1383            INTEGER_SYNTAX);
1384
1385
1386
1387  /**
1388   * A field that holds the operation ID for another operation that triggered
1389   * the associated operation.  This field may appear in all types of access log
1390   * messages that are associated with operations.
1391   */
1392  @NotNull public static final LogField TRIGGERED_BY_OPERATION_ID =
1393       createField("TRIGGERED_BY_OPERATION_ID", "triggeredByOp",
1394            INTEGER_SYNTAX);
1395
1396
1397
1398  /**
1399   * A field that indicates whether the server accessed any uncached data in the
1400   * course of processing the operation.  This field may appear in all types of
1401   * operation result access log messages.
1402   */
1403  @NotNull public static final LogField UNCACHED_DATA_ACCESSED =
1404       createField("UNCACHED_DATA_ACCESSED", "uncachedDataAccessed",
1405            BOOLEAN_SYNTAX);
1406
1407
1408
1409  /**
1410   * A field that holds a comma-delimited list of the names of any privileges
1411   * used in the course of processing the operation.  This field may appear in
1412   * all types of operation result access log messages.
1413   */
1414  @NotNull public static final LogField USED_PRIVILEGES = createField(
1415       "USED_PRIVILEGES", "usedPrivileges", COMMA_DELIMITED_STRING_LIST_SYNTAX);
1416
1417
1418
1419  /**
1420   * A field that indicates whether the associated operation is being processed
1421   * using a worker thread from a thread pool dedicated to processing
1422   * administrative operations.  This field may appear in all types of
1423   * access log messages that are associated with operations.
1424   */
1425  @NotNull public static final LogField USING_ADMIN_SESSION_WORKER_THREAD =
1426       createField("USING_ADMIN_SESSION_WORKER_THREAD",
1427            "usingAdminSessionWorkerThread", BOOLEAN_SYNTAX);
1428
1429
1430
1431  /**
1432   * A field that holds the length of time (in milliseconds) that the operation
1433   * had to wait in the work queue before being picked up for processing.  This
1434   * field may appear in all types of operation result access log messages.
1435   */
1436  @NotNull public static final LogField WORK_QUEUE_WAIT_TIME_MILLIS =
1437       createField("WORK_QUEUE_WAIT_TIME_MILLIS", "qtime", INTEGER_SYNTAX);
1438
1439
1440
1441  /**
1442   * Prevents this utility class from being instantiated.
1443   */
1444  private TextFormattedAccessLogFields()
1445  {
1446    // No implementation is required.
1447  }
1448
1449
1450
1451  /**
1452   * Creates a new log field with the provided name and syntax and registers it
1453   * in the {@link #DEFINED_FIELDS} map.
1454   *
1455   * @param  constantName  The name for the constant in which the field is
1456   *                       defined.  It must not be {@code null} or empty.
1457   * @param  fieldName     The name for the field as it appears in log messages.
1458   *                       It must not be {@code null} or empty.
1459   * @param  fieldSyntax   The expected syntax for the field.  It must not be
1460   *                       {@code null} or empty.
1461   *
1462   * @return  The log field that was created.
1463   */
1464  @NotNull()
1465  private static LogField createField(@NotNull final String constantName,
1466               @NotNull final String fieldName,
1467               @NotNull final LogFieldSyntax<?> fieldSyntax)
1468  {
1469    final LogField field = new LogField(fieldName, constantName, fieldSyntax);
1470    DEFINED_FIELDS.put(constantName, field);
1471    return field;
1472  }
1473
1474
1475
1476  /**
1477   * Retrieves a map of all predefined fields, indexed by the name of the
1478   * constant in which the field is defined.
1479   *
1480   * @return  A map of all predefined fields.
1481   */
1482  @NotNull()
1483  public static Map<String,LogField> getDefinedFields()
1484  {
1485    Map<String,LogField> m = READ_ONLY_DEFINED_FIELDS_REF.get();
1486    if (m != null)
1487    {
1488      return m;
1489    }
1490
1491    m = Collections.unmodifiableMap(new TreeMap<>(DEFINED_FIELDS));
1492    if (READ_ONLY_DEFINED_FIELDS_REF.compareAndSet(null, m))
1493    {
1494      return m;
1495    }
1496    else
1497    {
1498      return READ_ONLY_DEFINED_FIELDS_REF.get();
1499    }
1500  }
1501
1502
1503
1504  /**
1505   * Retrieves the predefined log field instance that is defined in the
1506   * specified constants.
1507   *
1508   * @param  constantName  The name of the constant in which the desired field
1509   *                       is defined.  It must not be {@code null}.
1510   *
1511   * @return  The log field instance defined in the specified constant, or
1512   *          {@code null} if there is no such constant.
1513   */
1514  @Nullable()
1515  public static LogField getFieldForConstantName(
1516              @NotNull final String constantName)
1517  {
1518    final String convertedName =
1519         StaticUtils.toUpperCase(constantName).replace('-', '_');
1520    return DEFINED_FIELDS.get(convertedName);
1521  }
1522}