Templates: show correct values of sdnc-preload, volume-group name
[vid.git] / vid-app-common / src / main / java / org / onap / vid / model / serviceInstantiation / ServiceInstantiationTemplate.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.vid.model.serviceInstantiation;
22
23 import static java.util.Collections.emptyMap;
24
25 import java.util.Map;
26 import java.util.Objects;
27 import org.onap.vid.model.aaiTree.ExistingElementsCounterMaps;
28
29 public class ServiceInstantiationTemplate extends ServiceInstantiation implements ExistingElementsCounterMaps {
30
31     private final Map<String, Long> existingVNFCounterMap;
32     private final Map<String, Long> existingNetworksCounterMap;
33     private final Map<String, Long> existingVnfGroupCounterMap;
34     private final Map<String, Long> existingVRFCounterMap;
35     private final Map<String, String> existingNames = emptyMap();
36
37     public ServiceInstantiationTemplate(
38         ServiceInstantiation baseService,
39         Map<String, Long> vnfCounterMap,
40         Map<String, Long> networksCounterMap,
41         Map<String, Long> vnfGroupCounterMap,
42         Map<String, Long> VRFCounterMap
43     ) {
44         super(
45             baseService.getModelInfo(), baseService.getOwningEntityId(), baseService.getOwningEntityName(),
46             baseService.getProjectName(), baseService.getGlobalSubscriberId(), baseService.getSubscriberName(),
47             baseService.getProductFamilyId(), baseService.getInstanceName(), baseService.getSubscriptionServiceType(),
48             baseService.getLcpCloudRegionId(), baseService.getLcpCloudRegionId(), baseService.getTenantId(),
49             baseService.getTenantName(), baseService.getAicZoneId(), baseService.getAicZoneName(),
50             baseService.getVnfs(), baseService.getNetworks(), baseService.getVnfGroups(), baseService.getVrfs(),
51             baseService.getInstanceParams(), baseService.isPause(), baseService.getBulkSize(),
52             baseService.isRollbackOnFailure(), baseService.isALaCarte(), baseService.getTestApi(),
53             baseService.getInstanceId(), Objects.toString(baseService.getAction(), null),
54             baseService.getTrackById(), baseService.getIsFailed(), baseService.getStatusMessage(),
55             baseService.getVidNotions()
56         );
57
58         this.existingVNFCounterMap = vnfCounterMap;
59         this.existingNetworksCounterMap = networksCounterMap;
60         this.existingVnfGroupCounterMap = vnfGroupCounterMap;
61         this.existingVRFCounterMap = VRFCounterMap;
62     }
63
64     @Override
65     public Map<String, Long> getExistingVNFCounterMap() {
66         return existingVNFCounterMap;
67     }
68
69     @Override
70     public Map<String, Long> getExistingNetworksCounterMap() {
71         return existingNetworksCounterMap;
72     }
73
74     @Override
75     public Map<String, Long> getExistingVnfGroupCounterMap() {
76         return existingVnfGroupCounterMap;
77     }
78
79     @Override
80     public Map<String, Long> getExistingVRFCounterMap() {
81         return existingVRFCounterMap;
82     }
83
84     public Map<String, String> getExistingNames() {
85         return existingNames;
86     }
87 }