diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2018-11-25 02:29:32 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-11-25 02:29:32 +0000 |
commit | 12cbed256f5716ac4b6b9ec1414cad73296c65c6 (patch) | |
tree | b4f5a104c1a43c782d812e870d13504c12a17d2d /bpmn/so-bpmn-infrastructure-common/src | |
parent | 12c81872093919e10734abacf06d24e5e1df3a2c (diff) | |
parent | c1cf7c9c229ca4f4cbb66e448c074889a828d1df (diff) |
Merge "Fix parsing for pnf-name" into casablanca
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src')
-rw-r--r-- | bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java index e753f79ebd..95b826f331 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java @@ -436,14 +436,19 @@ public class ServicePluginFactory { Map<String, String> keys = uri.getURIKeys(); String uriString = uri.build().toString(); - AAIResourceUri parent = AAIUriFactory.createResourceUri(AAIObjectType.PNF, keys.get("pnf-name")); - - AAIResultWrapper wrapper = client.get(parent); - Optional<Relationships> optRelationships = wrapper.getRelationships(); - if (optRelationships.isPresent()) { - Relationships relationships = optRelationships.get(); - - return !relationships.getRelatedAAIUris(AAIObjectType.EXT_AAI_NETWORK).isEmpty(); + + if (uriString != null) { + // get the pnfname + String[] token = uriString.split("/"); + AAIResourceUri parent = AAIUriFactory.createResourceUri(AAIObjectType.PNF, token[4]); + + AAIResultWrapper wrapper = client.get(parent); + Optional<Relationships> optRelationships = wrapper.getRelationships(); + if (optRelationships.isPresent()) { + Relationships relationships = optRelationships.get(); + + return !relationships.getRelatedAAIUris(AAIObjectType.EXT_AAI_NETWORK).isEmpty(); + } } return false; |