Updating licenses in all files
[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  * APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * Copyright (C) 2017 Amdocs
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
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
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  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
21  */
22
23 package org.openecomp.appc.listener.LCM.model;
24
25 import com.fasterxml.jackson.annotation.JsonProperty;
26
27 import java.io.Serializable;
28 import java.text.DateFormat;
29 import java.text.SimpleDateFormat;
30 import java.util.Map;
31
32 import org.openecomp.appc.util.Time;
33
34 public class CommonHeader implements Serializable {
35     @JsonProperty("timestamp")
36     private String timeStamp;
37     @JsonProperty("api-ver")
38     private String apiVer;
39     @JsonProperty("originator-id")
40     private String originatorId;
41     @JsonProperty("request-id")
42     private String requestID;
43     @JsonProperty("sub-request-id")
44     private String subRequestId;
45     @JsonProperty("flags")
46     private Map<String, String> flags;
47
48     private static final DateFormat ZULU_FORMATTER = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS'Z'");
49
50     public CommonHeader() {
51     }
52
53     public CommonHeader(CommonHeader commonHeader) {
54         // changed to current system time
55         timeStamp = ZULU_FORMATTER.format(Time.utcDate());
56
57         apiVer = commonHeader.getApiVer();
58         originatorId = commonHeader.getOriginatorId();
59         requestID = commonHeader.getRequestID();
60         subRequestId = commonHeader.getSubRequestId();
61         flags = commonHeader.getFlags();
62     }
63
64
65
66     public String getTimeStamp() {
67         return timeStamp;
68     }
69
70     public void setTimeStamp(String timeStamp) {
71         this.timeStamp = timeStamp;
72     }
73
74     public String getApiVer() {
75         return apiVer;
76     }
77
78     public void setApiVer(String apiVer) {
79         this.apiVer = apiVer;
80     }
81
82     public String getRequestID() {
83         return requestID;
84     }
85
86     public void setRequestID(String requestID) {
87         this.requestID = requestID;
88     }
89
90     public String getOriginatorId() {
91         return originatorId;
92     }
93
94     public void setOriginatorId(String originatorId) {
95         this.originatorId = originatorId;
96     }
97
98     public String getSubRequestId() {
99         return subRequestId;
100     }
101
102     public void setSubRequestId(String subRequestId) {
103         this.subRequestId = subRequestId;
104     }
105
106     public Map<String, String> getFlags() {
107         return flags;
108     }
109
110     public void setFlags(Map<String, String> flags) {
111         this.flags = flags;
112     }
113 }