2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * ============LICENSE_END=========================================================
24 package org.onap.appc.listener.LCM.model;
26 import com.fasterxml.jackson.annotation.JsonProperty;
28 import java.io.Serializable;
29 import java.text.DateFormat;
30 import java.text.SimpleDateFormat;
33 import org.onap.appc.util.Time;
35 public class CommonHeader implements Serializable {
36 @JsonProperty("timestamp")
37 private String timeStamp;
38 @JsonProperty("api-ver")
39 private String apiVer;
40 @JsonProperty("originator-id")
41 private String originatorId;
42 @JsonProperty("request-id")
43 private String requestID;
44 @JsonProperty("sub-request-id")
45 private String subRequestId;
46 @JsonProperty("flags")
47 private Map<String, String> flags;
49 private static final DateFormat ZULU_FORMATTER = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS'Z'");
51 public CommonHeader() {
54 public CommonHeader(CommonHeader commonHeader) {
55 // changed to current system time
56 timeStamp = ZULU_FORMATTER.format(Time.utcDate());
58 apiVer = commonHeader.getApiVer();
59 originatorId = commonHeader.getOriginatorId();
60 requestID = commonHeader.getRequestID();
61 subRequestId = commonHeader.getSubRequestId();
62 flags = commonHeader.getFlags();
67 public String getTimeStamp() {
71 public void setTimeStamp(String timeStamp) {
72 this.timeStamp = timeStamp;
75 public String getApiVer() {
79 public void setApiVer(String apiVer) {
83 public String getRequestID() {
87 public void setRequestID(String requestID) {
88 this.requestID = requestID;
91 public String getOriginatorId() {
95 public void setOriginatorId(String originatorId) {
96 this.originatorId = originatorId;
99 public String getSubRequestId() {
103 public void setSubRequestId(String subRequestId) {
104 this.subRequestId = subRequestId;
107 public Map<String, String> getFlags() {
111 public void setFlags(Map<String, String> flags) {