2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
24 package org.onap.clamp.clds.util;
27 * Constants for standard ONAP headers, MDCs, etc.
29 public final class ONAPLogConstants {
31 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
35 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
38 * Hide and forbid construction.
40 private ONAPLogConstants() {
41 throw new UnsupportedOperationException();
48 public static final class Markers {
50 /** Marker reporting invocation. */
51 public static final String INVOKE = "INVOKE";
53 /** Marker reporting synchronous invocation. */
54 public static final String INVOKE_RETURN = "INVOKE-RETURN";
56 /** Marker reporting synchronous invocation. */
57 public static final String INVOKE_SYNC = "INVOKE-SYNCHRONOUS";
59 /** Marker reporting entry into a component. */
60 public static final String ENTRY = "ENTRY";
62 /** Marker reporting exit from a component. */
63 public static final String EXIT = "EXIT";
66 * Hide and forbid construction.
69 throw new UnsupportedOperationException();
76 public static final class MDCs {
78 // Tracing. ////////////////////////////////////////////////////////////
80 /** MDC correlating messages for an invocation. */
81 public static final String INVOCATION_ID = "InvocationID";
83 /** MDC correlating messages for a logical transaction. */
84 public static final String REQUEST_ID = "RequestID";
86 /** MDC recording calling service. */
87 public static final String PARTNER_NAME = "PartnerName";
89 /** MDC recording current service. */
90 public static final String SERVICE_NAME = "ServiceName";
92 /** MDC recording target service. */
93 public static final String TARGET_SERVICE_NAME = "TargetServiceName";
95 /** MDC recording InvocationID Out. */
96 public static final String INVOCATIONID_OUT = "InvocationIDOut";
98 /** MDC recording target entity. */
99 public static final String TARGET_ENTITY = "TargetEngity";
101 /** MDC recording current service instance. */
102 public static final String INSTANCE_UUID = "InstanceUUID";
104 // Network. ////////////////////////////////////////////////////////////
106 /** MDC recording caller address. */
107 public static final String CLIENT_IP_ADDRESS = "ClientIPAddress";
109 /** MDC recording server address. */
110 public static final String SERVER_FQDN = "ServerFQDN";
113 * MDC recording timestamp at the start of the current request,
114 * with the same scope as {@link #REQUEST_ID}.
118 * <ul>Easily confused with {@link #INVOKE_TIMESTAMP}.</ul>
119 * <ul>No mechanism for propagation between components, e.g. via HTTP headers.</ul>
120 * <ul>Whatever mechanism we define, it's going to be costly.</ul>
124 public static final String ENTRY_TIMESTAMP = "EntryTimestamp";
126 /** MDC recording timestamp at the start of the current invocation. */
127 public static final String INVOKE_TIMESTAMP = "InvokeTimestamp";
129 // Outcomes. ///////////////////////////////////////////////////////////
131 /** MDC reporting outcome code. */
132 public static final String RESPONSE_CODE = "ResponseCode";
134 /** MDC reporting outcome description. */
135 public static final String RESPONSE_DESCRIPTION = "ResponseDescription";
137 /** MDC reporting outcome error level. */
138 public static final String RESPONSE_SEVERITY = "Severity";
140 /** MDC reporting outcome error level. */
141 public static final String RESPONSE_STATUS_CODE = "StatusCode";
143 // Unsorted. ///////////////////////////////////////////////////////////
146 * Hide and forbid construction.
149 throw new UnsupportedOperationException();
154 * Header name constants.
156 public static final class Headers {
158 /** HTTP <tt>X-ONAP-RequestID</tt> header. */
159 public static final String REQUEST_ID = "X-ONAP-RequestID";
161 /** HTTP <tt>X-ONAP-InvocationID</tt> header. */
162 public static final String INVOCATION_ID = "X-ONAP-InvocationID";
164 /** HTTP <tt>X-ONAP-PartnerName</tt> header. */
165 public static final String PARTNER_NAME = "X-ONAP-PartnerName";
168 * Hide and forbid construction.
171 throw new UnsupportedOperationException();
175 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
179 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
182 * Response success or not, for setting <tt>StatusCode</tt>.
184 public enum ResponseStatus {