diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-09-04 11:21:02 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-09-08 22:33:28 -0400 |
commit | 69455a268648881f4b5a0c4547d769c2e6ecc2c1 (patch) | |
tree | 8ea753e5282e91316d842522c8873fd51572344c /bpmn/MSOCommonBPMN/src/main | |
parent | 3e9ee0977d0c8643f81e720bbf23e5a40864a0d8 (diff) |
added generic fabric support to SO
Fix Autoincrement of ID field in table
Fix accidental removal of method
Update usage of requestdb client
removed unused imports in common tasks and test
Fix broken branch, have unit tests pass
references
the Epic branch
Fix broken branch from compiling
committing classpath for vfc adapter cause its not going away
added in the fail case for when there are no profiles
removed second set of adapters in application test yml
removed double adapters in request db application test
added jpa repo dependency to the so bpmn folder pom
add creation timestamp column to the table
added in null checks for Config returned from policy
switched to string in requestprocess with jenerate
switched to string in requestprocess with jenerate
updated aai version in common pom to 605 from 591
renamed the db scripts for flyway sync to register
added endpoint to application test yml for failing test
...
Change-Id: I800f837ea75d7cdff740dc3a387e4d7654cfd085
Issue-ID: SO-972
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main')
12 files changed, 235 insertions, 119 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/InjectionHelper.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/InjectionHelper.java index f1c2c8dda6..deae46ce98 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/InjectionHelper.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/InjectionHelper.java @@ -21,8 +21,10 @@ package org.onap.so.bpmn.common; import org.onap.so.client.aai.AAICommonObjectMapperProvider; +import org.onap.so.client.aai.AAIQueryClient; import org.onap.so.client.aai.AAIResourcesClient; import org.onap.so.client.aai.entities.AAIResultWrapper; +import org.onap.so.client.policy.PolicyClientImpl; import org.onap.so.client.sdno.SDNOValidator; import org.onap.so.client.sdno.SDNOValidatorImpl; import org.springframework.stereotype.Component; @@ -46,6 +48,10 @@ public class InjectionHelper { return new AAIResourcesClient(); } + public AAIQueryClient getAaiQueryClient() { + return new AAIQueryClient(); + } + public SDNOValidator getSdnoValidator() { return new SDNOValidatorImpl(); } @@ -57,4 +63,8 @@ public class InjectionHelper { public AAIResultWrapper getAaiResultWrapper(String json) { return new AAIResultWrapper(json); } + + public PolicyClientImpl getPolicyClient() { + return new PolicyClientImpl(); + } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/baseclient/BaseClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/baseclient/BaseClient.java new file mode 100644 index 0000000000..c3511e69a4 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/baseclient/BaseClient.java @@ -0,0 +1,72 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.common.baseclient; + +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.http.client.BufferingClientHttpRequestFactory; +import org.springframework.http.client.SimpleClientHttpRequestFactory; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.RestTemplate; + +//TODO move to common location +public class BaseClient<I,O> { + + private HttpHeaders httpHeader; + private String targetUrl; + + public HttpHeaders getHttpHeader() { + return httpHeader; + } + + public void setHttpHeader(HttpHeaders httpHeader) { + this.httpHeader = httpHeader; + } + + public String getTargetUrl() { + return targetUrl; + } + + public void setTargetUrl(String targetUrl) { + this.targetUrl = targetUrl; + } + + public O get(I data, ParameterizedTypeReference<O> typeRef, Object... uriVariables) throws RestClientException { + return run(data, HttpMethod.GET, typeRef, uriVariables); + } + + public O post(I data, ParameterizedTypeReference<O> typeRef, Object... uriVariables) throws RestClientException { + return run(data, HttpMethod.POST, typeRef, uriVariables); + } + + public O run(I data, HttpMethod method, ParameterizedTypeReference<O> typeRef, Object... uriVariables) throws RestClientException { + HttpEntity<I> requestEntity = new HttpEntity<I>(data, getHttpHeader()); + RestTemplate restTemplate = new RestTemplate(); + restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(new SimpleClientHttpRequestFactory())); + ResponseEntity<O> responseEntity = restTemplate.exchange(getTargetUrl(), method, requestEntity, typeRef, + uriVariables); + return responseEntity.getBody(); + } + +}
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java index ca2da772fb..fe6b0f8b4e 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java @@ -57,7 +57,7 @@ public class ResourceRequestBuilder { public static String CUSTOMIZATION_UUID = "customizationUUID"; - public static String SERVICE_URL_TOSCA_CSAR = "/v3/serviceToscaCsar?serviceModelUuid="; + public static String SERVICE_URL_TOSCA_CSAR = "/v3/serviceToscaCsar"; private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, ResourceRequestBuilder.class); @@ -184,7 +184,7 @@ public class ResourceRequestBuilder { private static String getCsarFromUuid(String uuid) throws Exception { String catalogEndPoint = UrnPropertiesReader.getVariable("mso.catalog.db.endpoint"); - HttpClient client = new HttpClient(UriBuilder.fromUri(catalogEndPoint + SERVICE_URL_TOSCA_CSAR + uuid).build().toURL(), "application/json", TargetEntity.CATALOG_DB); + HttpClient client = new HttpClient(UriBuilder.fromUri(catalogEndPoint).path(SERVICE_URL_TOSCA_CSAR).queryParam("serviceModelUuid", uuid).build().toURL(), "application/json", TargetEntity.CATALOG_DB); Response response = client.get(); String value = response.readEntity(String.class); diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/GenericVnf.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/GenericVnf.java index 17bd4f545b..ba3ab7f315 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/GenericVnf.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/GenericVnf.java @@ -139,8 +139,28 @@ public class GenericVnf implements Serializable, ShallowCopy<GenericVnf> { private List<InstanceGroup> instanceGroups = new ArrayList<InstanceGroup>(); @JsonProperty("call-homing") private Boolean callHoming; + @JsonProperty("nf-function") + private String nfFunction; + @JsonProperty("nf-role") + private String nfRole; + public String getNfFunction() { + return nfFunction; + } + + public void setNfFunction(String nfFunction) { + this.nfFunction = nfFunction; + } + + public String getNfRole() { + return nfRole; + } + + public void setNfRole(String nfRole) { + this.nfRole = nfRole; + } + public List<InstanceGroup> getInstanceGroups() { return instanceGroups; } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ConfigurationResourceKeys.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ConfigurationResourceKeys.java new file mode 100644 index 0000000000..8f0ced955c --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ConfigurationResourceKeys.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.servicedecomposition.entities; + +import java.io.Serializable; + +public class ConfigurationResourceKeys implements Serializable{ + + /** + * + */ + private static final long serialVersionUID = 1L; + private String vfModuleCustomizationUUID; + private String vnfResourceCustomizationUUID; + private String cvnfcCustomizationUUID; + + public String getVfModuleCustomizationUUID() { + return vfModuleCustomizationUUID; + } + public void setVfModuleCustomizationUUID(String vfModuleCustomizationUUID) { + this.vfModuleCustomizationUUID = vfModuleCustomizationUUID; + } + public String getVnfResourceCustomizationUUID() { + return vnfResourceCustomizationUUID; + } + public void setVnfResourceCustomizationUUID(String vnfResourceCustomizationUUID) { + this.vnfResourceCustomizationUUID = vnfResourceCustomizationUUID; + } + public String getCvnfcCustomizationUUID() { + return cvnfcCustomizationUUID; + } + public void setCvnfcCustomizationUUID(String cvnfcCustomizationUUID) { + this.cvnfcCustomizationUUID = cvnfcCustomizationUUID; + } + + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ExecuteBuildingBlock.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ExecuteBuildingBlock.java index 0d04b5e7a1..be73b37f85 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ExecuteBuildingBlock.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ExecuteBuildingBlock.java @@ -39,6 +39,7 @@ public class ExecuteBuildingBlock implements Serializable{ private Boolean homing; private WorkflowResourceIds workflowResourceIds; private RequestDetails requestDetails; + private ConfigurationResourceKeys configurationResourceKeys; public BuildingBlock getBuildingBlock() { return buildingBlock; @@ -100,4 +101,10 @@ public class ExecuteBuildingBlock implements Serializable{ public void setRequestDetails(RequestDetails requestDetails) { this.requestDetails = requestDetails; } + public ConfigurationResourceKeys getConfigurationResourceKeys() { + return configurationResourceKeys; + } + public void setConfigurationResourceKeys(ConfigurationResourceKeys configurationResourceKeys) { + this.configurationResourceKeys = configurationResourceKeys; + } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoConfiguration.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoConfiguration.java index 9d3aa5934b..87168107e1 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoConfiguration.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoConfiguration.java @@ -34,6 +34,8 @@ public class ModelInfoConfiguration implements Serializable{ private String modelVersionId; @JsonProperty("model-customization-id") private String modelCustomizationId; + @JsonProperty("policy-name") + private String policyName; public String getModelInvariantId() { return modelInvariantId; @@ -53,4 +55,10 @@ public class ModelInfoConfiguration implements Serializable{ public void setModelCustomizationId(String modelCustomizationId) { this.modelCustomizationId = modelCustomizationId; } + public String getPolicyName() { + return policyName; + } + public void setPolicyName(String policyName) { + this.policyName = policyName; + } } 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 e8e1982911..8e36cc5f8c 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 @@ -49,6 +49,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription; import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule; import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup; +import org.onap.so.bpmn.servicedecomposition.entities.ConfigurationResourceKeys; import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; @@ -71,6 +72,7 @@ import org.onap.so.db.catalog.beans.OrchestrationStatus; import org.onap.so.db.catalog.beans.Service; import org.onap.so.db.catalog.beans.VfModuleCustomization; import org.onap.so.db.catalog.beans.VnfResourceCustomization; +import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization; import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization; import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.logger.MsoLogger; @@ -267,32 +269,24 @@ public class BBInputSetup implements JavaDelegate { } protected void populateConfiguration(ModelInfo modelInfo, Service service, String bbName, - ServiceInstance serviceInstance, Map<ResourceKey, String> lookupKeyMap, String resourceId, String instanceName) { - boolean foundByName = false; - boolean foundById = false; - for (Configuration configuration : serviceInstance.getConfigurations()) { + ServiceInstance serviceInstance, Map<ResourceKey, String> lookupKeyMap, String resourceId, String instanceName, ConfigurationResourceKeys configurationResourceKeys) { + Configuration configuration = null; + for (Configuration configurationTemp : serviceInstance.getConfigurations()) { if (lookupKeyMap.get(ResourceKey.CONFIGURATION_ID) != null - && configuration.getConfigurationId().equalsIgnoreCase(lookupKeyMap.get(ResourceKey.CONFIGURATION_ID))) { - foundById = true; + && configurationTemp.getConfigurationId().equalsIgnoreCase(lookupKeyMap.get(ResourceKey.CONFIGURATION_ID))) { + configuration = configurationTemp; org.onap.aai.domain.yang.Configuration aaiConfiguration = bbInputSetupUtils.getAAIConfiguration(configuration.getConfigurationId()); if(aaiConfiguration!=null){ modelInfo.setModelCustomizationUuid(aaiConfiguration.getModelCustomizationId()); } - this.mapCatalogConfiguration(configuration, modelInfo, service); - } else if (instanceName != null && configuration.getConfigurationName().equalsIgnoreCase(instanceName)) { - foundByName = true; - lookupKeyMap.put(ResourceKey.CONFIGURATION_ID, configuration.getConfigurationId()); - org.onap.aai.domain.yang.Configuration aaiConfiguration = bbInputSetupUtils.getAAIConfiguration(configuration.getConfigurationId()); - if(aaiConfiguration!=null){ - modelInfo.setModelCustomizationUuid(aaiConfiguration.getModelCustomizationId()); - } - this.mapCatalogConfiguration(configuration, modelInfo, service); } } - if (!foundByName && !foundById && bbName.equalsIgnoreCase(AssignFlows.FABRIC_CONFIGURATION.toString())) { - Configuration configuration = this.createConfiguration(lookupKeyMap, instanceName, resourceId); + if (configuration == null && bbName.equalsIgnoreCase(AssignFlows.FABRIC_CONFIGURATION.toString())) { + configuration = this.createConfiguration(lookupKeyMap, instanceName, resourceId); serviceInstance.getConfigurations().add(configuration); - this.mapCatalogConfiguration(configuration, modelInfo, service); + } + if(configuration != null) { + this.mapCatalogConfiguration(configuration, modelInfo, service, configurationResourceKeys); } } @@ -306,11 +300,28 @@ public class BBInputSetup implements JavaDelegate { return configuration; } - protected void mapCatalogConfiguration(Configuration configuration, ModelInfo modelInfo, Service service) { + protected void mapCatalogConfiguration(Configuration configuration, ModelInfo modelInfo, Service service, ConfigurationResourceKeys configurationResourceKeys) { ConfigurationResourceCustomization configurationResourceCustomization = findConfigurationResourceCustomization(modelInfo, service); - if (configurationResourceCustomization != null) { - configuration.setModelInfoConfiguration(this.mapperLayer.mapCatalogConfigurationToConfiguration(configurationResourceCustomization)); + VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization = + findVnfVfmoduleCvnfcConfigurationCustomization(configurationResourceKeys.getVfModuleCustomizationUUID(), + configurationResourceKeys.getVnfResourceCustomizationUUID(), configurationResourceKeys.getCvnfcCustomizationUUID(), configurationResourceCustomization); + if (configurationResourceCustomization != null && vnfVfmoduleCvnfcConfigurationCustomization != null) { + configuration.setModelInfoConfiguration(this.mapperLayer.mapCatalogConfigurationToConfiguration(configurationResourceCustomization + , vnfVfmoduleCvnfcConfigurationCustomization)); + } + } + + protected VnfVfmoduleCvnfcConfigurationCustomization findVnfVfmoduleCvnfcConfigurationCustomization(String vfModuleCustomizationUUID, + String vnfResourceCustomizationUUID, String cvnfcCustomizationUUID, ConfigurationResourceCustomization configurationResourceCustomization) { + for(VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization : + configurationResourceCustomization.getConfigurationResource().getVnfVfmoduleCvnfcConfigurationCustomization()) { + if(vnfVfmoduleCvnfcConfigurationCustomization.getVfModuleCustomization().getModelCustomizationUUID().equalsIgnoreCase(vfModuleCustomizationUUID) + && vnfVfmoduleCvnfcConfigurationCustomization.getVnfResourceCustomization().getModelCustomizationUUID().equalsIgnoreCase(vnfResourceCustomizationUUID) + && vnfVfmoduleCvnfcConfigurationCustomization.getCvnfcCustomization().getModelCustomizationUUID().equalsIgnoreCase(cvnfcCustomizationUUID)) { + return vnfVfmoduleCvnfcConfigurationCustomization; + } } + return null; } protected ConfigurationResourceCustomization findConfigurationResourceCustomization(ModelInfo modelInfo, Service service) { @@ -896,12 +907,7 @@ public class BBInputSetup implements JavaDelegate { String configurationId = lookupKeyMap.get(ResourceKey.CONFIGURATION_ID); ModelInfo configurationModelInfo = new ModelInfo(); configurationModelInfo.setModelCustomizationUuid(key); - ConfigurationResourceCustomization configurationCust = findConfigurationResourceCustomization(configurationModelInfo, service); - if(configurationCust != null) { - this.populateConfiguration(configurationModelInfo, service, bbName, serviceInstance, lookupKeyMap, configurationId, null); - } else { - msoLogger.debug("Could not find a configuration customization with key: " + key); - } + this.populateConfiguration(configurationModelInfo, service, bbName, serviceInstance, lookupKeyMap, configurationId, null, executeBB.getConfigurationResourceKeys()); } if (executeBB.getWorkflowResourceIds() != null) { this.populateNetworkCollectionAndInstanceGroupAssign(service, bbName, serviceInstance, @@ -1019,7 +1025,7 @@ public class BBInputSetup implements JavaDelegate { .getModelCustomizationId(); ModelInfo modelInfo = new ModelInfo(); modelInfo.setModelCustomizationUuid(configurationCustUUID); - this.mapCatalogConfiguration(configuration, modelInfo, service); + this.mapCatalogConfiguration(configuration, modelInfo, service, executeBB.getConfigurationResourceKeys()); break; } } @@ -1087,7 +1093,7 @@ public class BBInputSetup implements JavaDelegate { configurationModelInfo.setModelCustomizationUuid(key); ConfigurationResourceCustomization configurationCust = findConfigurationResourceCustomization(configurationModelInfo, service); if(configurationCust != null) { - this.populateConfiguration(configurationModelInfo, service, bbName, serviceInstance, lookupKeyMap, configurationId, null); + this.populateConfiguration(configurationModelInfo, service, bbName, serviceInstance, lookupKeyMap, configurationId, null, executeBB.getConfigurationResourceKeys()); } else { msoLogger.debug("Could not find a configuration customization with key: " + key); } 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 c2161a4fee..877d5bb88f 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 @@ -76,6 +76,7 @@ import org.onap.so.db.catalog.beans.OrchestrationStatus; import org.onap.so.db.catalog.beans.Service; import org.onap.so.db.catalog.beans.VfModuleCustomization; import org.onap.so.db.catalog.beans.VnfResourceCustomization; +import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization; import org.onap.so.logger.MsoLogger; import org.onap.so.serviceinstancebeans.CloudConfiguration; import org.onap.so.serviceinstancebeans.RequestDetails; @@ -454,11 +455,13 @@ public class BBInputSetupMapperLayer { } protected ModelInfoConfiguration mapCatalogConfigurationToConfiguration( - ConfigurationResourceCustomization configurationResourceCustomization) { + ConfigurationResourceCustomization configurationResourceCustomization, + VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization) { ModelInfoConfiguration modelInfoConfiguration = new ModelInfoConfiguration(); modelInfoConfiguration.setModelVersionId(configurationResourceCustomization.getConfigurationResource().getModelUUID()); modelInfoConfiguration.setModelCustomizationId(configurationResourceCustomization.getModelCustomizationUUID()); modelInfoConfiguration.setModelInvariantId(configurationResourceCustomization.getConfigurationResource().getModelInvariantUUID()); + modelInfoConfiguration.setPolicyName(vnfVfmoduleCvnfcConfigurationCustomization.getPolicyName()); return modelInfoConfiguration; } 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 4b85538428..84ecfc7576 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 @@ -45,7 +45,7 @@ import org.onap.so.client.aai.AAIObjectType; import org.onap.so.client.aai.entities.AAIResultWrapper; import org.onap.so.client.aai.entities.uri.AAIResourceUri; import org.onap.so.client.aai.entities.uri.AAIUriFactory; -import org.onap.so.client.db.request.RequestsDbClient; + import org.onap.so.client.graphinventory.entities.uri.Depth; import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization; import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization; @@ -54,6 +54,7 @@ import org.onap.so.db.catalog.beans.Service; import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization; import org.onap.so.db.catalog.client.CatalogDbClient; import org.onap.so.db.request.beans.InfraActiveRequests; +import org.onap.so.db.request.client.RequestsDbClient; import org.onap.so.logger.MsoLogger; import org.onap.so.serviceinstancebeans.CloudConfiguration; import org.onap.so.serviceinstancebeans.RequestDetails; diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/db/request/RequestsDbClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/db/request/RequestsDbClient.java deleted file mode 100644 index 61869ca322..0000000000 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/db/request/RequestsDbClient.java +++ /dev/null @@ -1,86 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * 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. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.client.db.request; - -import java.io.IOException; -import java.net.URI; - -import org.onap.so.db.request.beans.InfraActiveRequests; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpRequest; -import org.springframework.http.client.ClientHttpRequestExecution; -import org.springframework.http.client.ClientHttpRequestInterceptor; -import org.springframework.http.client.ClientHttpResponse; -import org.springframework.stereotype.Component; -import org.springframework.web.client.RestTemplate; - -import uk.co.blackpepper.bowman.Client; -import uk.co.blackpepper.bowman.ClientFactory; -import uk.co.blackpepper.bowman.Configuration; -import uk.co.blackpepper.bowman.RestTemplateConfigurer; - -@Component("RequestDbClient") -public class RequestsDbClient { - - private Client<InfraActiveRequests> infraActiveRequestClient; - - @Value("${mso.adapters.db.spring.endpoint}") - private String endpoint; - - @Value("${mso.db.auth}") - private String msoAdaptersAuth; - - public RequestsDbClient() { - ClientFactory clientFactory = Configuration.builder().setRestTemplateConfigurer(new RestTemplateConfigurer() { - - public void configure(RestTemplate restTemplate) { - - restTemplate.getInterceptors().add(new ClientHttpRequestInterceptor() { - - public ClientHttpResponse intercept(HttpRequest request, byte[] body, - ClientHttpRequestExecution execution) throws IOException { - - request.getHeaders().add("Authorization", msoAdaptersAuth); - return execution.execute(request, body); - } - }); - } - }).build().buildClientFactory(); - infraActiveRequestClient = clientFactory.create(InfraActiveRequests.class); - - } - - public InfraActiveRequests getInfraActiveRequestbyRequestId(String requestId) { - return this.getSingleInfraActiveRequests(this.getUri(endpoint + "/infraActiveRequests/" + requestId)); - } - - protected InfraActiveRequests getSingleInfraActiveRequests(URI uri) { - return infraActiveRequestClient.get(uri); - } - - public void updateInfraActiveRequests(InfraActiveRequests request) { - infraActiveRequestClient.put(request); - } - - protected URI getUri(String uri) { - return URI.create(uri); - } -} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowProcessorException.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowProcessorException.java index 768bee578c..64283d78ca 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowProcessorException.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowProcessorException.java @@ -1,3 +1,23 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + package org.openecomp.mso.bpmn.common.workflow.service; import org.onap.so.bpmn.common.workflow.context.WorkflowResponse; |