2  * ============LICENSE_START=======================================================
 
   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
 
  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=========================================================
 
  20  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
 
  23 package org.openecomp.appc.listener.LCM.model;
 
  25 import com.fasterxml.jackson.annotation.JsonProperty;
 
  27 import java.io.Serializable;
 
  28 import java.text.DateFormat;
 
  29 import java.text.SimpleDateFormat;
 
  32 import org.openecomp.appc.util.Time;
 
  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;
 
  48     private static final DateFormat ZULU_FORMATTER = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS'Z'");
 
  50     public CommonHeader() {
 
  53     public CommonHeader(CommonHeader commonHeader) {
 
  54         // changed to current system time
 
  55         timeStamp = ZULU_FORMATTER.format(Time.utcDate());
 
  57         apiVer = commonHeader.getApiVer();
 
  58         originatorId = commonHeader.getOriginatorId();
 
  59         requestID = commonHeader.getRequestID();
 
  60         subRequestId = commonHeader.getSubRequestId();
 
  61         flags = commonHeader.getFlags();
 
  66     public String getTimeStamp() {
 
  70     public void setTimeStamp(String timeStamp) {
 
  71         this.timeStamp = timeStamp;
 
  74     public String getApiVer() {
 
  78     public void setApiVer(String apiVer) {
 
  82     public String getRequestID() {
 
  86     public void setRequestID(String requestID) {
 
  87         this.requestID = requestID;
 
  90     public String getOriginatorId() {
 
  94     public void setOriginatorId(String originatorId) {
 
  95         this.originatorId = originatorId;
 
  98     public String getSubRequestId() {
 
 102     public void setSubRequestId(String subRequestId) {
 
 103         this.subRequestId = subRequestId;
 
 106     public Map<String, String> getFlags() {
 
 110     public void setFlags(Map<String, String> flags) {