ef815d027c2e171391a72adbd86341a879ca5236
[ccsdk/sli/northbound.git] / ueb-listener / src / main / java / org / onap / ccsdk / sli / northbound / uebclient / SdncVFModuleModel.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * openECOMP : SDN-C
4  * ================================================================================
5  * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights
6  *                                              reserved.
7  * Modifications Copyright © 2018 IBM.
8  * ================================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ============LICENSE_END=========================================================
21  */
22
23 package org.onap.ccsdk.sli.northbound.uebclient;
24
25 import org.onap.sdc.tosca.parser.api.IEntityDetails;
26 import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
27 import org.onap.sdc.tosca.parser.impl.SdcPropertyNames;
28
29 public class SdncVFModuleModel extends SdncBaseModel {
30         
31         public SdncVFModuleModel(ISdcCsarHelper sdcCsarHelper, IEntityDetails vfModule, SdncVFModel vfNodeModel) {
32
33                 super(sdcCsarHelper, vfModule);
34                 // override base implementation for setting metadata because properties are called differently for Groups
35                 customizationUUID = extractValue (vfModule.getMetadata(), "vfModuleModelCustomizationUUID");  
36                 invariantUUID = extractValue (vfModule.getMetadata(), "vfModuleModelInvariantUUID"); 
37                 UUID = extractValue (vfModule.getMetadata(), "vfModuleModelUUID"); 
38                 version = extractValue (vfModule.getMetadata(), "vfModuleModelVersion");
39                 addParameter("vf_customization_uuid", vfNodeModel.getCustomizationUUIDNoQuotes());
40                 addParameter("invariant_uuid", invariantUUID);
41                 addParameter("uuid", UUID);
42                 addParameter("version", version);
43                 
44                 // extract properties
45                 addParameter("vf_module_type", extractValue(vfModule, SdcPropertyNames.PROPERTY_NAME_VFMODULETYPE));
46                 addParameter("vf_module_label", extractValue(vfModule, "vf_module_label"));
47                 addIntParameter("availability_zone_count", extractValue(vfModule, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT));
48                 addParameter("ecomp_generated_vm_assignments", extractBooleanValue(vfModule, SdcPropertyNames.PROPERTY_NAME_ECOMPGENERATEDVMASSIGNMENTS));
49         }
50
51 }