2 * ============LICENSE_START=======================================================
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
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 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 * ============LICENSE_END=========================================================
25 package org.openecomp.appc.listener.LCM.model;
27 import com.fasterxml.jackson.annotation.JsonProperty;
29 import java.io.Serializable;
30 import java.text.DateFormat;
31 import java.text.SimpleDateFormat;
34 import org.openecomp.appc.util.Time;
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;
50 private static final DateFormat ZULU_FORMATTER = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS'Z'");
52 public CommonHeader() {
55 public CommonHeader(CommonHeader commonHeader) {
56 // changed to current system time
57 timeStamp = ZULU_FORMATTER.format(Time.utcDate());
59 apiVer = commonHeader.getApiVer();
60 originatorId = commonHeader.getOriginatorId();
61 requestID = commonHeader.getRequestID();
62 subRequestId = commonHeader.getSubRequestId();
63 flags = commonHeader.getFlags();
68 public String getTimeStamp() {
72 public void setTimeStamp(String timeStamp) {
73 this.timeStamp = timeStamp;
76 public String getApiVer() {
80 public void setApiVer(String apiVer) {
84 public String getRequestID() {
88 public void setRequestID(String requestID) {
89 this.requestID = requestID;
92 public String getOriginatorId() {
96 public void setOriginatorId(String originatorId) {
97 this.originatorId = originatorId;
100 public String getSubRequestId() {
104 public void setSubRequestId(String subRequestId) {
105 this.subRequestId = subRequestId;
108 public Map<String, String> getFlags() {
112 public void setFlags(Map<String, String> flags) {