diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-08-24 09:08:49 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-08-24 09:09:00 -0400 |
commit | 1916454f803aaa01c33d4d41c28cc6f3b9679c59 (patch) | |
tree | dc26957093667a8aa40c7b669f187ead5a5feeb6 | |
parent | 969cde43a1c52fc5a0131cd94713a3c4ba3d1564 (diff) |
correct return values of asBean
More adds of Optional<> to other ServiceInstance objects.
Change to add the Optional<> to the ServiceInstance object.
Change-Id: Ie486122412f9ad3d88ba0cf9df41ec226a4b8982
Issue-ID: SO-900
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
4 files changed, 13 insertions, 13 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy index 3702862a04..589bbe9c4f 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy @@ -140,9 +140,9 @@ public class DoCompareModelofE2EServiceInstance extends AbstractServiceTaskProce AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId, serviceType, serviceInstanceId) AAIResultWrapper wrapper = resourceClient.get(serviceInstanceUri, NotFoundException.class) - ServiceInstance si = wrapper.asBean(ServiceInstance.class) - execution.setVariable("model-invariant-id-original", si.getModelInvariantId()) - execution.setVariable("model-version-id-original", si.getModelVersionId()) + Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class) + execution.setVariable("model-invariant-id-original", si.get().getModelInvariantId()) + execution.setVariable("model-version-id-original", si.get().getModelVersionId()) }catch(BpmnError e) { throw e; diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy index 4939173d65..913970b051 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy @@ -319,8 +319,8 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId, serviceType, serviceInstanceId) AAIResultWrapper wrapper = resourceClient.get(serviceInstanceUri, NotFoundException.class) - ServiceInstance si = wrapper.asBean(ServiceInstance.class) - execution.setVariable("serviceInstanceName", si.getServiceInstanceName()) + Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class) + execution.setVariable("serviceInstanceName", si.get().getServiceInstanceName()) }catch(BpmnError e) { throw e; diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy index c7e3eb437c..a79483f6e9 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy @@ -310,11 +310,11 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor { uriList.addAll(wrapper.getRelationships().get().getRelatedAAIUris(AAIObjectType.L3_NETWORK)) if(uriList.isEmpty){ - ServiceInstance si = wrapper.asBean(ServiceInstance.class) - String orchestrationStatus = si.getOrchestrationStatus() - String serviceType = si.getServiceType() + Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class) + String orchestrationStatus = si.get().getOrchestrationStatus() + String serviceType = si.get().getServiceType() execution.setVariable("serviceType", serviceType) - execution.setVariable("serviceRole", si.getServiceRole()) + execution.setVariable("serviceRole", si.get().getServiceRole()) if("TRANSPORT".equalsIgnoreCase(serviceType)){ if("PendingDelete".equals(orchestrationStatus)){ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy index ac8e506e1f..20ced72002 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy @@ -177,10 +177,10 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId, serviceType, serviceInstanceId) AAIResultWrapper wrapper = resourceClient.get(serviceInstanceUri, NotFoundException.class) - ServiceInstance si = wrapper.asBean(ServiceInstance.class) - execution.setVariable("serviceInstanceName", si.getServiceInstanceName()) - execution.setVariable("model-invariant-id-original", si.getModelInvariantId()) - execution.setVariable("model-version-id-original", si.getModelVersionId()) + Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class) + execution.setVariable("serviceInstanceName", si.get().getServiceInstanceName()) + execution.setVariable("model-invariant-id-original", si.get().getModelInvariantId()) + execution.setVariable("model-version-id-original", si.get().getModelVersionId()) JSONObject ob = new JSONObject(wrapper.getJson()) JSONArray ar = ob.getJSONObject("relationship-list").getJSONArray("relationship") |