2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
6 * Modifications Copyright (C) 2019 Nordix Foundation.
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.onap.policy.appclcm;
24 import com.google.gson.annotations.SerializedName;
25 import java.io.Serializable;
26 import java.time.Instant;
27 import java.util.HashMap;
29 import java.util.UUID;
31 import lombok.NoArgsConstructor;
32 import lombok.NonNull;
33 import lombok.RequiredArgsConstructor;
36 @RequiredArgsConstructor
38 public class AppcLcmCommonHeader implements Serializable {
40 private static final long serialVersionUID = 6581963539127062114L;
42 @SerializedName(value = "timestamp")
43 private Instant timeStamp = Instant.now();
45 @SerializedName(value = "api-ver")
46 private String apiVer = "2.00";
49 @SerializedName(value = "originator-id")
50 private String originatorId;
53 @SerializedName(value = "request-id")
54 private UUID requestId;
57 @SerializedName(value = "sub-request-id")
58 private String subRequestId;
60 @SerializedName(value = "flags")
61 private Map<String, String> flags = new HashMap<>();
64 * Used to copy a common header.
66 * @param commonHeader a header that is defined by the lcm api guide that contains information
67 * about the request (requestId, flags, etc.)
69 public AppcLcmCommonHeader(AppcLcmCommonHeader commonHeader) {
70 this.originatorId = commonHeader.originatorId;
71 this.requestId = commonHeader.requestId;
72 this.subRequestId = commonHeader.subRequestId;
73 this.timeStamp = commonHeader.timeStamp;
74 if (commonHeader.flags != null) {
75 this.flags.putAll(commonHeader.flags);