2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
22 package org.openecomp.appc.listener.LCM.model;
24 import com.fasterxml.jackson.annotation.JsonProperty;
26 import java.io.Serializable;
27 import java.text.DateFormat;
28 import java.text.SimpleDateFormat;
31 import org.openecomp.appc.util.Time;
33 public class CommonHeader implements Serializable {
34 @JsonProperty("timestamp")
35 private String timeStamp;
36 @JsonProperty("api-ver")
37 private String apiVer;
38 @JsonProperty("originator-id")
39 private String originatorId;
40 @JsonProperty("request-id")
41 private String requestID;
42 @JsonProperty("sub-request-id")
43 private String subRequestId;
44 @JsonProperty("flags")
45 private Map<String, String> flags;
47 private static final DateFormat ZULU_FORMATTER = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS'Z'");
49 public CommonHeader() {
52 public CommonHeader(CommonHeader commonHeader) {
53 // changed to current system time
54 timeStamp = ZULU_FORMATTER.format(Time.utcDate());
56 apiVer = commonHeader.getApiVer();
57 originatorId = commonHeader.getOriginatorId();
58 requestID = commonHeader.getRequestID();
59 subRequestId = commonHeader.getSubRequestId();
60 flags = commonHeader.getFlags();
65 public String getTimeStamp() {
69 public void setTimeStamp(String timeStamp) {
70 this.timeStamp = timeStamp;
73 public String getApiVer() {
77 public void setApiVer(String apiVer) {
81 public String getRequestID() {
85 public void setRequestID(String requestID) {
86 this.requestID = requestID;
89 public String getOriginatorId() {
93 public void setOriginatorId(String originatorId) {
94 this.originatorId = originatorId;
97 public String getSubRequestId() {
101 public void setSubRequestId(String subRequestId) {
102 this.subRequestId = subRequestId;
105 public Map<String, String> getFlags() {
109 public void setFlags(Map<String, String> flags) {