First part of onap rename
[appc.git] / appc-event-listener / appc-event-listener-bundle / src / main / java / org / openecomp / appc / listener / LCM / model / CommonHeader.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
8  * =============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * 
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  * ============LICENSE_END=========================================================
23  */
24
25 package org.onap.appc.listener.LCM.model;
26
27 import com.fasterxml.jackson.annotation.JsonProperty;
28
29 import java.io.Serializable;
30 import java.text.DateFormat;
31 import java.text.SimpleDateFormat;
32 import java.util.Map;
33
34 import org.onap.appc.util.Time;
35
36 public class CommonHeader implements Serializable {
37     @JsonProperty("timestamp")
38     private String timeStamp;
39     @JsonProperty("api-ver")
40     private String apiVer;
41     @JsonProperty("originator-id")
42     private String originatorId;
43     @JsonProperty("request-id")
44     private String requestID;
45     @JsonProperty("sub-request-id")
46     private String subRequestId;
47     @JsonProperty("flags")
48     private Map<String, String> flags;
49
50     private static final DateFormat ZULU_FORMATTER = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS'Z'");
51
52     public CommonHeader() {
53     }
54
55     public CommonHeader(CommonHeader commonHeader) {
56         // changed to current system time
57         timeStamp = ZULU_FORMATTER.format(Time.utcDate());
58
59         apiVer = commonHeader.getApiVer();
60         originatorId = commonHeader.getOriginatorId();
61         requestID = commonHeader.getRequestID();
62         subRequestId = commonHeader.getSubRequestId();
63         flags = commonHeader.getFlags();
64     }
65
66
67
68     public String getTimeStamp() {
69         return timeStamp;
70     }
71
72     public void setTimeStamp(String timeStamp) {
73         this.timeStamp = timeStamp;
74     }
75
76     public String getApiVer() {
77         return apiVer;
78     }
79
80     public void setApiVer(String apiVer) {
81         this.apiVer = apiVer;
82     }
83
84     public String getRequestID() {
85         return requestID;
86     }
87
88     public void setRequestID(String requestID) {
89         this.requestID = requestID;
90     }
91
92     public String getOriginatorId() {
93         return originatorId;
94     }
95
96     public void setOriginatorId(String originatorId) {
97         this.originatorId = originatorId;
98     }
99
100     public String getSubRequestId() {
101         return subRequestId;
102     }
103
104     public void setSubRequestId(String subRequestId) {
105         this.subRequestId = subRequestId;
106     }
107
108     public Map<String, String> getFlags() {
109         return flags;
110     }
111
112     public void setFlags(Map<String, String> flags) {
113         this.flags = flags;
114     }
115 }