Add Category info For Service and Resource 05/28605/2
authorc00149107 <chenchuanyu@huawei.com>
Fri, 19 Jan 2018 06:36:23 +0000 (14:36 +0800)
committerc00149107 <chenchuanyu@huawei.com>
Mon, 22 Jan 2018 01:32:07 +0000 (09:32 +0800)
Add Category info For Service and Resource,It is used for generic workflow

Change-Id: I952d39388eac8b379a8ecc365e1292fdc0cf597e
Issue-ID: SO-379
Signed-off-by: c00149107 <chenchuanyu@huawei.com>
asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResource.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Service.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
mso-catalog-db/src/main/resources/NetworkResource.hbm.xml
mso-catalog-db/src/main/resources/Service.hbm.xml
mso-catalog-db/src/main/resources/VnfResource.hbm.xml

index 390bf40..b7b3515 100644 (file)
@@ -787,6 +787,7 @@ public class ToscaResourceInstaller {// implements IVfResourceInstaller {
                        service.setModelUUID(serviceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));\r
                        //service.setVersion(serviceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));\r
                        service.setModelInvariantUUID(serviceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));\r
+                       service.setCategory(serviceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY));\r
                        service.setToscaCsarArtifactUUID(toscaResourceStructure.getToscaArtifact().getArtifactUUID());\r
                        //service.setCreated(getCurrentTimeStamp());\r
                }\r
@@ -835,6 +836,8 @@ public class ToscaResourceInstaller {// implements IVfResourceInstaller {
                networkResource.setToscaNodeType(networkNodeTemplate.getType());\r
                networkResource.setDescription(testNull(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));\r
                networkResource.setOrchestrationMode("HEAT");\r
+               networkResource.setCategory(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY));\r
+               networkResource.setSubCategory(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY));\r
                networkResource.setHeatTemplateArtifactUUID(networkHeatTemplateLookup.getHeatTemplateArtifactUuid());\r
                        \r
                toscaResourceStructure.setCatalogNetworkResource(networkResource); \r
@@ -1019,11 +1022,12 @@ public class ToscaResourceInstaller {// implements IVfResourceInstaller {
                vnfResource.setToscaNodeType(testNull(vfNodeTemplate.getType()));\r
                vnfResource.setAicVersionMax(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES).trim()));\r
                vnfResource.setAicVersionMin(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES).trim()));\r
-               //vnfResource.setHeatTemplateArtifactUUId(toscaResourceStructure.getHeatTemplateUUID());\r
-               \r
-       //      vfNodeTemplate.getProperties()\r
-               toscaResourceStructure.setCatalogVnfResource(vnfResource); \r
-               \r
+        // vnfResource.setHeatTemplateArtifactUUId(toscaResourceStructure.getHeatTemplateUUID());\r
+        vnfResource.setCategory(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY));\r
+        vnfResource.setSubCategory(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY));\r
+        // vfNodeTemplate.getProperties()\r
+        toscaResourceStructure.setCatalogVnfResource(vnfResource);\r
+\r
                VnfResourceCustomization vnfResourceCustomization = new VnfResourceCustomization();\r
                vnfResourceCustomization.setModelCustomizationUuid(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID).trim()));\r
                vnfResourceCustomization.setModelInstanceName(vfNodeTemplate.getName());\r
index b6151f1..025b13b 100644 (file)
@@ -41,6 +41,8 @@ public class NetworkResource extends MavenLikeVersioning implements Serializable
        private String toscaNodeType;
        private Timestamp created;
        private String modelUUID;
+    private String category;
+    private String subCategory;
        private String heatTemplateArtifactUUID;
        
        public NetworkResource() {}
@@ -123,8 +125,40 @@ public class NetworkResource extends MavenLikeVersioning implements Serializable
        public void setModelUUID(String modelUUID) {
                this.modelUUID = modelUUID;
        }
