summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main/java/org/onap
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-10-11 13:55:37 -0400
committerRob Daugherty <rd472p@att.com>2018-10-12 10:10:16 -0400
commit6ba0a22bc952232d14d2d24c5f73a42aae2791a9 (patch)
tree9046e63bccb77ca3e2df4ae7ceab44cc238dd074 /bpmn/MSOCommonBPMN/src/main/java/org/onap
parent58c1d90a787979e507f559d7075aac8a1428df42 (diff)
Dynamic Cloud Owner Support
added in cloud configuration object to request params Fix Bean scanning so it picks up the resttemplate removed unnecessary RestTemplate Bean configurations corrected typo in CloudConfiguration class updated gr api test cases with dynamic cloud owner updated groovy files to allow for dynamic cloud owner values updated GR API layer to include cloud owner added enum for default cloud owner add cloud owner variable to camunda in mapping removed references to att-aic from BBInputSetup updated aai schema dependency to 1.3.1 from 1.3.0 Fixed incorrect type AAIUri and updated logging in the method. use existing service instance id instead of generating Pass cloudOwner to process to propagate to subprocesses. NOTE: our aai-schema dependency is 1.3.1-SNAPSHOT to be compatible with the cloud owner changes here. The releaesed 1.3.0 version is NOT compatible. Change-Id: I43b46774b77981d1c8bfe7c7a79b9434889e62ae Issue-ID: SO-1128 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com> Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java/org/onap')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/Candidate.java22
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/CandidateType.java5
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java21
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java7
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerClient.java2
6 files changed, 37 insertions, 24 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/Candidate.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/Candidate.java
index 01846681db..91cd2ad791 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/Candidate.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/Candidate.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,6 +35,8 @@ public class Candidate implements Serializable {
private CandidateType candidateType;
@JsonProperty("candidates")
private List<String> candidates;
+ @JsonProperty("cloudOwner")
+ private String cloudOwner;
/**
* list of candidates
@@ -68,4 +70,20 @@ public class Candidate implements Serializable {
this.candidateType = candidateType;
}
+ /**
+ * The name of the cloud owner. Required if candidateType is cloudRegionId
+ */
+ public String getCloudOwner(){
+ return cloudOwner;
+ }
+
+ /**
+ * The name of the cloud owner. Required if candidateType is cloudRegionId
+ */
+ public void setCloudOwner(String cloudOwner){
+ this.cloudOwner = cloudOwner;
+ }
+
+
+
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/CandidateType.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/CandidateType.java
index 9540b9148e..40c76a3c92 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/CandidateType.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/CandidateType.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,7 +37,6 @@ public enum CandidateType {
return name;
}
- //TODO added to get PojoTest to work
public String getName(){
return name;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
index eb4f4ca0d5..769d3e4e89 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
@@ -101,7 +101,6 @@ public class BBInputSetup implements JavaDelegate {
private static final String LOOKUP_KEY_MAP_VAR_NAME = "lookupKeyMap";
private static final String GBB_INPUT_VAR_NAME = "gBBInput";
private static final String EXECUTE_BB_VAR_NAME = "buildingBlock";
- private static final String CLOUD_OWNER = "att-aic";
private static final String VOLUME_GROUP = "VolumeGroup";
private static final String VF_MODULE = "VfModule";
private static final String NETWORK = "Network";
@@ -384,7 +383,7 @@ public class BBInputSetup implements JavaDelegate {
if (lookupKeyMap.get(ResourceKey.VOLUME_GROUP_ID) == null) {
for(VolumeGroup volumeGroup : tempVnf.getVolumeGroups()) {
String volumeGroupCustId =
- this.bbInputSetupUtils.getAAIVolumeGroup(CLOUD_OWNER,
+ this.bbInputSetupUtils.getAAIVolumeGroup(cloudConfiguration.getCloudOwner(),
cloudConfiguration.getLcpCloudRegionId(), volumeGroup.getVolumeGroupId()).getModelCustomizationId();
if(modelInfo.getModelCustomizationId().equalsIgnoreCase(volumeGroupCustId)) {
lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, volumeGroup.getVolumeGroupId());
@@ -801,9 +800,8 @@ public class BBInputSetup implements JavaDelegate {
requestContext.setAction(requestAction);
requestContext.setMsoRequestId(executeBB.getRequestId());
org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = bbInputSetupUtils
- .getCloudRegion(requestDetails.getCloudConfiguration(), CLOUD_OWNER);
- CloudRegion cloudRegion = mapperLayer.mapCloudRegion(requestDetails.getCloudConfiguration(), aaiCloudRegion,
- CLOUD_OWNER);
+ .getCloudRegion(requestDetails.getCloudConfiguration());
+ CloudRegion cloudRegion = mapperLayer.mapCloudRegion(requestDetails.getCloudConfiguration(), aaiCloudRegion);
outputBB.setOrchContext(orchContext);
outputBB.setRequestContext(requestContext);
outputBB.setCloudRegion(cloudRegion);
@@ -981,9 +979,8 @@ public class BBInputSetup implements JavaDelegate {
String requestAction, CloudConfiguration cloudConfiguration) throws Exception {
ServiceInstance serviceInstance = gBB.getServiceInstance();
if (cloudConfiguration != null && requestAction.equalsIgnoreCase("deleteInstance")) {
- org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = bbInputSetupUtils.getCloudRegion(cloudConfiguration,
- CLOUD_OWNER);
- CloudRegion cloudRegion = mapperLayer.mapCloudRegion(cloudConfiguration, aaiCloudRegion, CLOUD_OWNER);
+ org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = bbInputSetupUtils.getCloudRegion(cloudConfiguration);
+ CloudRegion cloudRegion = mapperLayer.mapCloudRegion(cloudConfiguration, aaiCloudRegion);
gBB.setCloudRegion(cloudRegion);
}
if (bbName.contains(VNF)) {
@@ -1030,7 +1027,7 @@ public class BBInputSetup implements JavaDelegate {
this.mapCatalogVnf(vnf, vnfModelInfo, service);
lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, vnf.getVnfId());
if (cloudConfiguration != null) {
- String volumeGroupCustomizationUUID = this.bbInputSetupUtils.getAAIVolumeGroup(CLOUD_OWNER,
+ String volumeGroupCustomizationUUID = this.bbInputSetupUtils.getAAIVolumeGroup(cloudConfiguration.getCloudOwner(),
cloudConfiguration.getLcpCloudRegionId(), volumeGroup.getVolumeGroupId())
.getModelCustomizationId();
ModelInfo volumeGroupModelInfo = new ModelInfo();
@@ -1116,6 +1113,7 @@ public class BBInputSetup implements JavaDelegate {
String vfModuleId = lookupKeyMap.get(ResourceKey.VF_MODULE_ID);
CloudConfiguration cloudConfig = new CloudConfiguration();
cloudConfig.setLcpCloudRegionId(cloudRegion.getLcpCloudRegionId());
+ cloudConfig.setCloudOwner(cloudRegion.getCloudOwner());
this.populateVfModule(modelInfo, service, bbName, serviceInstance, lookupKeyMap, vfModuleId, null,
vfModules.getInstanceName(), vfModules.getInstanceParams(), cloudConfig);
}
@@ -1193,9 +1191,8 @@ public class BBInputSetup implements JavaDelegate {
}
}
if(cloudConfiguration != null) {
- org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = bbInputSetupUtils.getCloudRegion(cloudConfiguration,
- CLOUD_OWNER);
- return mapperLayer.mapCloudRegion(cloudConfiguration, aaiCloudRegion, CLOUD_OWNER);
+ org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = bbInputSetupUtils.getCloudRegion(cloudConfiguration);
+ return mapperLayer.mapCloudRegion(cloudConfiguration, aaiCloudRegion);
} else {
msoLogger.debug("Could not find any cloud configuration for this request.");
return null;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
index 0c7eb0973f..6c399ddbbb 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
@@ -351,14 +351,12 @@ public class BBInputSetupMapperLayer {
return context;
}
- protected CloudRegion mapCloudRegion(CloudConfiguration cloudConfiguration, org.onap.aai.domain.yang.CloudRegion aaiCloudRegion, String cloudOwner) {
+ protected CloudRegion mapCloudRegion(CloudConfiguration cloudConfiguration, org.onap.aai.domain.yang.CloudRegion aaiCloudRegion) {
CloudRegion cloudRegion = new CloudRegion();
if(cloudConfiguration != null)
cloudRegion = modelMapper.map(cloudConfiguration, CloudRegion.class);
if(aaiCloudRegion != null)
modelMapper.map(aaiCloudRegion, cloudRegion);
- if(cloudOwner != null)
- cloudRegion.setCloudOwner(cloudOwner);
return cloudRegion;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java
index 84ecfc7576..4617fc4710 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java
@@ -163,13 +163,14 @@ public class BBInputSetupUtils {
}
}
- protected CloudRegion getCloudRegion(CloudConfiguration cloudConfiguration, String cloudOwner) {
+ protected CloudRegion getCloudRegion(CloudConfiguration cloudConfiguration) {
if (cloudConfiguration != null) {
String cloudRegionId = cloudConfiguration.getLcpCloudRegionId();
- if (cloudRegionId != null && !cloudRegionId.isEmpty()) {
+ String cloudOwner = cloudConfiguration.getCloudOwner();
+ if (cloudRegionId != null && cloudOwner != null && !cloudRegionId.isEmpty() && !cloudOwner.isEmpty()) {
return injectionHelper.getAaiClient().get(CloudRegion.class,
AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, cloudOwner,
- cloudConfiguration.getLcpCloudRegionId())).orElse(null);
+ cloudRegionId)).orElse(null);
} else {
return null;
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerClient.java
index f87ec91440..89eff5f65a 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerClient.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerClient.java
@@ -182,7 +182,7 @@ public class ApplicationControllerClient {
commonHeader.setApiVer(API_VER);
commonHeader.setOriginatorId(ORIGINATOR_ID);
commonHeader.setRequestId(requestId == null ? UUID.randomUUID().toString() : requestId);
- commonHeader.setSubRequestId(requestId);
+ commonHeader.setSubRequestId(UUID.randomUUID().toString());
Flags flags = new Flags();
String flagsMode = "NORMAL";
Mode mode = Mode.valueOf(flagsMode);