diff options
author | William Reehil <william.reehil@att.com> | 2020-08-06 16:01:42 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-08-06 16:01:42 +0000 |
commit | 926c05ce1a2f808295c9c0f2f6068feb85da2d46 (patch) | |
tree | a38d037da582855b17ad4420f65ff65c0875d2ac /src/main | |
parent | 4f1235efe2213369b79c7abf779c4a82258948c4 (diff) | |
parent | 65f8ce45775881824ba56f72b0be06fd9577f22b (diff) |
Merge "Add 'category' of service model to Babel artifact"
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/onap/aai/babel/xml/generator/api/AaiModelGenerator.java | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/aai/babel/xml/generator/model/Model.java | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/org/onap/aai/babel/xml/generator/api/AaiModelGenerator.java b/src/main/java/org/onap/aai/babel/xml/generator/api/AaiModelGenerator.java index 384d87d..5247959 100644 --- a/src/main/java/org/onap/aai/babel/xml/generator/api/AaiModelGenerator.java +++ b/src/main/java/org/onap/aai/babel/xml/generator/api/AaiModelGenerator.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. * Copyright (c) 2017-2019 European Software Marketing Ltd. + * Copyright (C) 2019-2020 Wipro Limited. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,7 +80,9 @@ public class AaiModelGenerator { org.onap.aai.babel.xml.generator.xsd.Model aaiModel = new org.onap.aai.babel.xml.generator.xsd.Model(); aaiModel.setModelInvariantId(model.getModelId()); aaiModel.setModelType(model.getModelTypeName()); - + if (model.getModelTypeName() == "service"){ + aaiModel.setModelRole(model.getCategory()); + } aaiModel.setModelVers(new ModelVers()); aaiModel.getModelVers().getModelVer().add(createModelVersion(model)); @@ -101,7 +104,6 @@ public class AaiModelGenerator { modelVer.setModelVersion(model.getModelVersion()); modelVer.setModelVersionId(model.getModelNameVersionId()); modelVer.setModelElements(new ModelElements()); - modelVer.setOrchestrationType(model.getInstantiationType()); return modelVer; } diff --git a/src/main/java/org/onap/aai/babel/xml/generator/model/Model.java b/src/main/java/org/onap/aai/babel/xml/generator/model/Model.java index c33127e..558b561 100644 --- a/src/main/java/org/onap/aai/babel/xml/generator/model/Model.java +++ b/src/main/java/org/onap/aai/babel/xml/generator/model/Model.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. * Copyright (c) 2017-2019 European Software Marketing Ltd. + * Copyright (C) 2019-2020 Wipro Limited. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,6 +62,12 @@ public abstract class Model { model.modelName = value; } }, + CATEGORY("category") { + @Override + public void populate(Model model, String value) { + model.category = value; + } + }, DESCRIPTION("serviceDescription", "resourceDescription", "vf_module_description", "description") { @Override public void populate(Model model, String value) { @@ -110,6 +117,7 @@ public abstract class Model { private String modelVersion; private String modelDescription; private String instantiationType; + private String category; protected Set<Resource> resources = new HashSet<>(); protected Set<Widget> widgets = new HashSet<>(); @@ -218,6 +226,9 @@ public abstract class Model { return instantiationType; } + public String getCategory() { + return category; + } /** * Gets widget version id. * |