-
-       public String getHeatTemplateArtifactUUID() {
+       
+       
+    /**
+     * @return Returns the category.
+     */
+    public String getCategory() {
+        return category;
+    }
+
+    
+    /**
+     * @param category The category to set.
+     */
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    
+    /**
+     * @return Returns the subCategory.
+     */
+    public String getSubCategory() {
+        return subCategory;
+    }
+
+    
+    /**
+     * @param subCategory The subCategory to set.
+     */
+    public void setSubCategory(String subCategory) {
+        this.subCategory = subCategory;
+    }
+
+    public String getHeatTemplateArtifactUUID() {
                return heatTemplateArtifactUUID;
        }
 
index fe7b7a3..beb021a 100644 (file)
@@ -39,6 +39,7 @@ public class Service extends MavenLikeVersioning implements Serializable {
        private Timestamp created;
        private String toscaCsarArtifactUUID;
        private String modelVersion;
+       private String category;
        private String serviceType;
        private String serviceRole;
        private Map<String,ServiceRecipe> recipes;
@@ -115,8 +116,22 @@ public class Service extends MavenLikeVersioning implements Serializable {
                this.modelVersion = modelVersion;
        }
 
-       
-       public String getServiceType() {
+    /**
+     * @return Returns the category.
+     */
+    public String getCategory() {
+        return category;
+    }
+
+    
+    /**
+     * @param category The category to set.
+     */
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public String getServiceType() {
                return serviceType;
        }
 
index 8fe8127..0872f14 100644 (file)
@@ -43,6 +43,8 @@ public class VnfResource extends MavenLikeVersioning implements Serializable {
     private String orchestrationMode;
     private String aicVersionMin;
     private String aicVersionMax;
+    private String category;
+    private String subCategory;
     private String heatTemplateArtifactUUId;
     private Timestamp created;
     private String modelVersion;
@@ -108,7 +110,39 @@ public class VnfResource extends MavenLikeVersioning implements Serializable {
                this.aicVersionMax = aicVersionMax;
        }
 
-       public String getModelInvariantUuid() {
+       
+    /**
+     * @return Returns the category.
+     */
+    public String getCategory() {
+        return category;
+    }
+
+    
+    /**
+     * @param category The category to set.
+     */
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    
+    /**
+     * @return Returns the subCategory.
+     */
+    public String getSubCategory() {
+        return subCategory;
+    }
+
+    
+    /**
+     * @param subCategory The subCategory to set.
+     */
+    public void setSubCategory(String subCategory) {
+        this.subCategory = subCategory;
+    }
+
+    public String getModelInvariantUuid() {
                return this.modelInvariantUuid;
        }
 
index 1599cf5..41e049a 100644 (file)
@@ -35,6 +35,8 @@
                <property name="neutronNetworkType"             column="NEUTRON_NETWORK_TYPE"                   type="string"   length="20"/>
                <property name="description"                            column="DESCRIPTION"                                    type="string"   length="1200"/>
                <property name="orchestrationMode"                      column="ORCHESTRATION_MODE"                     type="string"   length="20"/>
+               <property name="category"                                   column="RESOURCE_CATEGORY"              type="string"       length="20"/>
+               <property name="subCategory"                            column="RESOURCE_SUB_CATEGORY"          type="string"   length="20"/>
                <property name="heatTemplateArtifactUUID"       column="HEAT_TEMPLATE_ARTIFACT_UUID"    type="string"   length="200"    not-null="true" />
 
                <property name="aicVersionMin" type="string" >
index 5bdb0f6..70f5731 100644 (file)
@@ -39,6 +39,7 @@
                <property name="modelInvariantUUID" type="string">
            <column name="MODEL_INVARIANT_UUID" default="'MANUAL_RECORD'" not-null="true" length="200"/>
         </property>
+        <property name="category"                              column="SERVICE_CATEGORY"                               type="string"           length="20"/>
         <property name="serviceType"                           column="SERVICE_TYPE"                           type="string"           length="20"/>
         <property name="serviceRole"                           column="SERVICE_ROLE"                           type="string"           length="20"/>
         
index 2647a0f..03d1de5 100644 (file)
@@ -36,6 +36,8 @@
                <property name="orchestrationMode"                      type="string"           column="ORCHESTRATION_MODE"                     length="20"             not-null="true"/>
                <property name="aicVersionMin"                          type="string"           column="AIC_VERSION_MIN"                                length="20"/>
                <property name="aicVersionMax"                          type="string"           column="AIC_VERSION_MAX"                                length="20"/>
+               <property name="category"                                   type="string"               column="RESOURCE_CATEGORY"                              length="20"/>
+               <property name="subCategory"                            type="string"           column="RESOURCE_SUB_CATEGORY"                  length="20"/>
                <property name="heatTemplateArtifactUUId"       type="string"           column="HEAT_TEMPLATE_ARTIFACT_UUID"    length="200" />
                <property name="created"                                        type="timestamp" generated="insert" update="false" insert="false" not-null="true">
           <column name="CREATION_TIMESTAMP" default="CURRENT_TIMESTAMP"/>