summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-08-23 14:18:55 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-23 14:18:55 +0000
commitf2afd9880e409317626f393ab6d0a414a80653de (patch)
tree8dcd9f7bd2784ad5bde8fa4ea8fedea45180bd14 /bpmn/so-bpmn-tasks/src/main
parent35bc9e01cab284c6e227870b775c6f431f011653 (diff)
parent76a13e484dac0f4d5c80a10e8efeb540e52092ba (diff)
Merge "Do not serialize AAIResultWrapper"
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java44
1 files changed, 14 insertions, 30 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java
index beffa25249..0079b351f2 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java
@@ -49,7 +49,6 @@ import org.springframework.stereotype.Component;
public class AAIQueryTasks {
private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIQueryTasks.class);
- private static final String NETWORK_RESULT_WRAPPER_KEY = "l3NetworkAAIResultWrapper";
private static final String ERROR_MSG = "No relationships were returned from AAIResultWrapper.getRelationships()";
@Autowired
private ExtractPojosForBB extractPojosForBB;
@@ -58,23 +57,6 @@ public class AAIQueryTasks {
@Autowired
private AAINetworkResources aaiNetworkResources;
private static final ModelMapper modelMapper = new ModelMapper();
-
- /**
- * BPMN access method to query L3Network object in AAI by it's Id
- *
- * @param execution
- * @throws Exception
- */
- public void getNetworkWrapperById(BuildingBlockExecution execution) {
- try {
- L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID,
- execution.getLookupMap().get(ResourceKey.NETWORK_ID));
- AAIResultWrapper aaiResultWrapper = aaiNetworkResources.queryNetworkWrapperById(l3network);
- execution.setVariable(NETWORK_RESULT_WRAPPER_KEY, aaiResultWrapper);
- } catch (Exception ex) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
- }
- }
/**
* BPMN access method to query data for VPN bindings from the AAI result wrapper.
@@ -85,9 +67,9 @@ public class AAIQueryTasks {
public void queryNetworkVpnBinding(BuildingBlockExecution execution) {
try {
- org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
-
- AAIResultWrapper aaiResultWrapper = execution.getVariable(NETWORK_RESULT_WRAPPER_KEY);
+ L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID,
+ execution.getLookupMap().get(ResourceKey.NETWORK_ID));
+ AAIResultWrapper aaiResultWrapper = aaiNetworkResources.queryNetworkWrapperById(l3network);
Optional<Relationships> networkRelationships = aaiResultWrapper.getRelationships();
if (!networkRelationships.isPresent()) {
throw (new Exception(ERROR_MSG));
@@ -120,7 +102,9 @@ public class AAIQueryTasks {
public void getNetworkVpnBinding(BuildingBlockExecution execution) {
try {
- AAIResultWrapper aaiResultWrapper = execution.getVariable(NETWORK_RESULT_WRAPPER_KEY);
+ L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID,
+ execution.getLookupMap().get(ResourceKey.NETWORK_ID));
+ AAIResultWrapper aaiResultWrapper = aaiNetworkResources.queryNetworkWrapperById(l3network);
CreateNetworkRequest createNetworkRequest = execution.getVariable("createNetworkRequest");
Optional<Relationships> networkRelationships = aaiResultWrapper.getRelationships();
@@ -174,9 +158,9 @@ public class AAIQueryTasks {
*/
public void queryNetworkPolicy(BuildingBlockExecution execution) {
try {
- L3Network l3Network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID, execution.getLookupMap().get(ResourceKey.NETWORK_ID));
-
- AAIResultWrapper aaiResultWrapper = execution.getVariable(NETWORK_RESULT_WRAPPER_KEY);
+ L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID,
+ execution.getLookupMap().get(ResourceKey.NETWORK_ID));
+ AAIResultWrapper aaiResultWrapper = aaiNetworkResources.queryNetworkWrapperById(l3network);
Optional<Relationships> networkRelationships = aaiResultWrapper.getRelationships();
if (!networkRelationships.isPresent()) {
throw (new Exception(ERROR_MSG));
@@ -187,7 +171,7 @@ public class AAIQueryTasks {
for(AAIResourceUri netPolicyUri : netPoliciesUriList) {
Optional<NetworkPolicy> oNetPolicy = aaiNetworkResources.getNetworkPolicy(netPolicyUri);
if(oNetPolicy.isPresent()) {
- l3Network.getNetworkPolicies().add(modelMapper.map(oNetPolicy.get(), org.onap.so.bpmn.servicedecomposition.bbobjects.NetworkPolicy.class));
+ l3network.getNetworkPolicies().add(modelMapper.map(oNetPolicy.get(), org.onap.so.bpmn.servicedecomposition.bbobjects.NetworkPolicy.class));
}
}
}
@@ -205,9 +189,9 @@ public class AAIQueryTasks {
*/
public void queryNetworkTableRef(BuildingBlockExecution execution) {
try {
- L3Network l3Network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID, execution.getLookupMap().get(ResourceKey.NETWORK_ID));
-
- AAIResultWrapper aaiResultWrapper = execution.getVariable(NETWORK_RESULT_WRAPPER_KEY);
+ L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID,
+ execution.getLookupMap().get(ResourceKey.NETWORK_ID));
+ AAIResultWrapper aaiResultWrapper = aaiNetworkResources.queryNetworkWrapperById(l3network);
Optional<Relationships> networkRelationships = aaiResultWrapper.getRelationships();
if (!networkRelationships.isPresent()) {
throw (new Exception(ERROR_MSG));
@@ -219,7 +203,7 @@ public class AAIQueryTasks {
Optional<RouteTableReference> oRouteTableReference = aaiNetworkResources.getRouteTable(routeTableUri);
if(oRouteTableReference.isPresent()) {
org.onap.so.bpmn.servicedecomposition.bbobjects.RouteTableReference mappedRouteTableReference = modelMapper.map(oRouteTableReference.get(), org.onap.so.bpmn.servicedecomposition.bbobjects.RouteTableReference.class);
- l3Network.getContrailNetworkRouteTableReferences().add(mappedRouteTableReference);
+ l3network.getContrailNetworkRouteTableReferences().add(mappedRouteTableReference);
}
}
}