3b8a6cd9e8146bc5cac4004f095137af41822c02
[sdc.git] / catalog-model / src / main / java / org / openecomp / sdc / be / model / DefaultUploadResourceInfo.java
1 /*
2  * -
3  *  ============LICENSE_START=======================================================
4  *  Copyright (C) 2022 Nordix Foundation.
5  *  ================================================================================
6  *  Licensed under the Apache License, Version 2.0 (the "License");
7  *  you may not use this file except in compliance with the License.
8  *  You may obtain a copy of the License at
9  *
10  *       http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  *
18  *  SPDX-License-Identifier: Apache-2.0
19  *  ============LICENSE_END=========================================================
20  */
21 package org.openecomp.sdc.be.model;
22
23 import java.util.ArrayList;
24 import java.util.List;
25 import org.openecomp.sdc.be.model.category.CategoryDefinition;
26 import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
27
28 public class DefaultUploadResourceInfo extends UploadResourceInfo{
29
30     public DefaultUploadResourceInfo(String toscaName){
31         SubCategoryDefinition subCategory = new SubCategoryDefinition();
32         subCategory.setName("Network Elements");
33         CategoryDefinition category = new CategoryDefinition();
34         category.setName("Generic");
35         category.setNormalizedName("generic");
36         category.setIcons(List.of("defaulticon"));
37         category.setNormalizedName("generic");
38         category.addSubCategory(subCategory);
39         List<CategoryDefinition> categories = new ArrayList<>();
40         categories.add(category);
41         super.setCategories(categories);
42         super.setIcon("defaulticon");
43         super.setVendorRelease("1");
44         super.setNormative(false);
45         String[] nodeTemplateName = toscaName.split("\\.");
46         String name =  nodeTemplateName[nodeTemplateName.length - 1];
47         super.setName(name);
48         super.setDescription("A vfc of type " + toscaName);
49         List<String> tags = new ArrayList<>();
50         tags.add(name);
51         super.setTags(tags);
52     }
53 }