22090e9f9ed5d7acec7c6e72d1be423faf060c2b
[dcaegen2/services/sdk.git] /
1 /*
2  * ============LICENSE_START=======================================================
3  * DCAEGEN2-SERVICES-SDK
4  * ================================================================================
5  * Copyright (C) 2018 NOKIA Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.dcaegen2.services.sdk.rest.services.model.logging;
22
23 import org.slf4j.MDC;
24
25 import java.util.Map;
26
27 public final class MdcVariables {
28
29     public static final String X_ONAP_REQUEST_ID = "X-ONAP-RequestID";
30     public static final String X_INVOCATION_ID = "X-InvocationID";
31     public static final String REQUEST_ID = "RequestID";
32     public static final String INVOCATION_ID = "InvocationID";
33     public static final String INSTANCE_UUID = "InstanceUUID";
34     public static final String RESPONSE_CODE = "ResponseCode";
35     public static final String SERVICE_NAME = "ServiceName";
36
37     private MdcVariables() {
38     }
39
40     public static void setMdcContextMap(Map<String, String> mdcContextMap) {
41         if (mdcContextMap != null) {
42             MDC.setContextMap(mdcContextMap);
43         }
44     }
45 }