diff options
author | Joanna Jeremicz <joanna.jeremicz@nokia.com> | 2020-09-30 11:39:25 +0200 |
---|---|---|
committer | Joanna Jeremicz <joanna.jeremicz@nokia.com> | 2020-09-30 14:47:59 +0200 |
commit | 04f13ef80c6e79d8c0b7b3fa1faeeaa0def1584e (patch) | |
tree | 894d637bc63f782439c068c0cbd0991a96a17643 /mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNode.java | |
parent | f51b3e1a957ede6c263d0c3634f36c7fcfbb95ff (diff) |
Adjust BP-gen to correctly support DFC component spec - types
- Update relationshipsType and feedNode values in DmaapNode
- Create a class for hardcoded values
- Update unit tests
Issue-ID: DCAEGEN2-2459
Signed-off-by: Joanna Jeremicz <joanna.jeremicz@nokia.com>
Change-Id: Ic5dc91844b4aefcf7d3d9d25c866a60e63875deb
Diffstat (limited to 'mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNode.java')
-rw-r--r-- | mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNode.java | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNode.java b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNode.java index e28e49a..9069f82 100644 --- a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNode.java +++ b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNode.java @@ -46,6 +46,14 @@ import lombok.Setter; import static org.onap.blueprintgenerator.common.blueprint.BlueprintHelper.isDataRouterType; import static org.onap.blueprintgenerator.common.blueprint.BlueprintHelper.isMessageRouterType; +import static org.onap.blueprintgenerator.models.blueprint.BpConstants.CONTENERIZED_SERVICE_COMPONENT_USING_DMAAP; +import static org.onap.blueprintgenerator.models.blueprint.BpConstants.FEED; +import static org.onap.blueprintgenerator.models.blueprint.BpConstants.TOPIC; +import static org.onap.blueprintgenerator.models.blueprint.BpConstants.PUBLISH_EVENTS; +import static org.onap.blueprintgenerator.models.blueprint.BpConstants.PUBLISH_FILES; +import static org.onap.blueprintgenerator.models.blueprint.BpConstants.SUBSCRIBE_TO_EVENTS; +import static org.onap.blueprintgenerator.models.blueprint.BpConstants.SUBSCRIBE_TO_FILES; + @JsonIgnoreProperties(ignoreUnknown = true) @Getter @Setter @@ -60,7 +68,7 @@ public class DmaapNode extends Node { TreeMap<String, LinkedHashMap<String, Object>> retInputs = inps; //set the type - this.setType("dcae.nodes.ContainerizedServiceComponentUsingDmaap"); + this.setType(CONTENERIZED_SERVICE_COMPONENT_USING_DMAAP); //create the interface Interfaces inter = new Interfaces(); @@ -116,7 +124,7 @@ public class DmaapNode extends Node { stringType.put("type", "string"); //set the type - this.setType("ccsdk.nodes.Feed"); + this.setType(FEED); //create and set the properties Properties props = new Properties(); @@ -137,7 +145,7 @@ public class DmaapNode extends Node { stringType.put("type", "string"); //set the type - this.setType("ccsdk.nodes.Topic"); + this.setType(TOPIC); //create and set the properties Properties props = new Properties(); @@ -154,10 +162,10 @@ public class DmaapNode extends Node { private LinkedHashMap<String, String> createTypeAndTargetPubRelations(Publishes publishes) { LinkedHashMap<String, String> pubRelations = new LinkedHashMap<>(); if (isMessageRouterType(publishes.getType())) { - pubRelations.put("type", "ccsdk.relationships.publish_events"); + pubRelations.put("type", PUBLISH_EVENTS); pubRelations.put("target", publishes.getConfig_key() + "_topic"); } else if (isDataRouterType(publishes.getType())) { - pubRelations.put("type", "ccsdk.relationships.publish_files"); + pubRelations.put("type", PUBLISH_FILES); pubRelations.put("target", publishes.getConfig_key() + "_feed"); } return pubRelations; @@ -166,10 +174,10 @@ public class DmaapNode extends Node { private LinkedHashMap<String, String> createTypeAndTargetSubRelations(Subscribes subscribes) { LinkedHashMap<String, String> subRelations = new LinkedHashMap<>(); if (isMessageRouterType(subscribes.getType())) { - subRelations.put("type", "ccsdk.relationships.subscribe_to_events"); + subRelations.put("type", SUBSCRIBE_TO_EVENTS); subRelations.put("target", subscribes.getConfig_key() + "_topic"); } else if (isDataRouterType(subscribes.getType())) { - subRelations.put("type", "ccsdk.relationships.subscribe_to_files"); + subRelations.put("type", SUBSCRIBE_TO_FILES); subRelations.put("target", subscribes.getConfig_key() + "_feed"); } return subRelations; |