2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2018 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.buildingblock;
23 import org.apache.commons.lang.SerializationUtils;
24 import org.camunda.bpm.engine.delegate.BpmnError;
25 import java.util.ArrayList;
26 import org.json.JSONArray;
27 import org.json.JSONObject;
28 import org.onap.so.bpmn.common.BuildingBlockExecution;
29 import org.onap.so.bpmn.core.json.JsonUtils;
30 import org.onap.so.bpmn.servicedecomposition.bbobjects.AllottedResource;
31 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
32 import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
33 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
34 import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf;
35 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
36 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceProxy;
37 import org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBondingLink;
38 import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
39 import org.onap.so.bpmn.servicedecomposition.generalobjects.License;
40 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
41 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
42 import org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate;
43 import org.onap.so.bpmn.servicedecomposition.homingobjects.CandidateType;
44 import org.onap.so.bpmn.servicedecomposition.homingobjects.SolutionCandidates;
45 import org.onap.so.bpmn.servicedecomposition.homingobjects.SolutionInfo;
46 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoMetadata;
47 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
48 import org.onap.so.client.exception.BadResponseException;
49 import org.onap.so.client.exception.ExceptionBuilder;
50 import org.onap.so.client.oof.OofClient;
51 import org.onap.so.client.oof.OofValidator;
52 import org.onap.so.client.oof.beans.ModelInfo;
53 import org.onap.so.client.oof.beans.OofRequest;
54 import org.onap.so.client.oof.beans.OofRequestParameters;
55 import org.onap.so.client.oof.beans.PlacementDemand;
56 import org.onap.so.client.oof.beans.PlacementInfo;
57 import org.onap.so.client.oof.beans.RequestInfo;
58 import org.onap.so.client.oof.beans.ResourceModelInfo;
59 import org.onap.so.client.oof.beans.ServiceInfo;
60 import org.onap.so.client.oof.beans.SubscriberInfo;
61 import org.onap.so.db.catalog.beans.OrchestrationStatus;
62 import org.slf4j.Logger;
63 import org.slf4j.LoggerFactory;
64 import org.springframework.beans.factory.annotation.Autowired;
65 import org.springframework.core.env.Environment;
66 import org.springframework.stereotype.Component;
67 import org.springframework.web.util.UriUtils;
68 import java.time.Duration;
69 import java.util.List;
71 import java.util.UUID;
72 import static org.apache.commons.lang3.StringUtils.isBlank;
73 import static org.apache.commons.lang3.StringUtils.isNotBlank;
77 * The oof homing building block obtains licensing and homing solutions for a given resource or set of resources.
80 @Component("OofHoming")
81 public class OofHomingV2 {
83 private static final Logger logger = LoggerFactory.getLogger(OofHomingV2.class);
84 private JsonUtils jsonUtils = new JsonUtils();
86 private Environment env;
88 private OofClient client;
90 private OofValidator oofValidator;
92 private ExceptionBuilder exceptionUtil;
93 private static final String MODEL_NAME = "modelName";
94 private static final String MODEL_INVARIANT_ID = "modelInvariantId";
95 private static final String MODEL_VERSION_ID = "modelVersionId";
96 private static final String MODEL_VERSION = "modelVersion";
97 private static final String SERVICE_RESOURCE_ID = "serviceResourceId";
98 private static final String RESOURCE_MODULE_NAME = "resourceModuleName";
99 private static final String RESOURCE_MODEL_INFO = "resourceModelInfo";
100 private static final String IDENTIFIER_TYPE = "identifierType";
101 private static final String INVENTORY_TYPE = "inventoryType";
102 private static final String SOLUTIONS = "solutions";
103 private static final String RESOURCE_MISSING_DATA = "Resource does not contain: ";
104 private static final String SERVICE_MISSING_DATA = "Service Instance does not contain: ";
105 private static final String UNPROCESSABLE = "422";
106 private static final int INTERNAL = 500;
109 * Generates the request payload then sends to Oof to perform homing and licensing for the provided demands
113 public void callOof(BuildingBlockExecution execution) {
114 logger.trace("Started Sniro Homing Call Sniro");
116 GeneralBuildingBlock bb = execution.getGeneralBuildingBlock();
118 RequestContext requestContext = bb.getRequestContext();
119 RequestParameters requestParams = requestContext.getRequestParameters();
120 String requestId = requestContext.getMsoRequestId();
122 ServiceInstance serviceInstance = bb.getCustomer().getServiceSubscription().getServiceInstances().get(0);
123 Customer customer = bb.getCustomer();
125 String timeout = execution.getVariable("timeout");
126 if (isBlank(timeout)) {
127 timeout = env.getProperty("oof.timeout", "PT30M");
130 OofRequest request = new OofRequest();
132 RequestInfo requestInfo = (RequestInfo) buildRequestInfo(requestId, timeout);
133 request.setRequestInformation(requestInfo);
135 ServiceInfo serviceInfo = buildServiceInfo(serviceInstance);
136 request.setServiceInformation(serviceInfo);
138 PlacementInfo placementInfo = buildPlacementInfo(customer, requestParams);
140 ArrayList<PlacementDemand> placementDemands = buildPlacementDemands(serviceInstance);
141 placementInfo.setPlacementDemands(placementDemands);
142 request.setPlacementInformation(placementInfo);
144 JSONObject licenseInfo = new JSONObject();
146 JSONArray licenseDemands = buildLicenseDemands(serviceInstance);
147 licenseInfo.put("licenseDemands", licenseDemands);
148 request.setLicenseInformation(licenseInfo.toString());
150 if (placementDemands.size() > 0 || licenseDemands.length() > 0) {
151 client.postDemands(request);
153 logger.debug(SERVICE_MISSING_DATA + " resources eligible for homing or licensing");
154 throw new BpmnError(UNPROCESSABLE,
155 SERVICE_MISSING_DATA + " resources eligible for homing or licensing");
158 // Variables for ReceiveWorkflowMessage subflow
159 execution.setVariable("asyncCorrelator", requestId);
160 execution.setVariable("asyncMessageType", "OofResponse");
161 execution.setVariable("asyncTimeout", timeout);
163 logger.trace("Completed Oof Homing Call Oof");
164 } catch (BpmnError e) {
165 exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage());
166 } catch (BadResponseException e) {
167 exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage());
168 } catch (Exception e) {
169 exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL,
170 "Internal Error - occurred while preparing oof request: " + e.getMessage());
175 * Validates, processes, and sets the homing and licensing solutions that are returned by Oof
178 * @param asyncResponse
180 public void processSolution(BuildingBlockExecution execution, String asyncResponse) {
181 logger.trace("Started Oof Homing Process Solution");
183 oofValidator.validateSolution(asyncResponse);
184 ServiceInstance serviceInstance = execution.getGeneralBuildingBlock().getCustomer().getServiceSubscription()
185 .getServiceInstances().get(0);
187 logger.debug("Processing Oof asyncronous response");
188 JSONObject response = new JSONObject(asyncResponse);
189 if (response.has(SOLUTIONS)) {
190 JSONObject allSolutions = response.getJSONObject(SOLUTIONS);
191 if (allSolutions.has("placementSolutions")) {
192 JSONArray placementSolutions = allSolutions.getJSONArray("placementSolutions");
193 for (int i = 0; i < placementSolutions.length(); i++) {
194 JSONArray placements = placementSolutions.getJSONArray(i);
195 processPlacementSolution(serviceInstance, placements, i);
198 if (allSolutions.has("licenseSolutions")) {
199 JSONArray licenseSolutions = allSolutions.getJSONArray("licenseSolutions");
200 if (licenseSolutions.length() > 0) {
201 processLicenseSolution(serviceInstance, licenseSolutions);
205 throw new BpmnError(UNPROCESSABLE, "Oof response does not contain: " + SOLUTIONS);
208 execution.setVariable("generalBuildingBlock", execution.getGeneralBuildingBlock());
210 logger.trace("Completed Oof Homing Process Solution");
211 } catch (BpmnError e) {
212 exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage());
213 } catch (BadResponseException e) {
214 exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage());
215 } catch (Exception e) {
216 exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL,
217 "Internal Error - occurred while processing Oof asynchronous response: " + e.getMessage());
222 * Builds the request information section for the homing/licensing request
226 private RequestInfo buildRequestInfo(String requestId, String timeout) throws Exception {
227 logger.trace("Building request information");
228 RequestInfo requestInfo = new RequestInfo();
229 if (requestId != null) {
230 String host = env.getProperty("mso.workflow.message.endpoint");
231 String callbackUrl = host + "/" + UriUtils.encodePathSegment("OofResponse", "UTF-8") + "/"
232 + UriUtils.encodePathSegment(requestId, "UTF-8");
234 Duration d = Duration.parse(timeout);
235 long timeoutSeconds = d.getSeconds();
237 requestInfo.setTransactionId(requestId);
238 requestInfo.setRequestId(requestId);
239 requestInfo.setCallbackUrl(callbackUrl);
240 requestInfo.setSourceId("mso");
241 requestInfo.setRequestType("create");
242 requestInfo.setTimeout(timeoutSeconds);
244 throw new BpmnError(UNPROCESSABLE, "Request Context does not contain: requestId");
250 * Builds the request information section for the homing/licensing request
253 private ServiceInfo buildServiceInfo(ServiceInstance serviceInstance) {
254 logger.trace("Building service information");
255 ServiceInfo info = new ServiceInfo();
256 ModelInfoServiceInstance modelInfo = serviceInstance.getModelInfoServiceInstance();
257 if (isNotBlank(modelInfo.getModelInvariantUuid()) && isNotBlank(modelInfo.getModelUuid())) {
258 info.setServiceInstanceId(serviceInstance.getServiceInstanceId());
259 if (modelInfo.getServiceType() != null && modelInfo.getServiceType().length() > 0) { // temp solution
260 info.setServiceName(modelInfo.getServiceType());
262 info.setModelInfo(buildModelInfo(serviceInstance.getModelInfoServiceInstance()));
264 throw new BpmnError(UNPROCESSABLE, SERVICE_MISSING_DATA + MODEL_VERSION_ID + ", " + MODEL_INVARIANT_ID);
270 * Builds initial section of placement info for the homing/licensing request
273 private PlacementInfo buildPlacementInfo(Customer customer, RequestParameters requestParams) {
274 PlacementInfo placementInfo = new PlacementInfo();
275 if (customer != null) {
276 logger.debug("Adding subscriber to placement information");
277 SubscriberInfo subscriberInfo = new SubscriberInfo();
278 subscriberInfo.setGlobalSubscriberId(customer.getGlobalCustomerId());
279 subscriberInfo.setSubscriberName(customer.getSubscriberName());
280 subscriberInfo.setSubscriberCommonSiteId(customer.getSubscriberCommonSiteId());
281 placementInfo.setSubscriberInfo(subscriberInfo);
282 if (requestParams != null) {
283 logger.debug("Adding request parameters to placement information");
284 OofRequestParameters oofRequestParams = new OofRequestParameters();
285 for (Map requestParam : requestParams.getUserParams()) {
286 if (requestParam.containsKey("customerLatitude")) {
287 oofRequestParams.setCustomerLatitude(requestParam.get("customerLatitude").toString());
289 if (requestParam.containsKey("customerLongitude")) {
290 oofRequestParams.setCustomerLongitude(requestParam.get("customerLongitude").toString());
292 if (requestParam.containsKey("customerName")) {
293 oofRequestParams.setCustomerName(requestParam.get("customerName").toString());
296 placementInfo.setRequestParameters(oofRequestParams);
299 throw new BpmnError(UNPROCESSABLE, SERVICE_MISSING_DATA + "customer");
301 return placementInfo;
306 * Builds the placement demand list for the homing/licensing request
309 private ArrayList<PlacementDemand> buildPlacementDemands(ServiceInstance serviceInstance) {
310 logger.trace("Building placement information demands");
311 ArrayList<PlacementDemand> placementDemands = new ArrayList();
313 List<AllottedResource> allottedResourceList = serviceInstance.getAllottedResources();
314 if (!allottedResourceList.isEmpty()) {
315 logger.debug("Adding allotted resources to placement demands list");
316 for (AllottedResource ar : allottedResourceList) {
317 if (isBlank(ar.getId())) {
318 ar.setId(UUID.randomUUID().toString());
320 PlacementDemand demand = buildDemand(ar.getId(), ar.getModelInfoAllottedResource());
321 // addCandidates(ar, demand);
322 placementDemands.add(demand);
325 List<VpnBondingLink> vpnBondingLinkList = serviceInstance.getVpnBondingLinks();
326 if (!vpnBondingLinkList.isEmpty()) {
327 logger.debug("Adding vpn bonding links to placement demands list");
328 for (VpnBondingLink vbl : vpnBondingLinkList) {
329 List<ServiceProxy> serviceProxyList = vbl.getServiceProxies();
330 for (ServiceProxy sp : serviceProxyList) {
331 if (isBlank(sp.getId())) {
332 sp.setId(UUID.randomUUID().toString());
334 PlacementDemand demand = buildDemand(sp.getId(), sp.getModelInfoServiceProxy());
335 // addCandidates(sp, demand);
336 placementDemands.add(demand);
340 return placementDemands;
344 * Builds the license demand list for the homing/licensing request
347 private JSONArray buildLicenseDemands(ServiceInstance serviceInstance) {
348 logger.trace("Building license information");
349 JSONArray licenseDemands = new JSONArray();
350 List<GenericVnf> vnfList = serviceInstance.getVnfs();
351 if (!vnfList.isEmpty()) {
352 logger.debug("Adding vnfs to license demands list");
353 for (GenericVnf vnf : vnfList) {
354 JSONObject demand = buildLicenseDemand(vnf.getVnfId(), vnf.getModelInfoGenericVnf());
355 licenseDemands.put(demand);
358 return licenseDemands;
362 * Builds a single license demand object
365 private JSONObject buildLicenseDemand(String id, ModelInfoMetadata metadata) {
366 logger.debug("Building demand for service or resource: " + id);
367 JSONObject demand = new JSONObject();
368 if (isNotBlank(id) && isNotBlank(metadata.getModelInstanceName())) {
369 demand.put(SERVICE_RESOURCE_ID, id);
370 demand.put(RESOURCE_MODULE_NAME, metadata.getModelInstanceName());
371 demand.put(RESOURCE_MODEL_INFO, buildModelInfo(metadata));
373 throw new BpmnError(UNPROCESSABLE, RESOURCE_MISSING_DATA + "modelInstanceName");
379 * Builds a single demand object
382 private PlacementDemand buildDemand(String id, ModelInfoMetadata metadata) {
383 logger.debug("Building demand for service or resource: " + id);
384 PlacementDemand placementDemand = new PlacementDemand();
385 if (isNotBlank(id) && isNotBlank(metadata.getModelInstanceName())) {
386 placementDemand.setServiceResourceId(id);
387 placementDemand.setResourceModuleName(metadata.getModelInstanceName());
388 placementDemand.setResourceModelInfo((ResourceModelInfo) buildModelInfo(metadata));
390 throw new BpmnError(UNPROCESSABLE, RESOURCE_MISSING_DATA + "modelInstanceName");
392 return placementDemand;
396 * Builds the resource model info section
399 private ModelInfo buildModelInfo(ModelInfoMetadata metadata) {
400 ModelInfo modelInfo = new ModelInfo();
401 String invariantUuid = metadata.getModelInvariantUuid();
402 String modelUuid = metadata.getModelUuid();
403 if (isNotBlank(invariantUuid) && isNotBlank(modelUuid)) {
404 modelInfo.setModelInvariantId(invariantUuid);
405 modelInfo.setModelVersionId(modelUuid);
406 modelInfo.setModelName(metadata.getModelName());
407 modelInfo.setModelVersion(metadata.getModelVersion());
408 } else if (isNotBlank(invariantUuid)) {
409 throw new BpmnError(UNPROCESSABLE, RESOURCE_MISSING_DATA + MODEL_VERSION_ID);
411 throw new BpmnError(UNPROCESSABLE, RESOURCE_MISSING_DATA + MODEL_INVARIANT_ID);
417 * Adds required, excluded, and existing candidates to a demand
420 private void addCandidates(SolutionCandidates candidates, JSONObject demand) {
421 List<Candidate> required = candidates.getRequiredCandidates();
422 List<Candidate> excluded = candidates.getExcludedCandidates();
423 if (!required.isEmpty()) {
424 demand.put("requiredCandidates", required);
426 if (!excluded.isEmpty()) {
427 demand.put("excludedCandidates", excluded);
429 // TODO support existing candidates
433 * Processes the license solutions and sets to the corresponding generic vnf
436 private void processLicenseSolution(ServiceInstance serviceInstance, JSONArray licenseSolutions) {
437 List<GenericVnf> vnfs = serviceInstance.getVnfs();
439 logger.debug("Processing the license solution");
440 for (int i = 0; i < licenseSolutions.length(); i++) {
441 JSONObject licenseSolution = licenseSolutions.getJSONObject(i);
442 for (GenericVnf vnf : vnfs) {
443 if (licenseSolution.getString(SERVICE_RESOURCE_ID).equals(vnf.getVnfId())) {
444 License license = new License();
445 JSONArray entitlementPools = licenseSolution.getJSONArray("entitlementPoolUUID");
446 List<String> entitlementPoolsList = jsonUtils.StringArrayToList(entitlementPools);
447 license.setEntitlementPoolUuids(entitlementPoolsList);
448 JSONArray licenseKeys = licenseSolution.getJSONArray("licenseKeyGroupUUID");
449 List<String> licenseKeysList = jsonUtils.StringArrayToList(licenseKeys);
450 license.setLicenseKeyGroupUuids(licenseKeysList);
452 vnf.setLicense(license);
459 * Processes a placement solution list then correlates and sets each placement solution to its corresponding
463 private void processPlacementSolution(ServiceInstance serviceInstance, JSONArray placements, int i) {
464 List<VpnBondingLink> links = serviceInstance.getVpnBondingLinks();
465 List<AllottedResource> allottes = serviceInstance.getAllottedResources();
466 List<GenericVnf> vnfs = serviceInstance.getVnfs();
468 logger.debug("Processing placement solution " + i + 1);
469 for (int p = 0; p < placements.length(); p++) {
470 JSONObject placement = placements.getJSONObject(p);
471 SolutionInfo solutionInfo = new SolutionInfo();
472 solutionInfo.setSolutionId(i + 1);
474 for (VpnBondingLink vbl : links) {
475 List<ServiceProxy> proxies = vbl.getServiceProxies();
476 for (ServiceProxy sp : proxies) {
477 if (placement.getString(SERVICE_RESOURCE_ID).equals(sp.getId())) {
480 VpnBondingLink vblNew = (VpnBondingLink) SerializationUtils.clone(vbl);
481 vblNew.setVpnBondingLinkId(UUID.randomUUID().toString());
484 links.get(links.size() - 1).getServiceProxy(sp.getId())
485 .setServiceInstance(setSolution(solutionInfo, placement));
487 sp.setServiceInstance(setSolution(solutionInfo, placement));
493 for (AllottedResource ar : allottes) {
494 if (placement.getString(SERVICE_RESOURCE_ID).equals(ar.getId())) {
495 ar.setParentServiceInstance(setSolution(solutionInfo, placement));
499 for (GenericVnf vnf : vnfs) {
500 if (placement.getString(SERVICE_RESOURCE_ID).equals(vnf.getVnfId())) {
501 ServiceInstance si = setSolution(solutionInfo, placement);
502 serviceInstance.setSolutionInfo(si.getSolutionInfo());
503 serviceInstance.getVnfs().add(si.getVnfs().get(0));
513 * Creates and sets necessary pojos with placement solution data for a given demand
516 private ServiceInstance setSolution(SolutionInfo solutionInfo, JSONObject placement) {
517 logger.debug("Mapping placement solution");
518 String invalidMessage = "Oof Response contains invalid: ";
520 JSONObject solution = placement.getJSONObject("solution");
521 String identifierType = solution.getString(IDENTIFIER_TYPE);
522 List<String> identifiersList = jsonUtils.StringArrayToList(solution.getJSONArray("identifiers").toString());
523 String identifierValue = identifiersList.get(0);
525 JSONArray assignments = placement.getJSONArray("assignmentInfo");
526 Map<String, String> assignmentsMap = jsonUtils.entryArrayToMap(assignments.toString(), "key", "value");
527 solutionInfo.setRehome(Boolean.parseBoolean(assignmentsMap.get("isRehome")));
528 String type = placement.getString(INVENTORY_TYPE);
530 ServiceInstance si = new ServiceInstance();
531 CloudRegion cloud = setCloud(assignmentsMap);
532 if (type.equals("service")) {
533 if (identifierType.equals(CandidateType.SERVICE_INSTANCE_ID.toString())) {
534 solutionInfo.setHomed(true);
535 si.setServiceInstanceId(identifierValue);
536 si.setOrchestrationStatus(OrchestrationStatus.CREATED);
537 cloud.setLcpCloudRegionId(assignmentsMap.get("cloudRegionId"));
538 if (assignmentsMap.containsKey("vnfHostName")) {
539 logger.debug("Resources has been homed to a vnf");
540 GenericVnf vnf = setVnf(assignmentsMap);
541 vnf.setCloudRegion(cloud);
542 si.getVnfs().add(vnf);
544 } else if (assignmentsMap.containsKey("primaryPnfName")) {
545 logger.debug("Resources has been homed to a pnf");
546 Pnf priPnf = setPnf(assignmentsMap, "primary");
547 priPnf.setCloudRegion(cloud);
548 si.getPnfs().add(priPnf);
549 if (assignmentsMap.containsKey("secondaryPnfName")) {
550 Pnf secPnf = setPnf(assignmentsMap, "secondary");
551 secPnf.setCloudRegion(cloud);
552 si.getPnfs().add(secPnf);
556 logger.debug(invalidMessage + IDENTIFIER_TYPE);
557 throw new BpmnError(UNPROCESSABLE, invalidMessage + IDENTIFIER_TYPE);
559 } else if (type.equals("cloud")) {
560 if (identifierType.equals(CandidateType.CLOUD_REGION_ID.toString())) {
561 logger.debug("Resources has been homed to a cloud region");
562 cloud.setLcpCloudRegionId(identifierValue);
563 solutionInfo.setHomed(false);
564 solutionInfo.setTargetedCloudRegion(cloud);
565 si.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
567 logger.debug(invalidMessage + IDENTIFIER_TYPE);
568 throw new BpmnError(UNPROCESSABLE, invalidMessage + IDENTIFIER_TYPE);
571 logger.debug(invalidMessage + INVENTORY_TYPE);
572 throw new BpmnError(UNPROCESSABLE, invalidMessage + INVENTORY_TYPE);
574 si.setSolutionInfo(solutionInfo);
579 * Sets the cloud data to a cloud region object
582 private CloudRegion setCloud(Map<String, String> assignmentsMap) {
583 CloudRegion cloud = new CloudRegion();
584 cloud.setCloudOwner(assignmentsMap.get("cloudOwner"));
585 cloud.setCloudRegionVersion(assignmentsMap.get("aicVersion"));
586 cloud.setComplex(assignmentsMap.get("aicClli"));
591 * Sets the vnf data to a generic vnf object
594 private GenericVnf setVnf(Map<String, String> assignmentsMap) {
595 GenericVnf vnf = new GenericVnf();
596 vnf.setOrchestrationStatus(OrchestrationStatus.CREATED);
597 vnf.setVnfName(assignmentsMap.get("vnfHostName"));
598 vnf.setVnfId(assignmentsMap.get("vnfId"));
603 * Sets the pnf data to a pnf object
606 private Pnf setPnf(Map<String, String> assignmentsMap, String role) {
609 pnf.setOrchestrationStatus(OrchestrationStatus.CREATED);
610 pnf.setPnfName(assignmentsMap.get(role + "PnfName"));