Change metrics and transactions layout in logback.xml
[policy/drools-pdp.git] / policy-utils / src / main / java / org / onap / policy / drools / utils / logging / MdcTransactionConstants.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * policy-utils
4  * ================================================================================
5  * Copyright (C) 2019-2020 AT&T 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  */
19
20 package org.onap.policy.drools.utils.logging;
21
22 import org.onap.policy.common.utils.network.NetworkUtil;
23
24 public class MdcTransactionConstants {
25     /*
26      * The fields must match the naming given at
27      * https://wiki.onap.org/pages/viewpage.action?pageId=20087036
28      */
29
30     /**
31      * End to end transaction ID. Subtransactions will inherit this value from the transaction.
32      */
33     public static final String REQUEST_ID = "RequestID";
34
35     /**
36      * Invocation ID, ie. SubTransaction ID.
37      */
38     public static final String INVOCATION_ID = "InvocationID";
39
40     /**
41      * Service Name. Both transactions and subtransactions will have its own copy.
42      */
43     public static final String SERVICE_NAME = "ServiceName";
44
45     /**
46      * Partner Name Subtransactions will inherit this value from the transaction.
47      */
48     public static final String PARTNER_NAME = "PartnerName";
49
50     /**
51      * Start Timestamp. Both transactions and subtransactions will have its own copy.
52      */
53     public static final String BEGIN_TIMESTAMP = "BeginTimestamp";
54
55     /**
56      * End Timestamp. Both transactions and subtransactions will have its own copy.
57      */
58     public static final String END_TIMESTAMP = "EndTimestamp";
59
60     /**
61      * Elapsed Time. Both transactions and subtransactions will have its own copy.
62      */
63     public static final String ELAPSED_TIME = "ElapsedTime";
64
65     /**
66      * Elapsed Time. Both transactions and subtransactions will have its own copy.
67      */
68     public static final String SERVICE_INSTANCE_ID = "ServiceInstanceID";
69
70     /**
71      * Virtual Server Name. Subtransactions will inherit this value from the transaction.
72      */
73     public static final String VIRTUAL_SERVER_NAME = "VirtualServerName";
74
75     /**
76      * Status Code Both transactions and subtransactions will have its own copy.
77      */
78     public static final String STATUS_CODE = "StatusCode";
79
80     /**
81      * Response Code Both transactions and subtransactions will have its own copy.
82      */
83     public static final String RESPONSE_CODE = "ResponseCode";
84
85     /**
86      * Response Description Both transactions and subtransactions will have its own copy.
87      */
88     public static final String RESPONSE_DESCRIPTION = "ResponseDescription";
89
90     /**
91      * Instance UUID Both transactions and subtransactions will have its own copy.
92      */
93     public static final String INSTANCE_UUID = "InstanceUUID";
94
95     /**
96      * Severity Both transactions and subtransactions will have its own copy.
97      */
98     public static final String SEVERITY = "Severity";
99
100     /**
101      * Target Entity Both transactions and subtransactions will have its own copy.
102      */
103     public static final String TARGET_ENTITY = "TargetEntity";
104
105     /**
106      * Target Service Name Both transactions and subtransactions will have its own copy.
107      */
108     public static final String TARGET_SERVICE_NAME = "TargetServiceName";
109
110     /**
111      * Server Subtransactions inherit this value. if (this.getSources().size() == 1)
112      * this.getSources().get(0).getTopic();
113      */
114     public static final String SERVER = "Server";
115
116     /**
117      * Server IP Address Subtransactions inherit this value.
118      */
119     public static final String SERVER_IP_ADDRESS = "ServerIpAddress";
120
121     /**
122      * Server FQDN Subtransactions inherit this value.
123      */
124     public static final String SERVER_FQDN = "ServerFQDN";
125
126     /**
127      * Client IP Address Both transactions and subtransactions will have its own copy.
128      */
129     public static final String CLIENT_IP_ADDRESS = "ClientIPAddress";
130
131     /**
132      * Process Key Both transactions and subtransactions will have its own copy.
133      */
134     public static final String PROCESS_KEY = "ProcessKey";
135
136     /**
137      * Remote Host Both transactions and subtransactions will have its own copy.
138      */
139     public static final String REMOTE_HOST = "RemoteHost";
140
141     /**
142      * Target Virtual Entity Both transactions and subtransactions will have its own copy.
143      */
144     public static final String TARGET_VIRTUAL_ENTITY = "TargetVirtualEntity";
145
146     /**
147      * Custom Field1.
148      */
149     public static final String CUSTOM_FIELD1 = "CustomField1";
150
151     /**
152      * Custom Field2.
153      */
154     public static final String CUSTOM_FIELD2 = "CustomField2";
155
156     /**
157      * Custom Field3.
158      */
159     public static final String CUSTOM_FIELD3 = "CustomField3";
160
161     /**
162      * Custom Field4.
163      */
164     public static final String CUSTOM_FIELD4 = "CustomField4";
165
166     /**
167      * Default Service Name.
168      */
169     public static final String DEFAULT_SERVICE_NAME = "PDP-D";
170
171     /**
172      * Default Host Name.
173      */
174     public static final String DEFAULT_HOSTNAME = NetworkUtil.getHostname();
175
176     /**
177      * Default Host IP.
178      */
179     public static final String DEFAULT_HOSTIP = NetworkUtil.getHostIp();
180
181     /**
182      * Status Code Complete.
183      */
184     public static final String STATUS_CODE_COMPLETE = "COMPLETE";
185
186     /**
187      * Status Code Error.
188      */
189     public static final String STATUS_CODE_FAILURE = "ERROR";
190
191     private MdcTransactionConstants() {
192         // do nothing
193     }
194 }