From f47919f1fe367b612fa9c96d34c59f01a541e882 Mon Sep 17 00:00:00 2001
From: "Benjamin, Max (mb388a)"
Date: Mon, 8 Apr 2019 14:14:34 -0400
Subject: Replaced all tabs with spaces in java and pom.xml
Added in maven plugins to enforce coding style rules
Added in eclipse java formatting xml
Change-Id: I3727bbf4ce8dc66abfd8ad21b6cfd0890c5d3ff0
Issue-ID: SO-1765
Signed-off-by: Benjamin, Max (mb388a)
---
.../infrastructure/aai/AAICreateResources.java | 112 +-
.../aai/AAIDeleteServiceInstance.java | 34 +-
.../so/bpmn/infrastructure/aai/AAIResource.java | 22 +-
.../infrastructure/aai/AAIServiceInstance.java | 263 ++--
.../aai/groovyflows/AAICreateResources.java | 166 +--
.../aai/groovyflows/AAIDeleteServiceInstance.java | 36 +-
.../aai/groovyflows/AAIServiceInstance.java | 155 ++-
.../generation/AAIObjectInstanceNameGenerator.java | 21 +-
.../CheckAaiForPnfCorrelationIdDelegate.java | 2 -
.../pnf/delegate/ConfigCheckerDelegate.java | 49 +-
.../pnf/delegate/CreatePnfEntryInAaiDelegate.java | 5 +-
.../pnf/delegate/CreateRelation.java | 4 +-
.../pnf/delegate/GeneratePnfUuidDelegate.java | 3 +-
.../pnf/delegate/InformDmaapClient.java | 8 +-
.../pnf/delegate/PnfCheckInputs.java | 10 +-
.../pnf/delegate/PrepareCdsCallDelegate.java | 26 +-
.../pnf/delegate/PrepareConfigAssignDelegate.java | 26 +-
.../pnf/delegate/PrepareConfigDeployDelegate.java | 41 +-
.../pnf/dmaap/JsonUtilForPnfCorrelationId.java | 5 +-
.../pnf/dmaap/PnfEventReadyDmaapClient.java | 19 +-
.../pnf/management/PnfManagementImpl.java | 4 +-
.../infrastructure/properties/BPMNProperties.java | 16 +-
.../vfcmodel/NSResourceInputParameter.java | 2 -
.../infrastructure/vfcmodel/NsOperationKey.java | 3 +-
.../bpmn/infrastructure/vfcmodel/NsParameters.java | 3 +-
.../bpmn/infrastructure/vfcmodel/VimLocation.java | 2 +-
.../workflow/service/ServicePluginFactory.java | 1386 ++++++++++----------
.../serviceTask/AbstractSdncOperationTask.java | 94 +-
.../SdncNetworkTopologyOperationTask.java | 27 +-
.../SdncServiceTopologyOperationTask.java | 21 +-
.../SdncUnderlayVpnOperationClient.java | 38 +-
.../serviceTask/SdncUnderlayVpnPreprocessTask.java | 9 +-
.../serviceTask/client/GenericResourceApi.java | 10 +-
.../workflow/serviceTask/client/HeaderUtil.java | 3 +-
.../client/builder/AbstractBuilder.java | 400 +++---
.../builder/NetworkRpcInputEntityBuilder.java | 35 +-
.../builder/ServiceRpcInputEntityBuilder.java | 28 +-
.../entity/NetworkInputParametersEntity.java | 5 +-
.../client/entity/RequestInformationEntity.java | 4 +-
.../RpcNetworkTopologyOperationInputEntity.java | 4 +-
.../RpcNetworkTopologyOperationOutputEntity.java | 4 +-
.../RpcServiceTopologyOperationInputEntity.java | 7 +-
.../entity/ServiceInputParametersEntity.java | 5 +-
.../java/org/onap/so/bpmn/AllBPMNTestSuites.java | 6 +-
.../org/onap/so/bpmn/AllTasksTestsTestSuite.java | 8 +-
.../java/org/onap/so/bpmn/AllTestsTestSuite.java | 17 +-
.../org/onap/so/bpmn/infrastructure/BeansTest.java | 51 +-
.../bpmn/infrastructure/WebSecurityConfigImpl.java | 31 +-
.../infrastructure/aai/AAICreateResourcesTest.java | 301 ++---
.../aai/AAIDeleteServiceInstanceTest.java | 87 +-
.../infrastructure/aai/AAIServiceInstanceTest.java | 170 +--
.../AAIObjectInstanceNameGeneratorTest.java | 43 +-
.../pnf/delegate/CancelDmaapSubscriptionTest.java | 6 +-
.../CheckAaiForPnfCorrelationIdDelegateTest.java | 11 +-
.../pnf/delegate/ConfigCheckerDelegateTest.java | 51 +-
.../delegate/CreatePnfEntryInAaiDelegateTest.java | 1 -
.../pnf/delegate/CreateRelationTest.java | 1 -
.../pnf/delegate/GeneratePnfUuidDelegateTest.java | 1 -
.../pnf/delegate/InformDmaapClientTest.java | 6 +-
.../pnf/delegate/PnfCheckInputsTest.java | 1 -
.../pnf/delegate/PnfManagementTestImpl.java | 4 +-
.../delegate/PrepareConfigAssignDelegateTest.java | 32 +-
.../delegate/PrepareConfigDeployDelegateTest.java | 47 +-
.../pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java | 13 +-
.../pnf/dmaap/PnfEventReadyDmaapClientTest.java | 74 +-
.../infrastructure/vfcmodel/VfcModelPojoTest.java | 19 +-
.../workflow/service/ServicePluginFactoryTest.java | 130 +-
.../serviceTask/client/HeaderUtilTest.java | 7 +-
.../client/builder/AbstractBuilderTest.java | 222 ++--
.../builder/NetworkRpcInputEntityBuilderTest.java | 67 +-
.../builder/ServiceRpcInputEntityBuilderTest.java | 67 +-
.../client/entity/ClientEntityPojoTest.java | 68 +-
72 files changed, 2306 insertions(+), 2353 deletions(-)
(limited to 'bpmn/so-bpmn-infrastructure-common/src')
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java
index a47b16fc33..d401522800 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java
@@ -23,7 +23,6 @@ package org.onap.so.bpmn.infrastructure.aai;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
-
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIResourcesClient;
@@ -34,57 +33,64 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory;
public class AAICreateResources extends AAIResource {
- public void createAAIProject (String projectName, String serviceInstance){
- AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName);
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
- getAaiClient().createIfNotExists(projectURI, Optional.empty()).connect(projectURI, serviceInstanceURI);
-
- }
-
- public void createAAIOwningEntity(String owningEntityId, String owningEntityName,String serviceInstance){
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
- Map hashMap= new HashMap<>();
- hashMap.put("owning-entity-name", owningEntityName);
- getAaiClient().createIfNotExists(owningEntityURI, Optional.of(hashMap)).connect(owningEntityURI, serviceInstanceURI);
- }
+ public void createAAIProject(String projectName, String serviceInstance) {
+ AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ getAaiClient().createIfNotExists(projectURI, Optional.empty()).connect(projectURI, serviceInstanceURI);
+
+ }
+
+ public void createAAIOwningEntity(String owningEntityId, String owningEntityName, String serviceInstance) {
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ Map hashMap = new HashMap<>();
+ hashMap.put("owning-entity-name", owningEntityName);
+ getAaiClient().createIfNotExists(owningEntityURI, Optional.of(hashMap)).connect(owningEntityURI,
+ serviceInstanceURI);
+ }
+
+ public boolean existsOwningEntity(String owningEntityId) {
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ return getAaiClient().exists(owningEntityURI);
+ }
+
+ public void connectOwningEntityandServiceInstance(String owningEntityId, String serviceInstance) {
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ getAaiClient().connect(owningEntityURI, serviceInstanceURI);
+ }
+
+ public void createAAIPlatform(String platformName, String vnfId) {
+ AAIResourceUri platformURI = AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platformName);
+ AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+ getAaiClient().createIfNotExists(platformURI, Optional.empty()).connect(platformURI, genericVnfURI);
+ }
+
+ public void createAAILineOfBusiness(String lineOfBusiness, String vnfId) {
+ AAIResourceUri lineOfBusinessURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness);
+ AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+ getAaiClient().createIfNotExists(lineOfBusinessURI, Optional.empty()).connect(lineOfBusinessURI, genericVnfURI);
+ }
+
+ public void createAAIServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId) {
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
+ globalCustomerId, serviceType, serviceInstanceId);
+ getAaiClient().createIfNotExists(serviceInstanceURI, Optional.empty());
+ }
+
+ public Optional getVnfInstance(String vnfId) {
+ try {
+ AAIResourceUri vnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+ AAIResultWrapper aaiResponse = getAaiClient().get(vnfURI);
+ Optional vnf = aaiResponse.asBean(GenericVnf.class);
+ return vnf;
+ } catch (Exception ex) {
+ return Optional.empty();
+ }
+ }
- public boolean existsOwningEntity(String owningEntityId){
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
- return getAaiClient().exists(owningEntityURI);
- }
-
- public void connectOwningEntityandServiceInstance (String owningEntityId, String serviceInstance){
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
- getAaiClient().connect(owningEntityURI, serviceInstanceURI);
- }
-
- public void createAAIPlatform(String platformName,String vnfId){
- AAIResourceUri platformURI = AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platformName);
- AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId);
- getAaiClient().createIfNotExists(platformURI, Optional.empty()).connect(platformURI, genericVnfURI);
- }
-
- public void createAAILineOfBusiness(String lineOfBusiness,String vnfId){
- AAIResourceUri lineOfBusinessURI = AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness);
- AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId);
- getAaiClient().createIfNotExists(lineOfBusinessURI, Optional.empty()).connect(lineOfBusinessURI, genericVnfURI);
- }
- public void createAAIServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId){
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustomerId,serviceType,serviceInstanceId);
- getAaiClient().createIfNotExists(serviceInstanceURI, Optional.empty());
- }
-
- public Optional getVnfInstance(String vnfId){
- try{
- AAIResourceUri vnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
- AAIResultWrapper aaiResponse = getAaiClient().get(vnfURI);
- Optional vnf = aaiResponse.asBean(GenericVnf.class);
- return vnf;
- } catch (Exception ex){
- return Optional.empty();
- }
- }
-
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java
index cea6fe740d..2526ca5c25 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java
@@ -29,21 +29,23 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.springframework.stereotype.Component;
-public class AAIDeleteServiceInstance extends AAIResource implements JavaDelegate{
+public class AAIDeleteServiceInstance extends AAIResource implements JavaDelegate {
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil();
+
+ public void execute(DelegateExecution execution) throws Exception {
+ try {
+ String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
+ getAaiClient().delete(serviceInstanceURI);
+ execution.setVariable("GENDS_SuccessIndicator", true);
+ } catch (Exception ex) {
+ String msg = "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI."
+ + ex.getMessage();
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
+ }
+
+ }
- ExceptionUtil exceptionUtil = new ExceptionUtil();
- public void execute(DelegateExecution execution) throws Exception {
- try{
- String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
- serviceInstanceId);
- getAaiClient().delete(serviceInstanceURI);
- execution.setVariable("GENDS_SuccessIndicator",true);
- } catch(Exception ex){
- String msg = "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI." + ex.getMessage();
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
- }
-
- }
-
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIResource.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIResource.java
index 3bc02be476..1410752f76 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIResource.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIResource.java
@@ -24,17 +24,17 @@ import org.onap.so.client.aai.AAIResourcesClient;
import org.springframework.stereotype.Component;
@Component
-public abstract class AAIResource {
- private AAIResourcesClient aaiClient;
+public abstract class AAIResource {
+ private AAIResourcesClient aaiClient;
- public AAIResourcesClient getAaiClient() {
- if(aaiClient == null)
- return new AAIResourcesClient();
- else
- return aaiClient;
- }
+ public AAIResourcesClient getAaiClient() {
+ if (aaiClient == null)
+ return new AAIResourcesClient();
+ else
+ return aaiClient;
+ }
- public void setAaiClient(AAIResourcesClient aaiClient) {
- this.aaiClient = aaiClient;
- }
+ public void setAaiClient(AAIResourcesClient aaiClient) {
+ this.aaiClient = aaiClient;
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java
index c5cd2c70da..376ca4dbdb 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java
@@ -21,129 +21,144 @@
package org.onap.so.bpmn.infrastructure.aai;
public class AAIServiceInstance {
- String serviceInstanceName;
- String serviceType;
- String serviceRole;
- String orchestrationStatus;
- String modelInvariantUuid;
- String modelVersionId;
- String environmentContext;
- String workloadContext;
-
- public static class AAIServiceInstanceBuilder {
- private String serviceInstanceName;
- private String serviceType;
- private String serviceRole;
- private String orchestrationStatus;
- private String modelInvariantUuid;
- private String modelVersionId;
- private String environmentContext;
- private String workloadContext;
-
- public AAIServiceInstanceBuilder setServiceInstanceName(String serviceInstanceName) {
- this.serviceInstanceName = serviceInstanceName;
- return this;
- }
-
- public AAIServiceInstanceBuilder setServiceType(String serviceType) {
- this.serviceType = serviceType;
- return this;
- }
-
- public AAIServiceInstanceBuilder setServiceRole(String serviceRole) {
- this.serviceRole = serviceRole;
- return this;
- }
-
- public AAIServiceInstanceBuilder setOrchestrationStatus(String orchestrationStatus) {
- this.orchestrationStatus = orchestrationStatus;
- return this;
- }
-
- public AAIServiceInstanceBuilder setModelInvariantUuid(String modelInvariantUuid) {
- this.modelInvariantUuid = modelInvariantUuid;
- return this;
- }
-
- public AAIServiceInstanceBuilder setModelVersionId(String modelVersionId) {
- this.modelVersionId = modelVersionId;
- return this;
- }
-
- public AAIServiceInstanceBuilder setEnvironmentContext(String environmentContext) {
- this.environmentContext = environmentContext;
- return this;
- }
-
- public AAIServiceInstanceBuilder setWorkloadContext(String workloadContext) {
- this.workloadContext = workloadContext;
- return this;
- }
-
- public AAIServiceInstance createAAIServiceInstance() {
- return new AAIServiceInstance(this);
- }
- }
-
- public AAIServiceInstance(AAIServiceInstanceBuilder aaiServiceInstanceBuilder) {
- this.serviceInstanceName = aaiServiceInstanceBuilder.serviceInstanceName;
- this.serviceType = aaiServiceInstanceBuilder.serviceType;
- this.serviceRole = aaiServiceInstanceBuilder.serviceRole;
- this.orchestrationStatus = aaiServiceInstanceBuilder.orchestrationStatus;
- this.modelInvariantUuid = aaiServiceInstanceBuilder.modelInvariantUuid;
- this.modelVersionId = aaiServiceInstanceBuilder.modelVersionId;
- this.environmentContext = aaiServiceInstanceBuilder.environmentContext;
- this.workloadContext = aaiServiceInstanceBuilder.workloadContext;
- }
-
- public String getServiceInstanceName() {
- return serviceInstanceName;
- }
- public void setServiceInstanceName(String serviceInstanceName) {
- this.serviceInstanceName = serviceInstanceName;
- }
- public String getServiceType() {
- return serviceType;
- }
- public void setServiceType(String serviceType) {
- this.serviceType = serviceType;
- }
- public String getServiceRole() {
- return serviceRole;
- }
- public void setServiceRole(String serviceRole) {
- this.serviceRole = serviceRole;
- }
- public String getOrchestrationStatus() {
- return orchestrationStatus;
- }
- public void setOrchestrationStatus(String orchestrationStatus) {
- this.orchestrationStatus = orchestrationStatus;
- }
- public String getModelInvariantUuid() {
- return modelInvariantUuid;
- }
- public void setModelInvariantUuid(String modelInvariantUuid) {
- this.modelInvariantUuid = modelInvariantUuid;
- }
- public String getModelVersionId() {
- return modelVersionId;
- }
- public void setModelVersionId(String modelVersionId) {
- this.modelVersionId = modelVersionId;
- }
- public String getEnvironmentContext() {
- return environmentContext;
- }
- public void setEnvironmentContext(String environmentContext) {
- this.environmentContext = environmentContext;
- }
- public String getWorkloadContext() {
- return workloadContext;
- }
- public void setWorkloadContext(String workloadContext) {
- this.workloadContext = workloadContext;
- }
-
+ String serviceInstanceName;
+ String serviceType;
+ String serviceRole;
+ String orchestrationStatus;
+ String modelInvariantUuid;
+ String modelVersionId;
+ String environmentContext;
+ String workloadContext;
+
+ public static class AAIServiceInstanceBuilder {
+ private String serviceInstanceName;
+ private String serviceType;
+ private String serviceRole;
+ private String orchestrationStatus;
+ private String modelInvariantUuid;
+ private String modelVersionId;
+ private String environmentContext;
+ private String workloadContext;
+
+ public AAIServiceInstanceBuilder setServiceInstanceName(String serviceInstanceName) {
+ this.serviceInstanceName = serviceInstanceName;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setServiceRole(String serviceRole) {
+ this.serviceRole = serviceRole;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setOrchestrationStatus(String orchestrationStatus) {
+ this.orchestrationStatus = orchestrationStatus;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setModelInvariantUuid(String modelInvariantUuid) {
+ this.modelInvariantUuid = modelInvariantUuid;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setEnvironmentContext(String environmentContext) {
+ this.environmentContext = environmentContext;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setWorkloadContext(String workloadContext) {
+ this.workloadContext = workloadContext;
+ return this;
+ }
+
+ public AAIServiceInstance createAAIServiceInstance() {
+ return new AAIServiceInstance(this);
+ }
+ }
+
+ public AAIServiceInstance(AAIServiceInstanceBuilder aaiServiceInstanceBuilder) {
+ this.serviceInstanceName = aaiServiceInstanceBuilder.serviceInstanceName;
+ this.serviceType = aaiServiceInstanceBuilder.serviceType;
+ this.serviceRole = aaiServiceInstanceBuilder.serviceRole;
+ this.orchestrationStatus = aaiServiceInstanceBuilder.orchestrationStatus;
+ this.modelInvariantUuid = aaiServiceInstanceBuilder.modelInvariantUuid;
+ this.modelVersionId = aaiServiceInstanceBuilder.modelVersionId;
+ this.environmentContext = aaiServiceInstanceBuilder.environmentContext;
+ this.workloadContext = aaiServiceInstanceBuilder.workloadContext;
+ }
+
+ public String getServiceInstanceName() {
+ return serviceInstanceName;
+ }
+
+ public void setServiceInstanceName(String serviceInstanceName) {
+ this.serviceInstanceName = serviceInstanceName;
+ }
+
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ public String getServiceRole() {
+ return serviceRole;
+ }
+
+ public void setServiceRole(String serviceRole) {
+ this.serviceRole = serviceRole;
+ }
+
+ public String getOrchestrationStatus() {
+ return orchestrationStatus;
+ }
+
+ public void setOrchestrationStatus(String orchestrationStatus) {
+ this.orchestrationStatus = orchestrationStatus;
+ }
+
+ public String getModelInvariantUuid() {
+ return modelInvariantUuid;
+ }
+
+ public void setModelInvariantUuid(String modelInvariantUuid) {
+ this.modelInvariantUuid = modelInvariantUuid;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getEnvironmentContext() {
+ return environmentContext;
+ }
+
+ public void setEnvironmentContext(String environmentContext) {
+ this.environmentContext = environmentContext;
+ }
+
+ public String getWorkloadContext() {
+ return workloadContext;
+ }
+
+ public void setWorkloadContext(String workloadContext) {
+ this.workloadContext = workloadContext;
+ }
+
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAICreateResources.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAICreateResources.java
index 0c519ef29f..bbca10be0f 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAICreateResources.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAICreateResources.java
@@ -25,7 +25,6 @@ package org.onap.so.bpmn.infrastructure.aai.groovyflows;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
-
import org.onap.aai.domain.yang.OwningEntities;
import org.onap.aai.domain.yang.OwningEntity;
import org.onap.so.client.aai.AAIObjectPlurals;
@@ -37,85 +36,88 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AAICreateResources {
-
- private static final Logger logger = LoggerFactory.getLogger(AAICreateResources.class);
-
- public void createAAIProject (String projectName, String serviceInstance){
- AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName);
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.createIfNotExists(projectURI, Optional.empty()).connect(projectURI, serviceInstanceURI);
-
- }
-
- public void createAAIOwningEntity(String owningEntityId, String owningEntityName,String serviceInstance){
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createNodesUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
- Map hashMap= new HashMap<>();
- hashMap.put("owning-entity-name", owningEntityName);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.createIfNotExists(owningEntityURI, Optional.of(hashMap)).connect(owningEntityURI, serviceInstanceURI);
- }
-
- public boolean existsOwningEntity(String owningEntityId){
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- return aaiRC.exists(owningEntityURI);
- }
-
- protected OwningEntities getOwningEntityName(String owningEntityName){
-
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- return aaiRC.get(OwningEntities.class,
- AAIUriFactory
- .createResourceUri(AAIObjectPlurals.OWNING_ENTITY)
- .queryParam("owning-entity-name", owningEntityName))
- .orElseGet(() -> {
- logger.debug("No Owning Entity matched by name");
- return null;
- });
-
- }
-
- public Optional getOwningEntityNames(String owningEntityName) throws Exception{
- OwningEntity owningEntity = null;
- OwningEntities owningEntities = null;
- owningEntities = getOwningEntityName(owningEntityName);
-
- if (owningEntities == null) {
- return Optional.empty();
- } else if (owningEntities.getOwningEntity().size() > 1) {
- throw new Exception("Multiple OwningEntities Returned");
- } else {
- owningEntity = owningEntities.getOwningEntity().get(0);
- }
- return Optional.of(owningEntity);
- }
-
- public void connectOwningEntityandServiceInstance (String owningEntityId, String serviceInstance){
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.connect(owningEntityURI, serviceInstanceURI);
- }
-
- public void createAAIPlatform(String platformName,String vnfId){
- AAIResourceUri platformURI = AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platformName);
- AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.createIfNotExists(platformURI, Optional.empty()).connect(platformURI, genericVnfURI);
- }
-
- public void createAAILineOfBusiness(String lineOfBusiness,String vnfId){
- AAIResourceUri lineOfBusinessURI = AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness);
- AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.createIfNotExists(lineOfBusinessURI, Optional.empty()).connect(lineOfBusinessURI, genericVnfURI);
- }
- public void createAAIServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId){
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustomerId,serviceType,serviceInstanceId);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.createIfNotExists(serviceInstanceURI, Optional.empty());
- }
-
+
+ private static final Logger logger = LoggerFactory.getLogger(AAICreateResources.class);
+
+ public void createAAIProject(String projectName, String serviceInstance) {
+ AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(projectURI, Optional.empty()).connect(projectURI, serviceInstanceURI);
+
+ }
+
+ public void createAAIOwningEntity(String owningEntityId, String owningEntityName, String serviceInstance) {
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createNodesUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ Map hashMap = new HashMap<>();
+ hashMap.put("owning-entity-name", owningEntityName);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(owningEntityURI, Optional.of(hashMap)).connect(owningEntityURI, serviceInstanceURI);
+ }
+
+ public boolean existsOwningEntity(String owningEntityId) {
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ return aaiRC.exists(owningEntityURI);
+ }
+
+ protected OwningEntities getOwningEntityName(String owningEntityName) {
+
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ return aaiRC.get(OwningEntities.class, AAIUriFactory.createResourceUri(AAIObjectPlurals.OWNING_ENTITY)
+ .queryParam("owning-entity-name", owningEntityName)).orElseGet(() -> {
+ logger.debug("No Owning Entity matched by name");
+ return null;
+ });
+
+ }
+
+ public Optional getOwningEntityNames(String owningEntityName) throws Exception {
+ OwningEntity owningEntity = null;
+ OwningEntities owningEntities = null;
+ owningEntities = getOwningEntityName(owningEntityName);
+
+ if (owningEntities == null) {
+ return Optional.empty();
+ } else if (owningEntities.getOwningEntity().size() > 1) {
+ throw new Exception("Multiple OwningEntities Returned");
+ } else {
+ owningEntity = owningEntities.getOwningEntity().get(0);
+ }
+ return Optional.of(owningEntity);
+ }
+
+ public void connectOwningEntityandServiceInstance(String owningEntityId, String serviceInstance) {
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.connect(owningEntityURI, serviceInstanceURI);
+ }
+
+ public void createAAIPlatform(String platformName, String vnfId) {
+ AAIResourceUri platformURI = AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platformName);
+ AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(platformURI, Optional.empty()).connect(platformURI, genericVnfURI);
+ }
+
+ public void createAAILineOfBusiness(String lineOfBusiness, String vnfId) {
+ AAIResourceUri lineOfBusinessURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness);
+ AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(lineOfBusinessURI, Optional.empty()).connect(lineOfBusinessURI, genericVnfURI);
+ }
+
+ public void createAAIServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId) {
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
+ globalCustomerId, serviceType, serviceInstanceId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(serviceInstanceURI, Optional.empty());
+ }
+
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIDeleteServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIDeleteServiceInstance.java
index 495c77255d..fb95ae3993 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIDeleteServiceInstance.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIDeleteServiceInstance.java
@@ -28,22 +28,24 @@ import org.onap.so.client.aai.AAIResourcesClient;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
-public class AAIDeleteServiceInstance implements JavaDelegate{
+public class AAIDeleteServiceInstance implements JavaDelegate {
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil();
+
+ public void execute(DelegateExecution execution) throws Exception {
+ try {
+ String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.delete(serviceInstanceURI);
+ execution.setVariable("GENDS_SuccessIndicator", true);
+ } catch (Exception ex) {
+ String msg = "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI."
+ + ex.getMessage();
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
+ }
+
+ }
- ExceptionUtil exceptionUtil = new ExceptionUtil();
- public void execute(DelegateExecution execution) throws Exception {
- try{
- String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
- serviceInstanceId);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.delete(serviceInstanceURI);
- execution.setVariable("GENDS_SuccessIndicator",true);
- } catch(Exception ex){
- String msg = "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI." + ex.getMessage();
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
- }
-
- }
-
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIServiceInstance.java
index 805ece9de8..2d69351744 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIServiceInstance.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIServiceInstance.java
@@ -21,74 +21,91 @@
package org.onap.so.bpmn.infrastructure.aai.groovyflows;
public class AAIServiceInstance {
- String serviceInstanceName;
- String serviceType;
- String serviceRole;
- String orchestrationStatus;
- String modelInvariantUuid;
- String modelVersionId;
- String environmentContext;
- String workloadContext;
- public AAIServiceInstance(String serviceInstanceName, String serviceType, String serviceRole,
- String orchestrationStatus, String modelInvariantUuid, String modelVersionId, String environmentContext,
- String workloadContext) {
- this.serviceInstanceName = serviceInstanceName;
- this.serviceType = serviceType;
- this.serviceRole = serviceRole;
- this.orchestrationStatus = orchestrationStatus;
- this.modelInvariantUuid = modelInvariantUuid;
- this.modelVersionId = modelVersionId;
- this.environmentContext = environmentContext;
- this.workloadContext = workloadContext;
- }
- public String getServiceInstanceName() {
- return serviceInstanceName;
- }
- public void setServiceInstanceName(String serviceInstanceName) {
- this.serviceInstanceName = serviceInstanceName;
- }
- public String getServiceType() {
- return serviceType;
- }
- public void setServiceType(String serviceType) {
- this.serviceType = serviceType;
- }
- public String getServiceRole() {
- return serviceRole;
- }
- public void setServiceRole(String serviceRole) {
- this.serviceRole = serviceRole;
- }
- public String getOrchestrationStatus() {
- return orchestrationStatus;
- }
- public void setOrchestrationStatus(String orchestrationStatus) {
- this.orchestrationStatus = orchestrationStatus;
- }
- public String getModelInvariantUuid() {
- return modelInvariantUuid;
- }
- public void setModelInvariantUuid(String modelInvariantUuid) {
- this.modelInvariantUuid = modelInvariantUuid;
- }
- public String getModelVersionId() {
- return modelVersionId;
- }
- public void setModelVersionId(String modelVersionId) {
- this.modelVersionId = modelVersionId;
- }
- public String getEnvironmentContext() {
- return environmentContext;
- }
- public void setEnvironmentContext(String environmentContext) {
- this.environmentContext = environmentContext;
- }
- public String getWorkloadContext() {
- return workloadContext;
- }
- public void setWorkloadContext(String workloadContext) {
- this.workloadContext = workloadContext;
- }
-
+ String serviceInstanceName;
+ String serviceType;
+ String serviceRole;
+ String orchestrationStatus;
+ String modelInvariantUuid;
+ String modelVersionId;
+ String environmentContext;
+ String workloadContext;
+
+ public AAIServiceInstance(String serviceInstanceName, String serviceType, String serviceRole,
+ String orchestrationStatus, String modelInvariantUuid, String modelVersionId, String environmentContext,
+ String workloadContext) {
+ this.serviceInstanceName = serviceInstanceName;
+ this.serviceType = serviceType;
+ this.serviceRole = serviceRole;
+ this.orchestrationStatus = orchestrationStatus;
+ this.modelInvariantUuid = modelInvariantUuid;
+ this.modelVersionId = modelVersionId;
+ this.environmentContext = environmentContext;
+ this.workloadContext = workloadContext;
+ }
+
+ public String getServiceInstanceName() {
+ return serviceInstanceName;
+ }
+
+ public void setServiceInstanceName(String serviceInstanceName) {
+ this.serviceInstanceName = serviceInstanceName;
+ }
+
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ public String getServiceRole() {
+ return serviceRole;
+ }
+
+ public void setServiceRole(String serviceRole) {
+ this.serviceRole = serviceRole;
+ }
+
+ public String getOrchestrationStatus() {
+ return orchestrationStatus;
+ }
+
+ public void setOrchestrationStatus(String orchestrationStatus) {
+ this.orchestrationStatus = orchestrationStatus;
+ }
+
+ public String getModelInvariantUuid() {
+ return modelInvariantUuid;
+ }
+
+ public void setModelInvariantUuid(String modelInvariantUuid) {
+ this.modelInvariantUuid = modelInvariantUuid;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getEnvironmentContext() {
+ return environmentContext;
+ }
+
+ public void setEnvironmentContext(String environmentContext) {
+ this.environmentContext = environmentContext;
+ }
+
+ public String getWorkloadContext() {
+ return workloadContext;
+ }
+
+ public void setWorkloadContext(String workloadContext) {
+ this.workloadContext = workloadContext;
+ }
+
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGenerator.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGenerator.java
index 3b443cbaf2..55387d6a3d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGenerator.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGenerator.java
@@ -27,14 +27,15 @@ import org.springframework.stereotype.Component;
@Component
public class AAIObjectInstanceNameGenerator {
- public String generateInstanceGroupName(InstanceGroup instanceGroup, GenericVnf vnf) {
- if(vnf.getVnfName() != null && instanceGroup.getModelInfoInstanceGroup().getFunction() != null) {
- return vnf.getVnfName() + "_" + instanceGroup.getModelInfoInstanceGroup().getFunction();
- } else {
- throw new IllegalArgumentException("Cannot generate instance group name because either one or both fields are null: "
- + " Vnf Instance Name: " + vnf.getVnfName()
- + ", Instance Group Function: " + instanceGroup.getModelInfoInstanceGroup().getFunction());
- }
- }
-
+ public String generateInstanceGroupName(InstanceGroup instanceGroup, GenericVnf vnf) {
+ if (vnf.getVnfName() != null && instanceGroup.getModelInfoInstanceGroup().getFunction() != null) {
+ return vnf.getVnfName() + "_" + instanceGroup.getModelInfoInstanceGroup().getFunction();
+ } else {
+ throw new IllegalArgumentException(
+ "Cannot generate instance group name because either one or both fields are null: "
+ + " Vnf Instance Name: " + vnf.getVnfName() + ", Instance Group Function: "
+ + instanceGroup.getModelInfoInstanceGroup().getFunction());
+ }
+ }
+
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java
index e0fa41b7a1..493340c9ef 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java
@@ -22,9 +22,7 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_PNF;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
-
import java.io.IOException;
-
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.onap.so.bpmn.common.scripts.ExceptionUtil;
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java
index 9b60a05e98..d67e6ef0db 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java
@@ -1,20 +1,15 @@
/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * Foundation. ================================================================================ 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.
+ * 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.
*
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
*/
package org.onap.so.bpmn.infrastructure.pnf.delegate;
@@ -26,7 +21,6 @@ import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableName
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_INSTANCE_NAME;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_MODEL_INFO;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SKIP_POST_INSTANTIATION_CONFIGURATION;
-
import java.util.List;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
@@ -50,7 +44,7 @@ public class ConfigCheckerDelegate implements JavaDelegate {
private Logger logger = LoggerFactory.getLogger(ConfigCheckerDelegate.class);
- //ERROR CODE for variable not found in the delegation Context
+ // ERROR CODE for variable not found in the delegation Context
private static int ERROR_CODE = 601;
@Autowired
@@ -63,34 +57,33 @@ public class ConfigCheckerDelegate implements JavaDelegate {
public void execute(DelegateExecution delegateExecution) throws Exception {
logger.debug("Running execute block for activity id:{}, name:{}", delegateExecution.getCurrentActivityId(),
- delegateExecution.getCurrentActivityName());
+ delegateExecution.getCurrentActivityName());
if (delegateExecution.hasVariable(SERVICE_MODEL_INFO)) {
String serviceModelInfo = (String) delegateExecution.getVariable(SERVICE_MODEL_INFO);
String serviceModelUuid = JsonUtils.getJsonValue(serviceModelInfo, MODEL_UUID);
delegateExecution.setVariable(MODEL_UUID, serviceModelUuid);
- List pnfCustomizations = catalogDbClient
- .getPnfResourceCustomizationByModelUuid(serviceModelUuid);
+ List pnfCustomizations =
+ catalogDbClient.getPnfResourceCustomizationByModelUuid(serviceModelUuid);
if (pnfCustomizations != null && pnfCustomizations.size() >= 1) {
PnfResourceCustomization pnfResourceCustomization = pnfCustomizations.get(0);
boolean skipPostInstantiationConfiguration = pnfResourceCustomization.isSkipPostInstConf();
- delegateExecution
- .setVariable(SKIP_POST_INSTANTIATION_CONFIGURATION, skipPostInstantiationConfiguration);
+ delegateExecution.setVariable(SKIP_POST_INSTANTIATION_CONFIGURATION,
+ skipPostInstantiationConfiguration);
delegateExecution.setVariable(PRC_BLUEPRINT_NAME, pnfResourceCustomization.getBlueprintName());
delegateExecution.setVariable(PRC_BLUEPRINT_VERSION, pnfResourceCustomization.getBlueprintVersion());
- delegateExecution
- .setVariable(PRC_CUSTOMIZATION_UUID, pnfResourceCustomization.getModelCustomizationUUID());
+ delegateExecution.setVariable(PRC_CUSTOMIZATION_UUID,
+ pnfResourceCustomization.getModelCustomizationUUID());
delegateExecution.setVariable(PRC_INSTANCE_NAME, pnfResourceCustomization.getModelInstanceName());
} else {
- logger
- .warn("Unable to find the PNF resource customizations of model service UUID: {}", serviceModelUuid);
+ logger.warn("Unable to find the PNF resource customizations of model service UUID: {}",
+ serviceModelUuid);
exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE,
- "Unable to find the PNF resource customizations of model service UUID: " + serviceModelUuid);
+ "Unable to find the PNF resource customizations of model service UUID: " + serviceModelUuid);
}
} else {
logger.warn("Unable to find the parameter: {} in the execution context", SERVICE_MODEL_INFO);
- exceptionUtil
- .buildAndThrowWorkflowException(delegateExecution, ERROR_CODE,
+ exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE,
"Unable to find parameter " + SERVICE_MODEL_INFO);
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegate.java
index e56cb83119..cb06085ee8 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegate.java
@@ -24,7 +24,6 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
-
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.onap.aai.domain.yang.Pnf;
@@ -37,9 +36,7 @@ import org.springframework.stereotype.Component;
/**
* Implementation of "Create Pnf entry in AAI" task in CreateAndActivatePnfResource.bpmn
*
- * Inputs:
- * - pnfCorrelationId - String
- * - pnfUuid - String
+ * Inputs: - pnfCorrelationId - String - pnfUuid - String
*/
@Component
public class CreatePnfEntryInAaiDelegate implements JavaDelegate {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java
index a367bada02..6d73b61ab2 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java
@@ -51,8 +51,8 @@ public class CreateRelation implements JavaDelegate {
new ExceptionUtil().buildAndThrowWorkflowException(delegateExecution, 9999,
"An exception occurred when making service and pnf relation. Exception: " + e.getMessage());
}
- logger.debug("The relation has been made between service with id: {} and pnf with name: {}",
- serviceInstanceId, pnfName);
+ logger.debug("The relation has been made between service with id: {} and pnf with name: {}", serviceInstanceId,
+ pnfName);
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegate.java
index f5483e489e..852ca4fcef 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegate.java
@@ -21,7 +21,6 @@
package org.onap.so.bpmn.infrastructure.pnf.delegate;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
-
import java.util.UUID;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
@@ -35,7 +34,7 @@ public class GeneratePnfUuidDelegate implements JavaDelegate {
private static final Logger logger = LoggerFactory.getLogger(GeneratePnfUuidDelegate.class);
@Override
- public void execute(DelegateExecution delegateExecution){
+ public void execute(DelegateExecution delegateExecution) {
UUID uuid = UUID.randomUUID();
logger.debug("Generated UUID for pnf: {}, version: {}, variant: {}", uuid, uuid.version(), uuid.variant());
delegateExecution.setVariable(PNF_UUID, uuid.toString());
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
index 96455acb84..5cbd530a93 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
@@ -36,12 +36,8 @@ public class InformDmaapClient implements JavaDelegate {
public void execute(DelegateExecution execution) {
String pnfCorrelationId = (String) execution.getVariable(ExecutionVariableNames.PNF_CORRELATION_ID);
RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService();
- dmaapClient.registerForUpdate(pnfCorrelationId, () ->
- runtimeService
- .createMessageCorrelation("WorkflowMessage")
- .processInstanceBusinessKey(execution.getProcessBusinessKey())
- .correlateWithResult()
- );
+ dmaapClient.registerForUpdate(pnfCorrelationId, () -> runtimeService.createMessageCorrelation("WorkflowMessage")
+ .processInstanceBusinessKey(execution.getProcessBusinessKey()).correlateWithResult());
}
@Autowired
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java
index 1caadea0de..b52110ea82 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java
@@ -26,7 +26,6 @@ import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableName
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.TIMEOUT_FOR_NOTIFICATION;
-
import com.google.common.base.Strings;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
@@ -38,7 +37,8 @@ import org.springframework.stereotype.Component;
@Component
public class PnfCheckInputs implements JavaDelegate {
- public static final String UUID_REGEX = "(?i)^[0-9a-f]{8}-[0-9a-f]{4}-[1-5]{1}[0-9a-f]{3}-[89ab]{1}[0-9a-f]{3}-[0-9a-f]{12}$";
+ public static final String UUID_REGEX =
+ "(?i)^[0-9a-f]{8}-[0-9a-f]{4}-[1-5]{1}[0-9a-f]{3}-[89ab]{1}[0-9a-f]{3}-[0-9a-f]{12}$";
private String pnfEntryNotificationTimeout;
@@ -58,7 +58,8 @@ public class PnfCheckInputs implements JavaDelegate {
private void validatePnfCorrelationId(DelegateExecution execution) {
String pnfCorrelationId = (String) execution.getVariable(PNF_CORRELATION_ID);
if (Strings.isNullOrEmpty(pnfCorrelationId)) {
- new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, "pnfCorrelationId variable not defined");
+ new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999,
+ "pnfCorrelationId variable not defined");
}
}
@@ -83,7 +84,8 @@ public class PnfCheckInputs implements JavaDelegate {
private void validateServiceInstanceId(DelegateExecution execution) {
String serviceInstanceId = (String) execution.getVariable(SERVICE_INSTANCE_ID);
if (Strings.isNullOrEmpty(serviceInstanceId)) {
- new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, "serviceInstanceId variable not defined");
+ new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999,
+ "serviceInstanceId variable not defined");
}
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareCdsCallDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareCdsCallDelegate.java
index 49887af4be..c4c299d4b6 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareCdsCallDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareCdsCallDelegate.java
@@ -1,20 +1,15 @@
/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * Foundation. ================================================================================ 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.
+ * 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.
*
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
*/
package org.onap.so.bpmn.infrastructure.pnf.delegate;
@@ -24,7 +19,6 @@ import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableName
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_NAME;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_VERSION;
-
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.onap.so.client.cds.beans.AbstractCDSPropertiesBean;
@@ -50,7 +44,7 @@ public abstract class PrepareCdsCallDelegate implements JavaDelegate {
protected ExceptionBuilder exceptionUtil;
@Override
- public void execute(DelegateExecution delegateExecution){
+ public void execute(DelegateExecution delegateExecution) {
logger.debug("Running execute block for activity:{}", delegateExecution.getCurrentActivityId());
AbstractCDSPropertiesBean cdsPropertiesBean = new AbstractCDSPropertiesBean();
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegate.java
index 5bf167ea7a..dd2601f0d0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegate.java
@@ -1,20 +1,15 @@
/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * Foundation. ================================================================================ 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.
+ * 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.
*
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
*/
package org.onap.so.bpmn.infrastructure.pnf.delegate;
@@ -25,7 +20,6 @@ import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableName
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_CUSTOMIZATION_UUID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_INSTANCE_NAME;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
-
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.onap.so.client.cds.beans.AbstractCDSPropertiesBean;
@@ -48,7 +42,7 @@ public class PrepareConfigAssignDelegate extends PrepareCdsCallDelegate {
}
@Override
- protected String getRequestObject(final DelegateExecution delegateExecution){
+ protected String getRequestObject(final DelegateExecution delegateExecution) {
ConfigAssignPropertiesForPnf configAssignProperties = new ConfigAssignPropertiesForPnf();
configAssignProperties.setServiceInstanceId((String) delegateExecution.getVariable(SERVICE_INSTANCE_ID));
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigDeployDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigDeployDelegate.java
index 5fbed598e3..16f712fa66 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigDeployDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigDeployDelegate.java
@@ -1,20 +1,15 @@
/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * Foundation. ================================================================================ 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.
+ * 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.
*
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
*/
package org.onap.so.bpmn.infrastructure.pnf.delegate;
@@ -24,7 +19,6 @@ import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableName
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_CUSTOMIZATION_UUID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
-
import java.io.IOException;
import java.util.Optional;
import org.camunda.bpm.engine.delegate.DelegateExecution;
@@ -55,7 +49,7 @@ public class PrepareConfigDeployDelegate extends PrepareCdsCallDelegate {
}
@Override
- protected String getRequestObject(DelegateExecution delegateExecution){
+ protected String getRequestObject(DelegateExecution delegateExecution) {
ConfigDeployPropertiesForPnf configDeployProperties = new ConfigDeployPropertiesForPnf();
@@ -85,7 +79,8 @@ public class PrepareConfigDeployDelegate extends PrepareCdsCallDelegate {
return configDeployRequest.toString();
}
- private void setIpAddress(ConfigDeployPropertiesForPnf configDeployProperties, DelegateExecution delegateExecution) {
+ private void setIpAddress(ConfigDeployPropertiesForPnf configDeployProperties,
+ DelegateExecution delegateExecution) {
/**
* Retrieve PNF entry from AAI.
@@ -93,21 +88,23 @@ public class PrepareConfigDeployDelegate extends PrepareCdsCallDelegate {
try {
String pnfName = (String) delegateExecution.getVariable(PNF_CORRELATION_ID);
Optional pnfOptional = pnfManagement.getEntryFor(pnfName);
- if ( pnfOptional.isPresent()){
+ if (pnfOptional.isPresent()) {
Pnf pnf = pnfOptional.get();
/**
- * PRH patches the AAI with oam address.
- * Use ipaddress-v4-oam and ipaddress-v6-oam for the config deploy request.
+ * PRH patches the AAI with oam address. Use ipaddress-v4-oam and ipaddress-v6-oam for the config deploy
+ * request.
*/
configDeployProperties.setPnfIpV4Address(pnf.getIpaddressV4Oam());
configDeployProperties.setPnfIpV6Address(pnf.getIpaddressV6Oam());
} else {
- exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE, "AAI entry for PNF: " + pnfName + " does not exist");
+ exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE,
+ "AAI entry for PNF: " + pnfName + " does not exist");
}
} catch (IOException e) {
logger.warn(e.getMessage(), e);
- exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE, "Unable to fetch from AAI" + e.getMessage());
+ exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE,
+ "Unable to fetch from AAI" + e.getMessage());
}
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java
index fb5d04328f..7cb78a10e5 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java
@@ -41,9 +41,8 @@ public final class JsonUtilForPnfCorrelationId {
List list = new ArrayList<>();
Spliterator spliterator = array.spliterator();
spliterator.forEachRemaining(jsonElement -> {
- handleEscapedCharacters(jsonElement)
- .ifPresent(jsonObject -> getPnfCorrelationId(jsonObject)
- .ifPresent(pnfCorrelationId -> list.add(pnfCorrelationId)));
+ handleEscapedCharacters(jsonElement).ifPresent(jsonObject -> getPnfCorrelationId(jsonObject)
+ .ifPresent(pnfCorrelationId -> list.add(pnfCorrelationId)));
});
return list;
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
index 6f828f6cb0..3de0f38b70 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
@@ -60,12 +60,10 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
topicListenerDelayInSeconds = env.getProperty("pnf.dmaap.topicListenerDelayInSeconds", Integer.class);
executor = null;
getRequest = new HttpGet(UriBuilder.fromUri(env.getProperty("pnf.dmaap.uriPathPrefix"))
- .scheme(env.getProperty("pnf.dmaap.protocol"))
- .host(env.getProperty("pnf.dmaap.host"))
- .port(env.getProperty("pnf.dmaap.port", Integer.class))
- .path(env.getProperty("pnf.dmaap.topicName"))
- .path(env.getProperty("pnf.dmaap.consumerGroup"))
- .path(env.getProperty("pnf.dmaap.consumerId")).build());
+ .scheme(env.getProperty("pnf.dmaap.protocol")).host(env.getProperty("pnf.dmaap.host"))
+ .port(env.getProperty("pnf.dmaap.port", Integer.class)).path(env.getProperty("pnf.dmaap.topicName"))
+ .path(env.getProperty("pnf.dmaap.consumerGroup")).path(env.getProperty("pnf.dmaap.consumerId"))
+ .build());
}
@Override
@@ -92,8 +90,8 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
executor = new ScheduledThreadPoolExecutor(1);
executor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
executor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
- executor.scheduleWithFixedDelay(new DmaapTopicListenerThread(), 0,
- topicListenerDelayInSeconds, TimeUnit.SECONDS);
+ executor.scheduleWithFixedDelay(new DmaapTopicListenerThread(), 0, topicListenerDelayInSeconds,
+ TimeUnit.SECONDS);
dmaapThreadListenerIsRunning = true;
}
}
@@ -116,8 +114,7 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
getPnfCorrelationIdListFromResponse(response).forEach(this::informAboutPnfReadyIfPnfCorrelationIdFound);
} catch (IOException e) {
logger.error("Exception caught during sending rest request to dmaap for listening event topic", e);
- }
- finally {
+ } finally {
getRequest.reset();
}
}
@@ -136,7 +133,7 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
Runnable runnable = unregister(pnfCorrelationId);
if (runnable != null) {
logger.debug("dmaap listener gets pnf ready event for pnfCorrelationId: {}", pnfCorrelationId);
- //runnable.run();
+ // runnable.run();
runnable = null;
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagementImpl.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagementImpl.java
index 32ea357817..b1af8b1e0b 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagementImpl.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagementImpl.java
@@ -46,8 +46,8 @@ public class PnfManagementImpl implements PnfManagement {
@Override
public void createRelation(String serviceInstanceId, String pnfName) {
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
- serviceInstanceId);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
AAIResourceUri pnfUri = AAIUriFactory.createResourceUri(AAIObjectType.PNF, pnfName);
new AAIResourcesClient().connect(serviceInstanceURI, pnfUri);
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/properties/BPMNProperties.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/properties/BPMNProperties.java
index ee8743f846..8b2bb9a8de 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/properties/BPMNProperties.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/properties/BPMNProperties.java
@@ -22,22 +22,22 @@ package org.onap.so.bpmn.infrastructure.properties;
import java.util.Arrays;
import java.util.List;
import org.onap.so.bpmn.core.UrnPropertiesReader;
-
import org.onap.so.bpmn.core.UrnPropertiesReader;
public class BPMNProperties {
public static String getProperty(String key, String defaultValue) {
- String value = UrnPropertiesReader.getVariable(key);
- if (value == null) {
- return defaultValue;
- } else {
- return value;
- }
+ String value = UrnPropertiesReader.getVariable(key);
+ if (value == null) {
+ return defaultValue;
+ } else {
+ return value;
+ }
}
public static List getResourceSequenceProp(String input) {
- String resourceSequence = UrnPropertiesReader.getVariable("mso.workflow.custom."+ input + ".resource.sequence");
+ String resourceSequence =
+ UrnPropertiesReader.getVariable("mso.workflow.custom." + input + ".resource.sequence");
if (resourceSequence != null) {
return Arrays.asList(resourceSequence.split(","));
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java
index 292f6ef575..2995e24c00 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java
@@ -22,7 +22,6 @@ package org.onap.so.bpmn.infrastructure.vfcmodel;
-
/**
* NS Create Input Parameter For VFC Adapter
*
@@ -44,7 +43,6 @@ public class NSResourceInputParameter {
-
/**
* @return Returns the nsServiceName.
*/
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsOperationKey.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsOperationKey.java
index 81826a27eb..3e35952a9e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsOperationKey.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsOperationKey.java
@@ -21,8 +21,7 @@ package org.onap.so.bpmn.infrastructure.vfcmodel;
/**
- * The operation key object for NS
- *
+ * The operation key object for NS
*
*
*
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java
index 0d8f2fcbd7..ad388feffc 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java
@@ -37,7 +37,8 @@ public class NsParameters {
private List locationConstraints;
- private Map additionalParamForNs = new HashMap();
+ private Map additionalParamForNs = new HashMap();
+
/**
* @return Returns the locationConstraints.
*/
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/VimLocation.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/VimLocation.java
index 970fa43d9f..8b9295b44f 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/VimLocation.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/VimLocation.java
@@ -28,7 +28,7 @@ package org.onap.so.bpmn.infrastructure.vfcmodel;
*
*
* @author
- * @version ONAP Amsterdam Release 2017-10-18
+ * @version ONAP Amsterdam Release 2017-10-18
*/
public class VimLocation {
private String vimId;
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 9b878afb7c..896a8bd98c 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
@@ -73,549 +73,550 @@ import org.springframework.web.util.UriUtils;
public class ServicePluginFactory {
- // SOTN calculate route
- public static final String OOF_DEFAULT_ENDPOINT = "http://192.168.1.223:8443/oof/sotncalc";
-
- public static final String THIRD_SP_DEFAULT_ENDPOINT = "http://192.168.1.223:8443/sp/resourcemgr/querytps";
-
- public static final String INVENTORY_OSS_DEFAULT_ENDPOINT = "http://192.168.1.199:8443/oss/inventory";
-
- private static final int DEFAULT_TIME_OUT = 60000;
-
- static JsonUtils jsonUtil = new JsonUtils();
-
- private static Logger logger = LoggerFactory.getLogger(ServicePluginFactory.class);
-
- private static ServicePluginFactory instance;
-
-
- public static synchronized ServicePluginFactory getInstance() {
- if (null == instance) {
- instance = new ServicePluginFactory();
- }
- return instance;
- }
-
- private ServicePluginFactory() {
-
- }
-
- private String getInventoryOSSEndPoint(){
- return UrnPropertiesReader.getVariable("mso.service-plugin.inventory-oss-endpoint", INVENTORY_OSS_DEFAULT_ENDPOINT);
- }
-
- private String getThirdSPEndPoint(){
- return UrnPropertiesReader.getVariable("mso.service-plugin.third-sp-endpoint", THIRD_SP_DEFAULT_ENDPOINT);
- }
-
- private String getOOFCalcEndPoint(){
- return UrnPropertiesReader.getVariable("mso.service-plugin.oof-calc-endpoint", OOF_DEFAULT_ENDPOINT);
- }
-
- @SuppressWarnings("unchecked")
- public String doProcessSiteLocation(ServiceDecomposition serviceDecomposition, String uuiRequest) {
- if(!isNeedProcessSite(uuiRequest)) {
- return uuiRequest;
- }
-
- Map uuiObject = getJsonObject(uuiRequest, Map.class);
- if (uuiObject == null) {
- return uuiRequest;
- }
- Map serviceObject = (Map) uuiObject
- .getOrDefault("service", Collections.emptyMap());
- Map serviceParametersObject = (Map) serviceObject
- .getOrDefault("parameters", Collections.emptyMap());
- Map serviceRequestInputs = (Map) serviceParametersObject
- .getOrDefault("requestInputs", Collections.emptyMap());
- List