2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2017 Amdocs
8 * =============================================================================
9 * Modification Copyright (C) 2019 IBM
10 * =============================================================================
11 * Licensed under the Apache License, Version 2.0 (the "License");
12 * you may not use this file except in compliance with the License.
13 * You may obtain a copy of the License at
15 * http://www.apache.org/licenses/LICENSE-2.0
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
23 * ============LICENSE_END=========================================================
26 package org.onap.appc.listener.LCM.model;
28 import com.fasterxml.jackson.annotation.JsonProperty;
30 import java.io.Serializable;
31 import java.text.DateFormat;
32 import java.text.SimpleDateFormat;
35 import org.onap.appc.util.Time;
37 public class CommonHeader implements Serializable {
38 @JsonProperty("timestamp")
39 private String timeStamp;
40 @JsonProperty("api-ver")
41 private String apiVer;
42 @JsonProperty("originator-id")
43 private String originatorId;
44 @JsonProperty("request-id")
45 private String requestID;
46 @JsonProperty("sub-request-id")
47 private String subRequestId;
48 @JsonProperty("flags")
49 private Map<String, String> flags;
51 private final DateFormat ZULU_FORMATTER = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS'Z'");
53 public CommonHeader() {
56 public CommonHeader(CommonHeader commonHeader) {
57 // changed to current system time
58 timeStamp = ZULU_FORMATTER.format(Time.utcDate());
60 apiVer = commonHeader.getApiVer();
61 originatorId = commonHeader.getOriginatorId();
62 requestID = commonHeader.getRequestID();
63 subRequestId = commonHeader.getSubRequestId();
64 flags = commonHeader.getFlags();
69 public String getTimeStamp() {
73 public void setTimeStamp(String timeStamp) {
74 this.timeStamp = timeStamp;
77 public String getApiVer() {
81 public void setApiVer(String apiVer) {
85 public String getRequestID() {
89 public void setRequestID(String requestID) {
90 this.requestID = requestID;
93 public String getOriginatorId() {
97 public void setOriginatorId(String originatorId) {
98 this.originatorId = originatorId;
101 public String getSubRequestId() {
105 public void setSubRequestId(String subRequestId) {
106 this.subRequestId = subRequestId;
109 public Map<String, String> getFlags() {
113 public void setFlags(Map<String, String> flags) {