aboutsummaryrefslogtreecommitdiffstats
path: root/policy-utils/src/main/java/org/onap/policy/drools/utils/logging/MdcTransactionConstants.java
blob: 936449c8244396aa956b34c7ea75d5306b9ad0c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
/*-
 * ============LICENSE_START=======================================================
 * policy-utils
 * ================================================================================
 * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.onap.policy.drools.utils.logging;

import org.onap.policy.common.utils.network.NetworkUtil;

public class MdcTransactionConstants {
    /*
     * The fields must match the naming given at
     * https://wiki.onap.org/pages/viewpage.action?pageId=20087036
     */

    /**
     * End to end transaction ID. Subtransactions will inherit this value from the transaction.
     */
    public static final String REQUEST_ID = "RequestID";

    /**
     * Invocation ID, ie. SubTransaction ID.
     */
    public static final String INVOCATION_ID = "InvocationID";

    /**
     * Service Name. Both transactions and subtransactions will have its own copy.
     */
    public static final String SERVICE_NAME = "ServiceName";

    /**
     * Partner Name Subtransactions will inherit this value from the transaction.
     */
    public static final String PARTNER_NAME = "PartnerName";

    /**
     * Start Timestamp. Both transactions and subtransactions will have its own copy.
     */
    public static final String BEGIN_TIMESTAMP = "BeginTimestamp";

    /**
     * End Timestamp. Both transactions and subtransactions will have its own copy.
     */
    public static final String END_TIMESTAMP = "EndTimestamp";

    /**
     * Elapsed Time. Both transactions and subtransactions will have its own copy.
     */
    public static final String ELAPSED_TIME = "ElapsedTime";

    /**
     * Elapsed Time. Both transactions and subtransactions will have its own copy.
     */
    public static final String SERVICE_INSTANCE_ID = "ServiceInstanceID";

    /**
     * Virtual Server Name. Subtransactions will inherit this value from the transaction.
     */
    public static final String VIRTUAL_SERVER_NAME = "VirtualServerName";

    /**
     * Status Code Both transactions and subtransactions will have its own copy.
     */
    public static final String STATUS_CODE = "StatusCode";

    /**
     * Response Code Both transactions and subtransactions will have its own copy.
     */
    public static final String RESPONSE_CODE = "ResponseCode";

    /**
     * Response Description Both transactions and subtransactions will have its own copy.
     */
    public static final String RESPONSE_DESCRIPTION = "ResponseDescription";

    /**
     * Instance UUID Both transactions and subtransactions will have its own copy.
     */
    public static final String INSTANCE_UUID = "InstanceUUID";

    /**
     * Severity Both transactions and subtransactions will have its own copy.
     */
    public static final String SEVERITY = "Severity";

    /**
     * Target Entity Both transactions and subtransactions will have its own copy.
     */
    public static final String TARGET_ENTITY = "TargetEntity";

    /**
     * Target Service Name Both transactions and subtransactions will have its own copy.
     */
    public static final String TARGET_SERVICE_NAME = "TargetServiceName";

    /**
     * Server Subtransactions inherit this value. if (this.getSources().size() == 1)
     * this.getSources().get(0).getTopic();
     */
    public static final String SERVER = "Server";

    /**
     * Server IP Address Subtransactions inherit this value.
     */
    public static final String SERVER_IP_ADDRESS = "ServerIpAddress";

    /**
     * Server FQDN Subtransactions inherit this value.
     */
    public static final String SERVER_FQDN = "ServerFQDN";

    /**
     * Client IP Address Both transactions and subtransactions will have its own copy.
     */
    public static final String CLIENT_IP_ADDRESS = "ClientIPAddress";

    /**
     * Process Key Both transactions and subtransactions will have its own copy.
     */
    public static final String PROCESS_KEY = "ProcessKey";

    /**
     * Remote Host Both transactions and subtransactions will have its own copy.
     */
    public static final String REMOTE_HOST = "RemoteHost";

    /**
     * Target Virtual Entity Both transactions and subtransactions will have its own copy.
     */
    public static final String TARGET_VIRTUAL_ENTITY = "TargetVirtualEntity";

    /**
     * Custom Field1.
     */
    public static final String CUSTOM_FIELD1 = "CustomField1";

    /**
     * Custom Field2.
     */
    public static final String CUSTOM_FIELD2 = "CustomField2";

    /**
     * Custom Field3.
     */
    public static final String CUSTOM_FIELD3 = "CustomField3";

    /**
     * Custom Field4.
     */
    public static final String CUSTOM_FIELD4 = "CustomField4";

    /**
     * Default Service Name.
     */
    public static final String DEFAULT_SERVICE_NAME = "PDP-D";

    /**
     * Default Host Name.
     */
    public static final String DEFAULT_HOSTNAME = NetworkUtil.getHostname();

    /**
     * Default Host IP.
     */
    public static final String DEFAULT_HOSTIP = NetworkUtil.getHostIp();

    /**
     * Status Code Complete.
     */
    public static final String STATUS_CODE_COMPLETE = "COMPLETE";

    /**
     * Status Code Error.
     */
    public static final String STATUS_CODE_FAILURE = "ERROR";

    private MdcTransactionConstants() {
        // do nothing
    }
}