2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.bpmn.servicedecomposition.tasks;
23 import java.util.ArrayList;
24 import java.util.Arrays;
25 import java.util.HashMap;
26 import java.util.List;
28 import java.util.Optional;
30 import org.modelmapper.ModelMapper;
31 import org.modelmapper.convention.MatchingStrategies;
32 import org.onap.so.bpmn.servicedecomposition.bbobjects.AllottedResource;
33 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
34 import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection;
35 import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
36 import org.onap.so.bpmn.servicedecomposition.bbobjects.CtagAssignment;
37 import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
38 import org.onap.so.bpmn.servicedecomposition.bbobjects.Entitlement;
39 import org.onap.so.bpmn.servicedecomposition.bbobjects.Evc;
40 import org.onap.so.bpmn.servicedecomposition.bbobjects.ForwarderEvc;
41 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
42 import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
43 import org.onap.so.bpmn.servicedecomposition.bbobjects.LagInterface;
44 import org.onap.so.bpmn.servicedecomposition.bbobjects.LineOfBusiness;
45 import org.onap.so.bpmn.servicedecomposition.bbobjects.NetworkPolicy;
46 import org.onap.so.bpmn.servicedecomposition.bbobjects.OwningEntity;
47 import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform;
48 import org.onap.so.bpmn.servicedecomposition.bbobjects.Project;
49 import org.onap.so.bpmn.servicedecomposition.bbobjects.RouteTableReference;
50 import org.onap.so.bpmn.servicedecomposition.bbobjects.SegmentationAssignment;
51 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
52 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription;
53 import org.onap.so.bpmn.servicedecomposition.bbobjects.Subnet;
54 import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
55 import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
56 import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
57 import org.onap.so.bpmn.servicedecomposition.generalobjects.License;
58 import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext;
59 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
60 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
61 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoCollection;
62 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration;
63 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
64 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup;
65 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoNetwork;
66 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
67 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
68 import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization;
69 import org.onap.so.db.catalog.beans.CollectionResource;
70 import org.onap.so.db.catalog.beans.CollectionResourceCustomization;
71 import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization;
72 import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
73 import org.onap.so.db.catalog.beans.InstanceGroup;
74 import org.onap.so.db.catalog.beans.InstanceGroupType;
75 import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
76 import org.onap.so.db.catalog.beans.OrchestrationStatus;
77 import org.onap.so.db.catalog.beans.Service;
78 import org.onap.so.db.catalog.beans.VfModuleCustomization;
79 import org.onap.so.db.catalog.beans.VnfResourceCustomization;
80 import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization;
81 import org.onap.so.logger.MsoLogger;
82 import org.onap.so.serviceinstancebeans.CloudConfiguration;
83 import org.onap.so.serviceinstancebeans.RequestDetails;
84 import org.springframework.stereotype.Component;
86 @Component("BBInputSetupMapperLayer")
87 public class BBInputSetupMapperLayer {
88 private static final String USER_PARAM_NAME_KEY = "name";
89 private static final String USER_PARAM_VALUE_KEY = "value";
91 private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,
92 BBInputSetupMapperLayer.class);
94 private ModelMapper modelMapper = new ModelMapper();
96 public Customer mapAAICustomer(org.onap.aai.domain.yang.Customer customerAAI) {
97 return modelMapper.map(customerAAI, Customer.class);
100 public ServiceSubscription mapAAIServiceSubscription(
101 org.onap.aai.domain.yang.ServiceSubscription serviceSubscriptionAAI) {
102 return modelMapper.map(serviceSubscriptionAAI, ServiceSubscription.class);
105 protected Project mapAAIProject(org.onap.aai.domain.yang.Project aaiProject) {
106 return modelMapper.map(aaiProject, Project.class);
109 protected OwningEntity mapAAIOwningEntity(org.onap.aai.domain.yang.OwningEntity aaiOwningEntity) {
110 return modelMapper.map(aaiOwningEntity, OwningEntity.class);
113 protected Platform mapAAIPlatform(org.onap.aai.domain.yang.Platform aaiPlatform) {
114 return modelMapper.map(aaiPlatform, Platform.class);
117 protected LineOfBusiness mapAAILineOfBusiness(org.onap.aai.domain.yang.LineOfBusiness aaiLineOfBusiness) {
118 return modelMapper.map(aaiLineOfBusiness, LineOfBusiness.class);
121 protected SegmentationAssignment mapAAISegmentationAssignment(
122 org.onap.aai.domain.yang.SegmentationAssignment aaiSegmentationAssignment) {
123 return modelMapper.map(aaiSegmentationAssignment, SegmentationAssignment.class);
126 protected CtagAssignment mapAAICtagAssignment(org.onap.aai.domain.yang.CtagAssignment aaiCtagAssignment) {
127 return modelMapper.map(aaiCtagAssignment, CtagAssignment.class);
130 protected Subnet mapAAISubnet(org.onap.aai.domain.yang.Subnet aaiSubnet) {
131 return modelMapper.map(aaiSubnet, Subnet.class);
134 protected License mapAAILicense(org.onap.aai.domain.yang.License aaiLicense) {
135 return modelMapper.map(aaiLicense, License.class);
138 protected Entitlement mapAAIEntitlement(org.onap.aai.domain.yang.Entitlement aaiEntitlement) {
139 return modelMapper.map(aaiEntitlement, Entitlement.class);
142 protected LagInterface mapAAILagInterface(org.onap.aai.domain.yang.LagInterface aaiLagInterface) {
143 return modelMapper.map(aaiLagInterface, LagInterface.class);
146 protected VfModule mapAAIVfModule(org.onap.aai.domain.yang.VfModule aaiVfModule) {
147 VfModule vfModule = modelMapper.map(aaiVfModule, VfModule.class);
148 vfModule.setOrchestrationStatus(this.mapOrchestrationStatusFromAAI(aaiVfModule.getOrchestrationStatus()));
150 ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule();
151 modelInfoVfModule.setIsBaseBoolean(aaiVfModule.isIsBaseVfModule());
152 vfModule.setModelInfoVfModule(modelInfoVfModule);
156 public NetworkPolicy mapAAINetworkPolicy(org.onap.aai.domain.yang.NetworkPolicy aaiNetworkPolicy) {
157 return modelMapper.map(aaiNetworkPolicy, NetworkPolicy.class);
160 protected VolumeGroup mapAAIVolumeGroup(org.onap.aai.domain.yang.VolumeGroup aaiVolumeGroup) {
161 VolumeGroup volumeGroup = modelMapper.map(aaiVolumeGroup, VolumeGroup.class);
162 volumeGroup.setOrchestrationStatus(this.mapOrchestrationStatusFromAAI(aaiVolumeGroup.getOrchestrationStatus()));
166 protected void setPlatformAndLOBIntoServiceInstance(Platform platformMSO, LineOfBusiness lineOfBusinessMSO,
167 ServiceInstance serviceInstance, Map<ResourceKey, String> resourcesToBeOrchestrated) {
168 String vnfId = resourcesToBeOrchestrated.get(ResourceKey.GENERIC_VNF_ID);
169 if (vnfId != null && !serviceInstance.getVnfs().isEmpty()) {
170 for (GenericVnf vnf : serviceInstance.getVnfs()) {
171 if (vnf.getVnfId().equalsIgnoreCase(vnfId)) {
172 vnf.setPlatform(platformMSO);
173 vnf.setLineOfBusiness(lineOfBusinessMSO);
180 public ModelInfoServiceInstance mapCatalogServiceIntoServiceInstance(Service service) {
181 return modelMapper.map(service, ModelInfoServiceInstance.class);
184 protected ModelInfoInstanceGroup mapCatalogInstanceGroupToInstanceGroup(CollectionResourceCustomization collectionCust, InstanceGroup instanceGroup) {
185 ModelInfoInstanceGroup modelInfoInstanceGroup = modelMapper.map(instanceGroup, ModelInfoInstanceGroup.class);
186 if(instanceGroup.getType() != null && instanceGroup.getType().equals(InstanceGroupType.L3_NETWORK))
187 modelInfoInstanceGroup.setType(ModelInfoInstanceGroup.TYPE_L3_NETWORK);
189 modelInfoInstanceGroup.setType(ModelInfoInstanceGroup.TYPE_VNFC);
190 if(collectionCust != null) {
191 List<CollectionResourceInstanceGroupCustomization> instanceGroupCustList = instanceGroup.getCollectionInstanceGroupCustomizations();
192 for(CollectionResourceInstanceGroupCustomization collectionInsatnceGroupCust : instanceGroupCustList) {
193 if(collectionInsatnceGroupCust.getModelCustomizationUUID().equalsIgnoreCase(collectionCust.getModelCustomizationUUID())) {
194 modelInfoInstanceGroup.setFunction(collectionInsatnceGroupCust.getFunction());
195 modelInfoInstanceGroup.setDescription(collectionInsatnceGroupCust.getDescription());
200 return modelInfoInstanceGroup;
203 protected ModelInfoCollection mapCatalogCollectionToCollection(CollectionResourceCustomization collectionCust,
204 CollectionResource collectionResource) {
205 ModelInfoCollection modelInfoCollection = new ModelInfoCollection();
206 modelInfoCollection.setCollectionFunction(collectionCust.getFunction());
207 modelInfoCollection.setCollectionRole(collectionCust.getRole());
208 modelInfoCollection.setCollectionType(collectionCust.getType());
209 modelInfoCollection.setDescription(collectionResource.getDescription());
210 modelInfoCollection.setModelInvariantUUID(collectionResource.getModelInvariantUUID());
211 modelInfoCollection.setModelVersionId(collectionResource.getModelUUID());
212 modelInfoCollection.setModelCustomizationUUID(collectionCust.getModelCustomizationUUID());
213 return modelInfoCollection;
216 public ServiceInstance mapAAIServiceInstanceIntoServiceInstance(
217 org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance) {
218 ServiceInstance serviceInstance = modelMapper.map(aaiServiceInstance, ServiceInstance.class);
219 if (aaiServiceInstance.getAllottedResources() != null) {
220 for (org.onap.aai.domain.yang.AllottedResource allottedResource : aaiServiceInstance.getAllottedResources()
221 .getAllottedResource()) {
222 serviceInstance.getAllottedResources().add(mapAAIAllottedResource(allottedResource));
225 serviceInstance.setOrchestrationStatus(
226 this.mapOrchestrationStatusFromAAI(aaiServiceInstance.getOrchestrationStatus()));
227 return serviceInstance;
230 protected AllottedResource mapAAIAllottedResource(org.onap.aai.domain.yang.AllottedResource aaiAllottedResource) {
231 AllottedResource allottedResource = modelMapper.map(aaiAllottedResource, AllottedResource.class);
232 return allottedResource;
235 protected L3Network mapAAIL3Network(org.onap.aai.domain.yang.L3Network aaiL3Network) {
236 L3Network network = modelMapper.map(aaiL3Network, L3Network.class);
237 mapAllSubnetsIntoL3Network(aaiL3Network, network);
238 mapAllCtagAssignmentsIntoL3Network(aaiL3Network, network);
239 mapAllSegmentationAssignmentsIntoL3Network(aaiL3Network, network);
240 network.setOrchestrationStatus(this.mapOrchestrationStatusFromAAI(aaiL3Network.getOrchestrationStatus()));
244 protected void mapAllSegmentationAssignmentsIntoL3Network(org.onap.aai.domain.yang.L3Network aaiL3Network,
246 if (aaiL3Network.getSegmentationAssignments() != null) {
247 for (org.onap.aai.domain.yang.SegmentationAssignment aaiSegmentationAssignment : aaiL3Network
248 .getSegmentationAssignments().getSegmentationAssignment()) {
249 network.getSegmentationAssignments().add(mapAAISegmentationAssignment(aaiSegmentationAssignment));
254 protected void mapAllCtagAssignmentsIntoL3Network(org.onap.aai.domain.yang.L3Network aaiL3Network,
256 if (aaiL3Network.getCtagAssignments() != null) {
257 for (org.onap.aai.domain.yang.CtagAssignment aaiCtagAssignment : aaiL3Network.getCtagAssignments()
258 .getCtagAssignment()) {
259 network.getCtagAssignments().add(mapAAICtagAssignment(aaiCtagAssignment));
264 protected void mapAllSubnetsIntoL3Network(org.onap.aai.domain.yang.L3Network aaiL3Network, L3Network network) {
265 if (aaiL3Network.getSubnets() != null) {
266 for (org.onap.aai.domain.yang.Subnet aaiSubnet : aaiL3Network.getSubnets().getSubnet()) {
267 network.getSubnets().add(mapAAISubnet(aaiSubnet));
272 protected GenericVnf mapAAIGenericVnfIntoGenericVnf(org.onap.aai.domain.yang.GenericVnf aaiGenericVnf) {
273 GenericVnf genericVnf = modelMapper.map(aaiGenericVnf, GenericVnf.class);
274 mapAllVfModulesIntoGenericVnf(aaiGenericVnf, genericVnf);
275 mapAllLagInterfacesIntoGenericVnf(aaiGenericVnf, genericVnf);
276 mapAllEntitlementsIntoGenericVnf(aaiGenericVnf, genericVnf);
277 mapAllLicensesIntoGenericVnf(aaiGenericVnf, genericVnf);
278 genericVnf.setOrchestrationStatus(this.mapOrchestrationStatusFromAAI(aaiGenericVnf.getOrchestrationStatus()));
282 protected void mapAllLicensesIntoGenericVnf(org.onap.aai.domain.yang.GenericVnf aaiGenericVnf,
283 GenericVnf genericVnf) {
284 if (aaiGenericVnf.getLicenses() != null) {
285 for (org.onap.aai.domain.yang.License aaiLicense : aaiGenericVnf.getLicenses().getLicense()) {
286 genericVnf.setLicense(mapAAILicense(aaiLicense));
291 protected void mapAllEntitlementsIntoGenericVnf(org.onap.aai.domain.yang.GenericVnf aaiGenericVnf,
292 GenericVnf genericVnf) {
293 if (aaiGenericVnf.getEntitlements() != null) {
294 for (org.onap.aai.domain.yang.Entitlement aaiEntitlement : aaiGenericVnf.getEntitlements()
296 genericVnf.getEntitlements().add(mapAAIEntitlement(aaiEntitlement));
301 protected void mapAllLagInterfacesIntoGenericVnf(org.onap.aai.domain.yang.GenericVnf aaiGenericVnf,
302 GenericVnf genericVnf) {
303 if (aaiGenericVnf.getLagInterfaces() != null) {
304 for (org.onap.aai.domain.yang.LagInterface aaiLagInterface : aaiGenericVnf.getLagInterfaces()
305 .getLagInterface()) {
306 genericVnf.getLagInterfaces().add(mapAAILagInterface(aaiLagInterface));
311 protected void mapAllVfModulesIntoGenericVnf(org.onap.aai.domain.yang.GenericVnf aaiGenericVnf,
312 GenericVnf genericVnf) {
313 if (aaiGenericVnf.getVfModules() != null) {
314 for (org.onap.aai.domain.yang.VfModule aaiVfModule : aaiGenericVnf.getVfModules().getVfModule()) {
315 VfModule vfModule = mapAAIVfModule(aaiVfModule);
316 genericVnf.getVfModules().add(vfModule);
321 public OrchestrationStatus mapOrchestrationStatusFromAAI(String orchestrationStatus) {
323 Optional<OrchestrationStatus> result = Arrays.asList(OrchestrationStatus.values()).stream()
324 .filter(item -> item.fuzzyMap(orchestrationStatus))
327 return result.orElse(null);
331 public RequestContext mapRequestContext(RequestDetails requestDetails) {
332 RequestContext context = new RequestContext();
333 modelMapper.map(requestDetails.getRequestInfo(), context);
334 org.onap.so.serviceinstancebeans.RequestParameters requestParameters = requestDetails.getRequestParameters();
335 if (null != requestParameters) {
336 context.setSubscriptionServiceType(requestParameters.getSubscriptionServiceType());
337 context.setRequestParameters(this.mapRequestParameters(requestDetails.getRequestParameters()));
338 context.setUserParams(this.mapNameValueUserParams(requestDetails.getRequestParameters()));
343 protected RequestParameters mapRequestParameters(org.onap.so.serviceinstancebeans.RequestParameters requestParameters) {
344 RequestParameters requestParams = new RequestParameters();
345 requestParams.setaLaCarte(requestParameters.getALaCarte());
346 requestParams.setSubscriptionServiceType(requestParameters.getSubscriptionServiceType());
347 requestParams.setUserParams(requestParameters.getUserParams());
348 requestParams.setPayload(requestParameters.getPayload());
349 return requestParams;
352 protected HashMap<String,String> mapNameValueUserParams(org.onap.so.serviceinstancebeans.RequestParameters requestParameters) {
353 HashMap<String,String> userParamsResult = new HashMap<String,String>();
354 if (requestParameters.getUserParams() != null) {
355 List<Map<String, Object>> userParams = requestParameters.getUserParams();
356 for (Map<String, Object> userParamsMap : userParams) {
357 if ( userParamsMap.containsKey(USER_PARAM_NAME_KEY) && (userParamsMap.get(USER_PARAM_NAME_KEY) instanceof String)
358 && userParamsMap.containsKey(USER_PARAM_VALUE_KEY) && (userParamsMap.get(USER_PARAM_VALUE_KEY) instanceof String)) {
359 userParamsResult.put((String) userParamsMap.get(USER_PARAM_NAME_KEY), (String) userParamsMap.get(USER_PARAM_VALUE_KEY));
363 return userParamsResult;
366 protected OrchestrationContext mapOrchestrationContext(RequestDetails requestDetails) {
367 OrchestrationContext context = new OrchestrationContext();
368 context.setIsRollbackEnabled(!(requestDetails.getRequestInfo().getSuppressRollback()));
372 protected CloudRegion mapCloudRegion(CloudConfiguration cloudConfiguration, org.onap.aai.domain.yang.CloudRegion aaiCloudRegion) {
373 CloudRegion cloudRegion = new CloudRegion();
374 if(cloudConfiguration != null)
375 cloudRegion = modelMapper.map(cloudConfiguration, CloudRegion.class);
376 if(aaiCloudRegion != null)
377 modelMapper.map(aaiCloudRegion, cloudRegion);
381 protected Collection mapAAICollectionIntoCollection(org.onap.aai.domain.yang.Collection aaiCollection) {
382 Collection collection = new Collection();
383 collection.setId(aaiCollection.getCollectionId());
384 collection.setOrchestrationStatus(this.mapOrchestrationStatusFromAAI(aaiCollection.getOrchestrationStatus()));
388 protected org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup mapAAIInstanceGroupIntoInstanceGroup(
389 org.onap.aai.domain.yang.InstanceGroup aaiInstanceGroup) {
390 return modelMapper.map(aaiInstanceGroup,
391 org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup.class);
394 public RouteTableReference mapAAIRouteTableReferenceIntoRouteTableReference(
395 org.onap.aai.domain.yang.RouteTableReference aaiRouteTableReference) {
396 return modelMapper.map(aaiRouteTableReference, RouteTableReference.class);
399 protected ModelInfoNetwork mapCatalogNetworkToNetwork(NetworkResourceCustomization networkResourceCustomization) {
400 modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
401 ModelInfoNetwork modelInfoNetwork = modelMapper.map(networkResourceCustomization, ModelInfoNetwork.class);
402 modelMapper.map(networkResourceCustomization.getNetworkResource(), modelInfoNetwork);
403 modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STANDARD);
404 return modelInfoNetwork;
407 protected ModelInfoGenericVnf mapCatalogVnfToVnf(VnfResourceCustomization vnfResourceCustomization) {
408 ModelInfoGenericVnf modelInfoVnf = modelMapper.map(vnfResourceCustomization, ModelInfoGenericVnf.class);
409 modelMapper.map(vnfResourceCustomization.getVnfResources(), modelInfoVnf);
413 protected ModelInfoVfModule mapCatalogVfModuleToVfModule(VfModuleCustomization vfResourceCustomization) {
414 ModelInfoVfModule modelInfoVfModule = modelMapper.map(vfResourceCustomization, ModelInfoVfModule.class);
415 modelMapper.map(vfResourceCustomization.getVfModule(), modelInfoVfModule);
416 return modelInfoVfModule;
419 protected Platform mapRequestPlatform(org.onap.so.serviceinstancebeans.Platform platform) {
420 return modelMapper.map(platform, Platform.class);
423 protected LineOfBusiness mapRequestLineOfBusiness(
424 org.onap.so.serviceinstancebeans.LineOfBusiness lineOfBusiness) {
425 return modelMapper.map(lineOfBusiness, LineOfBusiness.class);
428 public Configuration mapAAIConfiguration(org.onap.aai.domain.yang.Configuration configurationAAI) {
429 modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
430 Configuration configuration = modelMapper.map(configurationAAI, Configuration.class);
431 modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STANDARD);
432 configuration.getForwarderEvcs().addAll(mapAllForwarderEvcs(configurationAAI));
433 configuration.getEvcs().addAll(mapAllEvcs(configurationAAI));
434 configuration.setOrchestrationStatus(this.mapOrchestrationStatusFromAAI(configurationAAI.getOrchestrationStatus()));
435 return configuration;
438 protected List<Evc> mapAllEvcs(org.onap.aai.domain.yang.Configuration configurationAAI) {
439 List<Evc> listOfEvcs = new ArrayList<>();
440 if (configurationAAI.getEvcs() != null) {
441 for (org.onap.aai.domain.yang.Evc aaiEvc : configurationAAI.getEvcs().getEvc()) {
442 listOfEvcs.add(mapEvc(aaiEvc));
448 protected Evc mapEvc(org.onap.aai.domain.yang.Evc aaiEvc) {
449 return modelMapper.map(aaiEvc, Evc.class);
452 protected List<ForwarderEvc> mapAllForwarderEvcs(org.onap.aai.domain.yang.Configuration configurationAAI) {
453 List<ForwarderEvc> listOfForwarderEvcs = new ArrayList<>();
454 if (configurationAAI.getForwarderEvcs() != null) {
455 for (org.onap.aai.domain.yang.ForwarderEvc aaiForwarderEvc : configurationAAI.getForwarderEvcs().getForwarderEvc()) {
456 listOfForwarderEvcs.add(mapForwarderEvc(aaiForwarderEvc));
459 return listOfForwarderEvcs;
462 protected ForwarderEvc mapForwarderEvc(org.onap.aai.domain.yang.ForwarderEvc aaiForwarderEvc) {
463 return modelMapper.map(aaiForwarderEvc, ForwarderEvc.class);
466 protected OwningEntity mapRequestOwningEntity(org.onap.so.serviceinstancebeans.OwningEntity owningEntity) {
467 return modelMapper.map(owningEntity, OwningEntity.class);
470 protected Project mapRequestProject(org.onap.so.serviceinstancebeans.Project project) {
471 return modelMapper.map(project, Project.class);
474 protected ModelInfoConfiguration mapCatalogConfigurationToConfiguration(
475 ConfigurationResourceCustomization configurationResourceCustomization,
476 VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization) {
477 ModelInfoConfiguration modelInfoConfiguration = new ModelInfoConfiguration();
478 modelInfoConfiguration.setModelVersionId(configurationResourceCustomization.getConfigurationResource().getModelUUID());
479 modelInfoConfiguration.setModelCustomizationId(configurationResourceCustomization.getModelCustomizationUUID());
480 modelInfoConfiguration.setModelInvariantId(configurationResourceCustomization.getConfigurationResource().getModelInvariantUUID());
481 modelInfoConfiguration.setPolicyName(vnfVfmoduleCvnfcConfigurationCustomization.getPolicyName());
482 return modelInfoConfiguration;
485 public NetworkResourceCustomization mapCollectionNetworkResourceCustToNetworkResourceCust(
486 CollectionNetworkResourceCustomization collectionNetworkResourceCust) {
487 return modelMapper.map(collectionNetworkResourceCust, NetworkResourceCustomization.class);