summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/CinderClientImpl.java21
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java6
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java76
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java61
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java4
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MulticloudQueryResponse.java2
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java4
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceRequest.java14
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/WebSecurityConfigImpl.java2
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java6
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy34
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilFactory.groovy2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy22
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy34
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy22
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java5
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java10
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java16
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/aaiL3NetworkInputWithSubnets.json10
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/l3NetworkExpectedWithSubnet.json8
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy24
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy20
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy10
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy32
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy40
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy20
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy10
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy12
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy16
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy64
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy26
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy22
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy28
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy14
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java17
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java4
-rw-r--r--cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java2
-rw-r--r--cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyRequest.java8
-rw-r--r--common/src/main/java/org/onap/so/utils/TargetEntities.java4
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Actions.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GenericStringConverter.java33
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java143
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheck.java84
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConfig.java83
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConverter.java22
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckResponse.java49
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckStatus.java (renamed from mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckStatus.java)4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckSubsystem.java40
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java116
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/SoSubsystems.java (renamed from mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java)6
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Subsystem.java5
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java182
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml30
61 files changed, 849 insertions, 724 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/CinderClientImpl.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/CinderClientImpl.java
index b0c2d9430a..71cdcf6078 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/CinderClientImpl.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/CinderClientImpl.java
@@ -22,7 +22,6 @@
package org.onap.so.openstack.utils;
import org.onap.so.cloud.authentication.KeystoneAuthHolder;
-import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
import org.onap.so.openstack.exceptions.MsoException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -42,7 +41,7 @@ public class CinderClientImpl extends MsoCommonUtils {
/**
* Gets the Cinder client.
*
- * @param cloudSite the cloud site
+ * @param cloudSiteId the cloud site
* @param tenantId the tenant id
* @return the glance client
* @throws MsoException the mso exception
@@ -62,15 +61,12 @@ public class CinderClientImpl extends MsoCommonUtils {
* @param cloudSiteId the cloud site id
* @param tenantId the tenant id
* @param limit limits the number of records returned
- * @param visibility visibility in the image in openstack
* @param marker the last viewed record
- * @param name the image names
* @return the list of images in openstack
- * @throws MsoCloudSiteNotFound the mso cloud site not found
* @throws CinderClientException the glance client exception
*/
public Volumes queryVolumes(String cloudSiteId, String tenantId, int limit, String marker)
- throws MsoCloudSiteNotFound, CinderClientException {
+ throws CinderClientException {
try {
Cinder cinderClient = getCinderClient(cloudSiteId, tenantId);
// list is set to false, otherwise an invalid URL is appended
@@ -78,22 +74,23 @@ public class CinderClientImpl extends MsoCommonUtils {
cinderClient.volumes().list(false).queryParam("limit", limit).queryParam("marker", marker);
return executeAndRecordOpenstackRequest(request, false);
} catch (MsoException e) {
- logger.error("Error building Cinder Client", e);
- throw new CinderClientException("Error building Cinder Client", e);
+ String errorMsg = "Error building Cinder Client";
+ logger.error(errorMsg, e);
+ throw new CinderClientException(errorMsg, e);
}
}
- public Volume queryVolume(String cloudSiteId, String tenantId, String volumeId)
- throws MsoCloudSiteNotFound, CinderClientException {
+ public Volume queryVolume(String cloudSiteId, String tenantId, String volumeId) throws CinderClientException {
try {
Cinder cinderClient = getCinderClient(cloudSiteId, tenantId);
// list is set to false, otherwise an invalid URL is appended
OpenStackRequest<Volume> request = cinderClient.volumes().show(volumeId);
return executeAndRecordOpenstackRequest(request, false);
} catch (MsoException e) {
- logger.error("Error building Cinder Client", e);
- throw new CinderClientException("Error building Cinder Client", e);
+ String errorMsg = "Error building Cinder Client";
+ logger.error(errorMsg, e);
+ throw new CinderClientException(errorMsg, e);
}
}
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java
index 8cacf8526a..468b771c07 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java
@@ -132,14 +132,14 @@ public class MsoHeatEnvironmentEntry {
}
public boolean hasResources() {
- if (this.resources != null && this.resources.size() > 0) {
+ if (this.resources != null && !this.resources.isEmpty()) {
return true;
}
return false;
}
public boolean hasParameters() {
- if (this.parameters != null && this.parameters.size() > 0) {
+ if (this.parameters != null && !this.parameters.isEmpty()) {
return true;
}
return false;
@@ -147,7 +147,7 @@ public class MsoHeatEnvironmentEntry {
public boolean containsParameter(String paramName) {
boolean contains = false;
- if (this.parameters == null || this.parameters.size() < 1) {
+ if (this.parameters == null || this.parameters.isEmpty()) {
return false;
}
if (this.parameters.contains(new MsoHeatEnvironmentParameter(paramName))) {
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
index 1d75892138..6565db7ebc 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
@@ -44,7 +44,6 @@ import org.onap.so.adapters.vdu.VduModelInfo;
import org.onap.so.adapters.vdu.VduPlugin;
import org.onap.so.adapters.vdu.VduStateType;
import org.onap.so.adapters.vdu.VduStatus;
-import org.onap.so.cloud.CloudConfig;
import org.onap.so.cloud.authentication.KeystoneAuthHolder;
import org.onap.so.db.catalog.beans.CloudIdentity;
import org.onap.so.db.catalog.beans.CloudSite;
@@ -108,10 +107,6 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
"{} Create Stack: Nested exception rolling back stack: {} ";
public static final String IN_PROGRESS = "in_progress";
- // Fetch cloud configuration each time (may be cached in CloudConfig class)
- @Autowired
- protected CloudConfig cloudConfig;
-
@Autowired
private Environment environment;
@@ -134,7 +129,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
protected static final String CREATE_POLL_INTERVAL_DEFAULT = "15";
private static final String DELETE_POLL_INTERVAL_DEFAULT = "15";
- private static final String pollingMultiplierDefault = "60";
+ private static final String POLLING_MULTIPLIER_DEFAULT = "60";
private static final ObjectMapper JSON_MAPPER = new ObjectMapper();
@@ -200,7 +195,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
* @param cloudOwner the cloud owner of the cloud site in which to create the stack
* @param tenantId The Openstack ID of the tenant in which to create the Stack
* @param stackName The name of the stack to create
- * @param vduModelInfo contains information about the vdu model (added for plugin adapter)
+ * @param vduModel contains information about the vdu model (added for plugin adapter)
* @param heatTemplate The Heat template
* @param stackInputs A map of key/value inputs
* @param pollForCompletion Indicator that polling should be handled in Java vs. in the client
@@ -287,42 +282,41 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
String cloudSiteId, String tenantId, CreateStackParam stackCreate) throws MsoException {
if (stack == null) {
throw new StackCreationException("Unknown Error in Stack Creation");
- } else {
- logger.info("Performing post processing backout: {} cleanUpKeyPair: {}, stack {}", backout, cleanUpKeyPair,
- stack);
- if (!CREATE_COMPLETE.equals(stack.getStackStatus())) {
- if (cleanUpKeyPair && !Strings.isNullOrEmpty(stack.getStackStatusReason())
- && isKeyPairFailure(stack.getStackStatusReason())) {
- return handleKeyPairConflict(cloudSiteId, tenantId, stackCreate, timeoutMinutes, backout, stack);
- }
- if (!backout) {
- logger.info("Status is not CREATE_COMPLETE, stack deletion suppressed");
- throw new StackCreationException("Stack rollback suppressed, stack not deleted");
- } else {
- logger.info("Status is not CREATE_COMPLETE, stack deletion will be executed");
- String errorMessage = "Stack Creation Failed Openstack Status: " + stack.getStackStatus()
- + " Status Reason: " + stack.getStackStatusReason();
- try {
- Stack deletedStack =
- handleUnknownCreateStackFailure(stack, timeoutMinutes, cloudSiteId, tenantId);
- errorMessage = errorMessage + " , Rollback of Stack Creation completed with status: "
- + deletedStack.getStackStatus() + " Status Reason: "
- + deletedStack.getStackStatusReason();
- } catch (MsoException e) {
- logger.error("Sync Error Deleting Stack during rollback", e);
- if (e instanceof StackRollbackException) {
- errorMessage = errorMessage + e.getMessage();
- } else {
- errorMessage = errorMessage + " , Rollback of Stack Creation failed with sync error: "
- + e.getMessage();
- }
- }
- throw new StackCreationException(errorMessage);
- }
+ }
+
+ logger.info("Performing post processing backout: {} cleanUpKeyPair: {}, stack {}", backout, cleanUpKeyPair,
+ stack);
+ if (!CREATE_COMPLETE.equals(stack.getStackStatus())) {
+ if (cleanUpKeyPair && !Strings.isNullOrEmpty(stack.getStackStatusReason())
+ && isKeyPairFailure(stack.getStackStatusReason())) {
+ return handleKeyPairConflict(cloudSiteId, tenantId, stackCreate, timeoutMinutes, backout, stack);
+ }
+ if (!backout) {
+ logger.info("Status is not CREATE_COMPLETE, stack deletion suppressed");
+ throw new StackCreationException("Stack rollback suppressed, stack not deleted");
} else {
- return stack;
+ logger.info("Status is not CREATE_COMPLETE, stack deletion will be executed");
+ String errorMessage = "Stack Creation Failed Openstack Status: " + stack.getStackStatus()
+ + " Status Reason: " + stack.getStackStatusReason();
+ try {
+ Stack deletedStack = handleUnknownCreateStackFailure(stack, timeoutMinutes, cloudSiteId, tenantId);
+ errorMessage = errorMessage + " , Rollback of Stack Creation completed with status: "
+ + deletedStack.getStackStatus() + " Status Reason: " + deletedStack.getStackStatusReason();
+ } catch (StackRollbackException se) {
+ logger.error("Sync Error Deleting Stack during rollback process", se);
+ errorMessage = errorMessage + se.getMessage();
+ } catch (MsoException e) {
+ logger.error("Sync Error Deleting Stack during rollback", e);
+
+ errorMessage =
+ errorMessage + " , Rollback of Stack Creation failed with sync error: " + e.getMessage();
+ }
+ throw new StackCreationException(errorMessage);
}
+ } else {
+ return stack;
}
+
}
protected Stack pollStackForStatus(int timeoutMinutes, Stack stack, String stackStatus, String cloudSiteId,
@@ -330,7 +324,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin {
int pollingFrequency =
Integer.parseInt(this.environment.getProperty(createPollIntervalProp, CREATE_POLL_INTERVAL_DEFAULT));
int pollingMultiplier =
- Integer.parseInt(this.environment.getProperty(pollingMultiplierProp, pollingMultiplierDefault));
+ Integer.parseInt(this.environment.getProperty(pollingMultiplierProp, POLLING_MULTIPLIER_DEFAULT));
int numberOfPollingAttempts = Math.floorDiv((timeoutMinutes * pollingMultiplier), pollingFrequency);
Heat heatClient = getHeatClient(cloudSiteId, tenantId);
Stack latestStack = null;
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
index 49ba336e3f..c75aa9a67e 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
@@ -22,10 +22,6 @@
package org.onap.so.openstack.utils;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.woorea.openstack.heat.model.CreateStackParam;
-import com.woorea.openstack.heat.model.Stack;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
@@ -52,7 +48,6 @@ import org.onap.so.logger.MessageEnum;
import org.onap.so.openstack.beans.HeatStatus;
import org.onap.so.openstack.beans.StackInfo;
import org.onap.so.openstack.exceptions.MsoAdapterException;
-import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
import org.onap.so.openstack.exceptions.MsoException;
import org.onap.so.openstack.exceptions.MsoOpenstackException;
import org.onap.so.openstack.mappers.StackInfoMapper;
@@ -62,7 +57,11 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableSet;
+import com.woorea.openstack.heat.model.CreateStackParam;
+import com.woorea.openstack.heat.model.Stack;
@Component
public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
@@ -299,7 +298,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
responseBody = getQueryBody((java.io.InputStream) response.getEntity());
if (responseBody != null) {
if (logger.isDebugEnabled()) {
- logger.debug("Multicloud Create Response Body: " + responseBody.toString());
+ logger.debug("Multicloud Create Response Body: {}", responseBody);
}
Stack workloadStack = getWorkloadStack(responseBody.getWorkloadStatusReason());
if (workloadStack != null && !responseBody.getWorkloadStatus().equals("GET_FAILED")
@@ -354,7 +353,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
}
}
if (workloadStack != null)
- logger.debug("Multicloud getWorkloadStack() returning Stack Object: {} ", workloadStack.toString());
+ logger.debug("Multicloud getWorkloadStack() returning Stack Object: {} ", workloadStack);
return workloadStack;
}
@@ -457,8 +456,8 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
Response response = multicloudClient.post(multicloudRequest);
if (response.getStatus() != Response.Status.ACCEPTED.getStatusCode()) {
if (logger.isDebugEnabled())
- logger.debug(
- "Multicloud AAI update request failed: " + response.getStatus() + response.getStatusInfo());
+ logger.debug("Multicloud AAI update request failed: {} {}", response.getStatus(),
+ response.getStatusInfo());
return;
}
@@ -470,14 +469,14 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
Integer.parseInt(this.environment.getProperty(createPollIntervalProp, CREATE_POLL_INTERVAL_DEFAULT));
int pollTimeout = (timeoutMinutes * 60) + updatePollInterval;
boolean updateTimedOut = false;
- logger.debug("updatePollInterval=" + updatePollInterval + ", pollTimeout=" + pollTimeout);
+ logger.debug("updatePollInterval={}, pollTimeout={}", updatePollInterval, pollTimeout);
StackInfo stackInfo = null;
while (true) {
try {
stackInfo = queryStack(cloudSiteId, cloudOwner, tenantId, workloadId);
if (logger.isDebugEnabled())
- logger.debug(stackInfo.getStatus() + " (" + workloadId + ")");
+ logger.debug("{} ({})", stackInfo.getStatus(), workloadId);
if (HeatStatus.UPDATING.equals(stackInfo.getStatus())) {
if (pollTimeout <= 0) {
@@ -494,7 +493,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
pollTimeout -= updatePollInterval;
if (logger.isDebugEnabled())
- logger.debug("pollTimeout remaining: " + pollTimeout);
+ logger.debug("pollTimeout remaining: {}", pollTimeout);
} else {
break;
}
@@ -508,15 +507,14 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
if (updateTimedOut) {
if (logger.isDebugEnabled())
logger.debug("Multicloud AAI update request failed: {} {}", response.getStatus(),
- response.getStatusInfo().toString());
+ response.getStatusInfo());
} else if (!HeatStatus.UPDATED.equals(stackInfo.getStatus())) {
if (logger.isDebugEnabled())
logger.debug("Multicloud AAI update request failed: {} {}", response.getStatus(),
- response.getStatusInfo().toString());
+ response.getStatusInfo());
} else {
if (logger.isDebugEnabled())
- logger.debug("Multicloud AAI update successful: {} {}", response.getStatus(),
- response.getStatusInfo().toString());
+ logger.debug("Multicloud AAI update successful: {} {}", response.getStatus(), response.getStatusInfo());
}
}
@@ -543,12 +541,12 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
int deletePollTimeout = pollTimeout;
boolean createTimedOut = false;
StringBuilder stackErrorStatusReason = new StringBuilder("");
- logger.debug("createPollInterval=" + createPollInterval + ", pollTimeout=" + pollTimeout);
+ logger.debug("createPollInterval={}, pollTimeout={} ", createPollInterval, pollTimeout);
while (true) {
try {
stackInfo = queryStack(cloudSiteId, cloudOwner, tenantId, instanceId);
- logger.debug(stackInfo.getStatus() + " (" + instanceId + ")");
+ logger.debug("{} ({})", stackInfo.getStatus(), instanceId);
if (HeatStatus.BUILDING.equals(stackInfo.getStatus())) {
// Stack creation is still running.
@@ -567,7 +565,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
sleep(createPollInterval * 1000L);
pollTimeout -= createPollInterval;
- logger.debug("pollTimeout remaining: " + pollTimeout);
+ logger.debug("pollTimeout remaining: {}", pollTimeout);
} else {
// save off the status & reason msg before we attempt delete
stackErrorStatusReason
@@ -596,7 +594,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
while (!deleted) {
try {
StackInfo queryInfo = queryStack(cloudSiteId, cloudOwner, tenantId, instanceId);
- logger.debug("Deleting " + instanceId + ", status: " + queryInfo.getStatus());
+ logger.debug("Deleting {}, status: {}", instanceId, queryInfo.getStatus());
if (HeatStatus.DELETING.equals(queryInfo.getStatus())) {
if (deletePollTimeout <= 0) {
logger.error(String.format("%s %s %s %s %s %s %s %s %d %s",
@@ -610,7 +608,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
deletePollTimeout -= deletePollInterval;
}
} else if (HeatStatus.NOTFOUND.equals(queryInfo.getStatus())) {
- logger.debug("DELETE_COMPLETE for " + instanceId);
+ logger.debug("DELETE_COMPLETE for {}", instanceId);
deleted = true;
continue;
} else {
@@ -664,7 +662,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
while (!deleted) {
try {
StackInfo queryInfo = queryStack(cloudSiteId, cloudOwner, tenantId, instanceId);
- logger.debug("Deleting " + instanceId + ", status: " + queryInfo.getStatus());
+ logger.debug("Deleting {}, status: {}", instanceId, queryInfo.getStatus());
if (HeatStatus.DELETING.equals(queryInfo.getStatus())) {
if (deletePollTimeout <= 0) {
logger.error(String.format("%s %s %s %s %s %s %s %s %d %s",
@@ -678,7 +676,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
deletePollTimeout -= deletePollInterval;
}
} else if (HeatStatus.NOTFOUND.equals(queryInfo.getStatus())) {
- logger.debug("DELETE_COMPLETE for " + instanceId);
+ logger.debug("DELETE_COMPLETE for {}", instanceId);
deleted = true;
continue;
} else {
@@ -730,7 +728,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
} else {
// Get initial status, since it will have been null after the create.
stackInfo = queryStack(cloudSiteId, cloudOwner, tenantId, instanceId);
- logger.debug("Multicloud stack query status is: " + stackInfo.getStatus());
+ logger.debug("Multicloud stack query status is: {}", stackInfo.getStatus());
}
return stackInfo;
}
@@ -769,7 +767,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
try {
return new ObjectMapper().readerFor(MulticloudCreateResponse.class).readValue(body);
} catch (Exception e) {
- logger.debug("Exception retrieving multicloud vfModule POST response body " + e);
+ logger.debug("Exception retrieving multicloud vfModule POST response body ", e);
}
return null;
}
@@ -786,7 +784,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
try {
return new ObjectMapper().readerFor(MulticloudQueryResponse.class).readValue(body);
} catch (Exception e) {
- logger.debug("Exception retrieving multicloud workload query response body " + e);
+ logger.debug("Exception retrieving multicloud workload query response body ", e);
}
return null;
}
@@ -828,14 +826,11 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
client.addAdditionalHeader("Project", tenantId);
}
} catch (MalformedURLException e) {
- logger.debug(
- String.format("Encountered malformed URL error getting multicloud rest client %s", e.getMessage()));
+ logger.debug("Encountered malformed URL error getting multicloud rest client ", e);
} catch (IllegalArgumentException e) {
- logger.debug(
- String.format("Encountered illegal argument getting multicloud rest client %s", e.getMessage()));
+ logger.debug("Encountered illegal argument getting multicloud rest client ", e);
} catch (UriBuilderException e) {
- logger.debug(
- String.format("Encountered URI builder error getting multicloud rest client %s", e.getMessage()));
+ logger.debug("Encountered URI builder error getting multicloud rest client ", e);
}
return client;
}
@@ -989,7 +984,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
// There are lots of HeatStatus values, so this is a bit long...
HeatStatus heatStatus = stackInfo.getStatus();
String statusMessage = stackInfo.getStatusMessage();
- logger.debug("HeatStatus = " + heatStatus + " msg = " + statusMessage);
+ logger.debug("HeatStatus = {} msg = {}", heatStatus, statusMessage);
if (logger.isDebugEnabled()) {
logger.debug(String.format("Stack Status: %s", heatStatus.toString()));
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java
index 069c6c7c5b..44fc620b07 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java
@@ -130,13 +130,13 @@ public class MsoNeutronUtils extends MsoCommonUtils {
network.setAdminStateUp(true);
if (type == NetworkType.PROVIDER) {
- if (provider != null && vlans != null && vlans.size() > 0) {
+ if (provider != null && vlans != null && !vlans.isEmpty()) {
network.setProviderPhysicalNetwork(provider);
network.setProviderNetworkType("vlan");
network.setProviderSegmentationId(vlans.get(0));
}
} else if (type == NetworkType.MULTI_PROVIDER) {
- if (provider != null && vlans != null && vlans.size() > 0) {
+ if (provider != null && vlans != null && !vlans.isEmpty()) {
List<Segment> segments = new ArrayList<>(vlans.size());
for (int vlan : vlans) {
Segment segment = new Segment();
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MulticloudQueryResponse.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MulticloudQueryResponse.java
index ad37b39f30..c575304ade 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MulticloudQueryResponse.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MulticloudQueryResponse.java
@@ -40,7 +40,7 @@ public class MulticloudQueryResponse implements Serializable {
@JsonProperty("workload_status")
private String workloadStatus;
@JsonProperty("workload_status_reason")
- private JsonNode workloadStatusReason;
+ private transient JsonNode workloadStatusReason;
@JsonCreator
public MulticloudQueryResponse(@JsonProperty("template_type") String templateType,
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java
index e840d5affd..e68364eab8 100644
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java
+++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java
@@ -322,8 +322,8 @@ public class MsoHeatUtilsTest extends MsoHeatUtils {
CreateStackParam createStackParam = new CreateStackParam();
createStackParam.setStackName("stackName");
- doReturn(mockResources).when(heatUtils).queryStackResources(cloudSiteId, tenantId, "stackName", 2);
- doNothing().when(novaClient).deleteKeyPair(cloudSiteId, tenantId, "KeypairName");
+ // doReturn(mockResources).when(heatUtils).queryStackResources(cloudSiteId, tenantId, "stackName", 2);
+ // doNothing().when(novaClient).deleteKeyPair(cloudSiteId, tenantId, "KeypairName");
doReturn(null).when(heatUtils).handleUnknownCreateStackFailure(stack, 120, cloudSiteId, tenantId);
doReturn(createdStack).when(heatUtils).createStack(createStackParam, cloudSiteId, tenantId);
doReturn(createdStack).when(heatUtils).processCreateStack(cloudSiteId, tenantId, 120, true, createdStack,
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceRequest.java
index c9f42d1550..1b8372291d 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceRequest.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceRequest.java
@@ -59,20 +59,6 @@ public class SDNCServiceRequest extends SDNCRequestCommon implements Serializabl
// The SDNC service data specified by SDNC "agnostic" API
private String sdncServiceData;
- public SDNCServiceRequest() {}
-
- public SDNCServiceRequest(String bpNotificationUrl, String bpTimeout, String sdncRequestId, String sdncService,
- String sdncOperation, RequestInformation requestInformation, ServiceInformation serviceInformation,
- String sdncServiceDataType, String sndcServiceData) {
- super(bpNotificationUrl, bpTimeout, sdncRequestId);
- this.requestInformation = requestInformation;
- this.serviceInformation = serviceInformation;
- this.sdncService = sdncService;
- this.sdncOperation = sdncOperation;
- this.sdncServiceDataType = sdncServiceDataType;
- this.sdncServiceData = sndcServiceData;
- }
-
@JsonProperty("requestInformation")
@XmlElement(name = "requestInformation")
public RequestInformation getRequestInformation() {
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/WebSecurityConfigImpl.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/WebSecurityConfigImpl.java
index f45d5a0219..792002354b 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/WebSecurityConfigImpl.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/WebSecurityConfigImpl.java
@@ -40,7 +40,7 @@ public class WebSecurityConfigImpl extends WebSecurityConfig {
@Override
protected void configure(final HttpSecurity http) throws Exception {
- if (clientAuth.equalsIgnoreCase("need")) {
+ if (("need").equalsIgnoreCase(clientAuth)) {
http.csrf().disable().authorizeRequests().anyRequest().permitAll();
} else {
http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info").permitAll()
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java
index e048d4c567..0fc94c8bd6 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java
@@ -97,10 +97,8 @@ public class DeployActivitySpecs {
}
List<String> categoryList = new ArrayList<>();
for (ActivitySpecActivitySpecCategories activitySpecCat : activitySpecActivitySpecCategories) {
- if (activitySpecCat != null) {
- if (activitySpecCat.getActivitySpecCategories() != null) {
- categoryList.add(activitySpecCat.getActivitySpecCategories().getName());
- }
+ if (activitySpecCat != null && activitySpecCat.getActivitySpecCategories() != null) {
+ categoryList.add(activitySpecCat.getActivitySpecCategories().getName());
}
}
activitySpec.setCategoryList(categoryList);
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy
index 64567a349e..5525c2642b 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -40,11 +40,11 @@ class ExternalAPIUtil {
String Prefix="EXTAPI_"
- private static final Logger logger = LoggerFactory.getLogger( ExternalAPIUtil.class);
+ private static final Logger logger = LoggerFactory.getLogger( ExternalAPIUtil.class)
- private final HttpClientFactory httpClientFactory;
- private final MsoUtils utils;
- private final ExceptionUtil exceptionUtil;
+ private final HttpClientFactory httpClientFactory
+ private final MsoUtils utils
+ private final ExceptionUtil exceptionUtil
public static final String PostServiceOrderRequestsTemplate =
"{\n" +
@@ -107,22 +107,22 @@ class ExternalAPIUtil {
// }
public String setTemplate(String template, Map<String, String> valueMap) {
- logger.debug("ExternalAPIUtil setTemplate", true);
- StringBuffer result = new StringBuffer();
+ logger.debug("ExternalAPIUtil setTemplate", true)
+ StringBuffer result = new StringBuffer()
- String pattern = "<.*>";
- Pattern r = Pattern.compile(pattern);
- Matcher m = r.matcher(template);
+ String pattern = "<.*>"
+ Pattern r = Pattern.compile(pattern)
+ Matcher m = r.matcher(template)
- logger.debug("ExternalAPIUtil template:" + template, true);
+ logger.debug("ExternalAPIUtil template:" + template, true)
while (m.find()) {
- String key = template.substring(m.start() + 1, m.end() - 1);
- logger.debug("ExternalAPIUtil key:" + key + " contains key? " + valueMap.containsKey(key), true);
- m.appendReplacement(result, valueMap.getOrDefault(key, "\"TBD\""));
+ String key = template.substring(m.start() + 1, m.end() - 1)
+ logger.debug("ExternalAPIUtil key:" + key + " contains key? " + valueMap.containsKey(key), true)
+ m.appendReplacement(result, valueMap.getOrDefault(key, "\"TBD\""))
}
- m.appendTail(result);
- logger.debug("ExternalAPIUtil return:" + result.toString(), true);
- return result.toString();
+ m.appendTail(result)
+ logger.debug("ExternalAPIUtil return:" + result.toString(), true)
+ return result.toString()
}
/**
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilFactory.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilFactory.groovy
index e7f46464ee..549267eec1 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilFactory.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilFactory.groovy
@@ -4,7 +4,7 @@
* ================================================================================
* Copyright (C) 2018 Nokia.
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy
index f013fa8698..db39358ccd 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -22,9 +22,9 @@
package org.onap.so.bpmn.common.scripts
-import org.onap.so.logger.LoggingAnchor;
+import org.onap.so.logger.LoggingAnchor
import org.onap.so.bpmn.core.UrnPropertiesReader
-import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.ErrorCode
import java.text.SimpleDateFormat
@@ -39,7 +39,7 @@ import static org.apache.commons.lang3.StringUtils.*
// SDNC Adapter Request/Response processing
public class SDNCAdapter extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( SDNCAdapter.class);
+ private static final Logger logger = LoggerFactory.getLogger( SDNCAdapter.class)
def Prefix="SDNCA_"
@@ -77,7 +77,7 @@ public class SDNCAdapter extends AbstractServiceTaskProcessor {
} catch (IOException ex) {
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
"Unable to encode username password string", "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
}
// TODO Use variables instead of passing xml request - Huh?
@@ -238,9 +238,9 @@ public class SDNCAdapter extends AbstractServiceTaskProcessor {
def sdnccallbackreq=execution.getVariable("sdncAdapterCallbackRequest")
logger.debug("sdncAdapterCallbackRequest :" + sdnccallbackreq)
if (sdnccallbackreq==null){
- execution.setVariable("callbackResponseReceived",false);
+ execution.setVariable("callbackResponseReceived",false)
}else{
- execution.setVariable("callbackResponseReceived",true);
+ execution.setVariable("callbackResponseReceived",true)
}
}
@@ -303,10 +303,10 @@ public class SDNCAdapter extends AbstractServiceTaskProcessor {
}
public String generateCurrentTimeInUtc(){
- final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
- sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
- final String utcTime = sdf.format(new Date());
- return utcTime;
+ final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
+ sdf.setTimeZone(TimeZone.getTimeZone("UTC"))
+ final String utcTime = sdf.format(new Date())
+ return utcTime
}
public void toggleSuccessIndicator(DelegateExecution execution){
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy
index 449f4e3222..c30d807bf3 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -53,7 +53,7 @@ import org.onap.so.utils.TargetEntity
class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( SDNCAdapterRestV1.class);
+ private static final Logger logger = LoggerFactory.getLogger( SDNCAdapterRestV1.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -88,7 +88,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': mso:adapters:sdnc:rest:endpoint URN mapping is not defined'
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -109,7 +109,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no sdncRequestId in ' + requestType
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -124,7 +124,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no bpNotificationUrl in ' + requestType
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -141,7 +141,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': Unsupported request type: ' + requestType
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -157,7 +157,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
logger.debug(getProcessKey(execution) + ": mso:adapters:po:auth URN mapping is not defined")
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
getProcessKey(execution) + ": mso:adapters:po:auth URN mapping is not defined", "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
} else {
try {
def encodedString = utils.getBasicAuth(basicAuthValue, UrnPropertiesReader.getVariable("mso.msoKey", execution))
@@ -166,7 +166,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
logger.debug(getProcessKey(execution) + ": Unable to encode BasicAuth credentials for SDNCAdapter")
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
getProcessKey(execution) + ": Unable to encode BasicAuth credentials for SDNCAdapter",
- "BPMN", ErrorCode.UnknownError.getValue(), ex);
+ "BPMN", ErrorCode.UnknownError.getValue(), ex)
}
}
@@ -176,7 +176,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String timeout = jsonUtil.getJsonValue(request, requestType + ".bpTimeout")
// in addition to null/empty, also need to verify that the timer value is a valid duration "P[n]T[n]H|M|S"
- String timerRegex = "PT[0-9]+[HMS]";
+ String timerRegex = "PT[0-9]+[HMS]"
if (timeout == null || timeout.isEmpty() || !timeout.matches(timerRegex)) {
logger.debug(getProcessKey(execution) + ': preProcessRequest(): null/empty/invalid bpTimeout value. Using "mso.adapters.sdnc.timeout"')
timeout = UrnPropertiesReader.getVariable("mso.adapters.sdnc.timeout", execution)
@@ -197,7 +197,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Caught exception in ' + method + ": " + e
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
}
@@ -221,7 +221,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String sdncAdapterRequest = execution.getVariable(prefix + 'sdncAdapterRequest')
logger.debug("SDNC Rest Request is: " + sdncAdapterRequest)
- URL url = new URL(sdncAdapterUrl);
+ URL url = new URL(sdncAdapterUrl)
HttpClient httpClient = new HttpClientFactory().newJsonClient(url, TargetEntity.SDNC_ADAPTER)
httpClient.addAdditionalHeader("X-ONAP-RequestID", execution.getVariable("mso-request-id"))
@@ -245,7 +245,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Unsupported HTTP method "' + sdncAdapterMethod + '" in ' + method + ": " + e
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -259,7 +259,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Caught exception in ' + method + ": " + e
logger.debug(msg, e)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
}
@@ -330,7 +330,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
}
// Note: the mapping function handles a null or empty responseCode
- int mappedResponseCode = Integer.parseInt(exceptionUtil.MapSDNCResponseCodeToErrorCode(responseCode));
+ int mappedResponseCode = Integer.parseInt(exceptionUtil.MapSDNCResponseCodeToErrorCode(responseCode))
exceptionUtil.buildWorkflowException(execution, mappedResponseCode, "Received " + responseType +
" from SDNCAdapter:" + info)
} catch (Exception e) {
@@ -370,7 +370,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Caught exception in ' + method + ": " + e
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
}
@@ -396,12 +396,12 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Caught exception in ' + method + ": " + e
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
}
public Logger getLogger() {
- return logger;
+ return logger
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy
index 62c7bb5adf..ba5145d19b 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory
* any non-final response received from SDNC.
*/
class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
- private static final Logger logger = LoggerFactory.getLogger( SDNCAdapterRestV2.class);
+ private static final Logger logger = LoggerFactory.getLogger( SDNCAdapterRestV2.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -87,7 +87,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
String msg = getProcessKey(execution) + ': mso:adapters:sdnc:rest:endpoint URN mapping is not defined'
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -108,7 +108,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
String msg = getProcessKey(execution) + ': no sdncRequestId in ' + requestType
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -123,7 +123,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
String msg = getProcessKey(execution) + ': no bpNotificationUrl in ' + requestType
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -134,7 +134,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
String msg = getProcessKey(execution) + ': Unsupported request type: ' + requestType
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -153,7 +153,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
logger.debug(getProcessKey(execution) + ": mso:adapters:po:auth URN mapping is not defined")
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
getProcessKey(execution) + ": mso:adapters:po:auth URN mapping is not defined", "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
} else {
try {
def encodedString = utils.getBasicAuth(basicAuthValue, UrnPropertiesReader.getVariable("mso.msoKey", execution))
@@ -162,7 +162,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
logger.debug(getProcessKey(execution) + ": Unable to encode BasicAuth credentials for SDNCAdapter")
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
getProcessKey(execution) + ": Unable to encode BasicAuth credentials for SDNCAdapter",
- "BPMN", ErrorCode.UnknownError.getValue(), ex);
+ "BPMN", ErrorCode.UnknownError.getValue(), ex)
}
}
@@ -172,7 +172,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
String timeout = jsonUtil.getJsonValue(request, requestType + ".bpTimeout")
// in addition to null/empty, also need to verify that the timer value is a valid duration "P[n]T[n]H|M|S"
- String timerRegex = "PT[0-9]+[HMS]";
+ String timerRegex = "PT[0-9]+[HMS]"
if (timeout == null || timeout.isEmpty() || !timeout.matches(timerRegex)) {
logger.debug(getProcessKey(execution) + ': preProcessRequest(): null/empty/invalid bpTimeout value. Using "mso.adapters.sdnc.timeout"')
timeout = UrnPropertiesReader.getVariable("mso.adapters.sdnc.timeout", execution)
@@ -193,7 +193,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
String msg = 'Caught exception in ' + method + ": " + e
logger.debug(msg)
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
- ErrorCode.UnknownError.getValue());
+ ErrorCode.UnknownError.getValue())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
}
@@ -297,6 +297,6 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
}
public Logger getLogger() {
- return logger;
+ return logger
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java
index b1173bbf95..cc3ec52c7a 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java
@@ -108,6 +108,11 @@ public class InstanceResourceList {
sequencedResourceList.add(vnfResource);
}
+ // check if the resource contains vf-module
+ if (vnfResource != null && vnfResource.getVfModules() != null) {
+ sequencedResourceList.addAll(vnfResource.getVfModules());
+ }
+
return sequencedResourceList;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java
index a5eb9d86a7..96a6ab7bd2 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/AggregateRoute.java
@@ -36,8 +36,6 @@ public class AggregateRoute implements Serializable, ShallowCopy<AggregateRoute>
@Id
@JsonProperty("route-id")
private String routeId;
- @JsonProperty("route-name")
- private String routeName;
@JsonProperty("network-start-address")
private String networkStartAddress;
@JsonProperty("cidr-mask")
@@ -54,14 +52,6 @@ public class AggregateRoute implements Serializable, ShallowCopy<AggregateRoute>
this.routeId = routeId;
}
- public String getRouteName() {
- return routeName;
- }
-
- public void setRouteName(String routeName) {
- this.routeName = routeName;
- }
-
public String getNetworkStartAddress() {
return networkStartAddress;
}
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 573925ff3f..ea48c78dc0 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
@@ -30,6 +30,7 @@ import java.util.Map;
import java.util.Optional;
import org.modelmapper.ModelMapper;
import org.modelmapper.convention.MatchingStrategies;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.AggregateRoute;
import org.onap.so.bpmn.servicedecomposition.bbobjects.AllottedResource;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection;
@@ -131,6 +132,10 @@ public class BBInputSetupMapperLayer {
return modelMapper.map(aaiSegmentationAssignment, SegmentationAssignment.class);
}
+ protected AggregateRoute mapAAIAggregateRoute(org.onap.aai.domain.yang.AggregateRoute aaiAggregateRoute) {
+ return modelMapper.map(aaiAggregateRoute, AggregateRoute.class);
+ }
+
protected CtagAssignment mapAAICtagAssignment(org.onap.aai.domain.yang.CtagAssignment aaiCtagAssignment) {
return modelMapper.map(aaiCtagAssignment, CtagAssignment.class);
}
@@ -262,10 +267,21 @@ public class BBInputSetupMapperLayer {
mapAllSubnetsIntoL3Network(aaiL3Network, network);
mapAllCtagAssignmentsIntoL3Network(aaiL3Network, network);
mapAllSegmentationAssignmentsIntoL3Network(aaiL3Network, network);
+ mapAllAggregateRoutesIntoL3Network(aaiL3Network, network);
network.setOrchestrationStatus(this.mapOrchestrationStatusFromAAI(aaiL3Network.getOrchestrationStatus()));
return network;
}
+ protected void mapAllAggregateRoutesIntoL3Network(org.onap.aai.domain.yang.L3Network aaiL3Network,
+ L3Network network) {
+ if (aaiL3Network.getAggregateRoutes() != null) {
+ for (org.onap.aai.domain.yang.AggregateRoute aaiAggregateRoute : aaiL3Network.getAggregateRoutes()
+ .getAggregateRoute()) {
+ network.getAggregateRoutes().add(mapAAIAggregateRoute(aaiAggregateRoute));
+ }
+ }
+ }
+
protected void mapAllSegmentationAssignmentsIntoL3Network(org.onap.aai.domain.yang.L3Network aaiL3Network,
L3Network network) {
if (aaiL3Network.getSegmentationAssignments() != null) {
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/aaiL3NetworkInputWithSubnets.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/aaiL3NetworkInputWithSubnets.json
index 418396f290..9b32a4c446 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/aaiL3NetworkInputWithSubnets.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/aaiL3NetworkInputWithSubnets.json
@@ -69,5 +69,15 @@
}
]
},
+ "aggregateRoutes": {
+ "aggregateRoute": [
+ {
+ "routeId": "routeId",
+ "networkStartAddress": "10.80.12.0",
+ "cidrMask": "23",
+ "ipVersion": "4"
+ }
+ ]
+ },
"relationshipList": null
} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/l3NetworkExpectedWithSubnet.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/l3NetworkExpectedWithSubnet.json
index ccefe195c9..f65fe17a2e 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/l3NetworkExpectedWithSubnet.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/l3NetworkExpectedWithSubnet.json
@@ -52,5 +52,13 @@
"segmentation-id": "segmentationId"
}
],
+ "aggregate-routes": [
+ {
+ "route-id": "routeId",
+ "network-start-address": "10.80.12.0",
+ "cidr-mask": "23",
+ "ip-version": "4"
+ }
+ ],
"model-info-network": null
}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java
index 21847e1c4e..7d5bb0dcf1 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java
@@ -33,7 +33,7 @@ public class WorkflowException implements Serializable {
private final int errorCode;
private final String errorMessage;
private final String workStep;
- private transient TargetEntities extSystemErrorSource;
+ private TargetEntities extSystemErrorSource;
/**
* Constructor
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
index 30b5cc8567..b855e936d0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory
* flow for SDNC Network Resource Activate
*/
public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( ActivateSDNCNetworkResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( ActivateSDNCNetworkResource.class)
String Prefix = "ACTSDNCRES_"
@@ -57,7 +57,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
MsoUtils msoUtils = new MsoUtils()
- public void preProcessRequest(DelegateExecution execution) {
+ void preProcessRequest(DelegateExecution execution) {
logger.info(" ***** Started preProcessRequest *****")
try {
@@ -106,7 +106,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
}
- public void prepareUpdateAfterActivateSDNCResource(DelegateExecution execution) {
+ void prepareUpdateAfterActivateSDNCResource(DelegateExecution execution) {
logger.info("started prepareUpdateAfterActivateSDNCResource ")
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(execution.getVariable(Prefix + "resourceInput"), ResourceInput.class)
@@ -135,7 +135,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
<statusDescription>${msoUtils.xmlEscape(statusDescription)}</statusDescription>
</ns:updateResourceOperationStatus>
</soapenv:Body>
- </soapenv:Envelope>""";
+ </soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
}
@@ -148,12 +148,12 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
String customizeResourceParam(String networkInputParametersJson) {
List<Map<String, Object>> paramList = new ArrayList()
- JSONObject jsonObject = new JSONObject(networkInputParametersJson);
+ JSONObject jsonObject = new JSONObject(networkInputParametersJson)
Iterator iterator = jsonObject.keys()
while (iterator.hasNext()) {
String key = iterator.next()
HashMap<String, String> hashMap = new HashMap()
- hashMap.put("name", key);
+ hashMap.put("name", key)
hashMap.put("value", jsonObject.get(key))
paramList.add(hashMap)
}
@@ -163,7 +163,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
return new JSONObject(paramMap).toString()
}
- public void prepareSDNCRequest (DelegateExecution execution) {
+ void prepareSDNCRequest (DelegateExecution execution) {
logger.info("Started prepareSDNCRequest ")
try {
@@ -186,7 +186,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
String serviceModelVersion = resourceInputObj.getServiceModelInfo().getModelVersion()
String serviceModelName = resourceInputObj.getServiceModelInfo().getModelName()
String globalCustomerId = resourceInputObj.getGlobalSubscriberId()
- String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid();
+ String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid()
String modelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
String modelUuid = resourceInputObj.getResourceModelInfo().getModelUuid()
String modelName = resourceInputObj.getResourceModelInfo().getModelName()
@@ -451,7 +451,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
logger.info(" ***** Exit prepareSDNCRequest *****")
}
- public void postActivateSDNCCall(DelegateExecution execution) {
+ void postActivateSDNCCall(DelegateExecution execution) {
logger.info("started postCreateSDNCCall ")
String responseCode = execution.getVariable(Prefix + "sdncCreateReturnCode")
@@ -460,7 +460,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
logger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj)
}
- public void sendSyncResponse(DelegateExecution execution) {
+ void sendSyncResponse(DelegateExecution execution) {
logger.info("started sendsyncResp")
try {
@@ -478,4 +478,4 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
logger.info("exited send sync Resp")
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy
index 608bf66da9..df11549ff4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -19,9 +19,9 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.infrastructure.scripts;
+package org.onap.so.bpmn.infrastructure.scripts
-import static org.apache.commons.lang3.StringUtils.*;
+import static org.apache.commons.lang3.StringUtils.*
import org.apache.commons.lang3.*
import org.camunda.bpm.engine.delegate.BpmnError
@@ -55,7 +55,7 @@ import groovy.json.*
* @param - WorkflowException
*/
public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( CompareModelofE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( CompareModelofE2EServiceInstance.class)
String Prefix="CMPMDSI_"
private static final String DebugFlag = "isDebugEnabled"
@@ -64,7 +64,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
JsonUtils jsonUtil = new JsonUtils()
VidUtils vidUtils = new VidUtils()
- public void preProcessRequest (DelegateExecution execution) {
+ void preProcessRequest (DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
String msg = ""
@@ -128,7 +128,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
execution.setVariable("operationType", "CompareModel")
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.info(msg)
@@ -137,7 +137,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
logger.trace("Exit preProcessRequest ")
}
- public void sendSyncResponse (DelegateExecution execution) {
+ void sendSyncResponse (DelegateExecution execution) {
logger.trace("sendSyncResponse ")
try {
@@ -155,7 +155,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
logger.trace("Exit sendSyncResopnse ")
}
- public void sendSyncError (DelegateExecution execution) {
+ void sendSyncError (DelegateExecution execution) {
logger.trace("sendSyncError ")
try {
@@ -182,7 +182,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
}
- public void prepareCompletionRequest (DelegateExecution execution) {
+ void prepareCompletionRequest (DelegateExecution execution) {
logger.trace("prepareCompletion ")
try {
@@ -214,7 +214,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
logger.trace("Exit prepareCompletionRequest ")
}
- public void prepareFalloutRequest(DelegateExecution execution){
+ void prepareFalloutRequest(DelegateExecution execution){
logger.trace("prepareFalloutRequest ")
try {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
index 8bb48a203b..ced1b928fc 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -72,7 +72,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
JsonUtils jsonUtil = new JsonUtils()
- private static final Logger logger = LoggerFactory.getLogger( Create3rdONAPE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( Create3rdONAPE2EServiceInstance.class)
public void checkSPPartnerInfo (DelegateExecution execution) {
logger.info(" ***** Started checkSPPartnerInfo *****")
@@ -312,7 +312,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
// Put TP Link info into serviceParameters
JSONObject inputParameters = new JSONObject(execution.getVariable(Prefix + "ServiceParameters"))
if(inputParameters.has("remote-access-provider-id")) {
- Map<String, Object> crossTPs = new HashMap<String, Object>();
+ Map<String, Object> crossTPs = new HashMap<String, Object>()
crossTPs.put("local-access-provider-id", inputParameters.get("remote-access-provider-id"))
crossTPs.put("local-access-client-id", inputParameters.get("remote-access-client-id"))
crossTPs.put("local-access-topology-id", inputParameters.get("remote-access-topology-id"))
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
index 2abee7caaa..cae629fdf0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
@@ -7,7 +7,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -39,7 +39,7 @@ import org.onap.so.client.aai.AAIObjectType
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
-import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.ErrorCode
import org.onap.so.logger.LoggingAnchor
import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
@@ -56,7 +56,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String Prefix="CRESI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- private static final Logger logger = LoggerFactory.getLogger( CreateCustomE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateCustomE2EServiceInstance.class)
public void preProcessRequest (DelegateExecution execution) {
@@ -154,7 +154,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
//execution.setVariable("serviceInputParams", jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams"))
//execution.setVariable("failExists", true)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.debug(msg)
@@ -332,7 +332,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
}catch(Exception e){
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
"Exception Occured Processing prepareInitServiceOperationStatus.", "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
+ ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareInitServiceOperationStatus Method:\n" + e.getMessage())
}
logger.trace("finished prepareInitServiceOperationStatus")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
index bcd33530b1..4b3c1aa7b4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -55,7 +55,7 @@ import org.slf4j.LoggerFactory
*/
public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( CreateSDNCNetworkResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateSDNCNetworkResource.class)
String Prefix="CRESDNCRES_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -120,20 +120,20 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
String customizeResourceParam(String networkInputParametersJson) {
- List<Map<String, Object>> paramList = new ArrayList();
- JSONObject jsonObject = new JSONObject(networkInputParametersJson);
- Iterator iterator = jsonObject.keys();
+ List<Map<String, Object>> paramList = new ArrayList()
+ JSONObject jsonObject = new JSONObject(networkInputParametersJson)
+ Iterator iterator = jsonObject.keys()
while (iterator.hasNext()) {
- String key = iterator.next();
- HashMap<String, String> hashMap = new HashMap();
- hashMap.put("name", key);
+ String key = iterator.next()
+ HashMap<String, String> hashMap = new HashMap()
+ hashMap.put("name", key)
hashMap.put("value", jsonObject.get(key))
paramList.add(hashMap)
}
- Map<String, List<Map<String, Object>>> paramMap = new HashMap();
- paramMap.put("param", paramList);
+ Map<String, List<Map<String, Object>>> paramMap = new HashMap()
+ paramMap.put("param", paramList)
- return new JSONObject(paramMap).toString();
+ return new JSONObject(paramMap).toString()
}
private List<Metadatum> getMetaDatum(String customerId,
@@ -347,7 +347,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
String serviceModelVersion = resourceInputObj.getServiceModelInfo().getModelVersion()
String serviceModelName = resourceInputObj.getServiceModelInfo().getModelName()
String globalCustomerId = resourceInputObj.getGlobalSubscriberId()
- String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid();
+ String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid()
String modelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
String modelUuid = resourceInputObj.getResourceModelInfo().getModelUuid()
String modelName = resourceInputObj.getResourceModelInfo().getModelName()
@@ -357,7 +357,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
//here convert json string to xml string
String netowrkInputParameters = XML.toString(new JSONObject(customizeResourceParam(networkInputParametersJson)))
// 1. prepare assign topology via SDNC Adapter SUBFLOW call
- String sdncTopologyCreateRequest = "";
+ String sdncTopologyCreateRequest = ""
String modelType = resourceInputObj.getResourceModelInfo().getModelType()
@@ -641,7 +641,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
<statusDescription>${msoUtils.xmlEscape(statusDescription)}</statusDescription>
</ns:updateResourceOperationStatus>
</soapenv:Body>
- </soapenv:Envelope>""";
+ </soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
@@ -674,7 +674,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
<statusDescription>${msoUtils.xmlEscape(statusDescription)}</statusDescription>
</ns:updateResourceOperationStatus>
</soapenv:Body>
- </soapenv:Envelope>""";
+ </soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
}
@@ -724,7 +724,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
try {
String operationStatus = "finished"
// RESTResponse for main flow
- String vnfid=execution.getVariable("resourceInstanceId");
+ String vnfid=execution.getVariable("resourceInstanceId")
String resourceOperationResp = """{"operationStatus":"${operationStatus}","vnf-id":"${vnfid}"}""".trim()
logger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
index 433a8d0bb9..901964f465 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -25,7 +25,7 @@ package org.onap.so.bpmn.infrastructure.scripts
import org.onap.so.client.HttpClientFactory
import org.onap.so.client.aai.AAIObjectType
import org.onap.so.client.aai.entities.uri.AAIResourceUri
-import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
@@ -44,7 +44,7 @@ import org.onap.so.utils.TargetEntity
* flow for VFC Network Service Create
*/
public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( CreateVFCNSResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateVFCNSResource.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -77,7 +77,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
String globalSubscriberId = jsonUtil.getJsonValue(resourceInput, "globalSubscriberId")
logger.info("globalSubscriberId:" + globalSubscriberId)
//set local globalSubscriberId variable
- execution.setVariable("globalSubscriberId", globalSubscriberId);
+ execution.setVariable("globalSubscriberId", globalSubscriberId)
String serviceType = execution.getVariable("serviceType")
logger.info("serviceType:" + serviceType)
@@ -110,9 +110,9 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
"operationId":"${operationId}",
"nodeTemplateUUID":"${nodeTemplateUUID}"
}"""
- execution.setVariable("nsOperationKey", nsOperationKey);
+ execution.setVariable("nsOperationKey", nsOperationKey)
execution.setVariable("nsParameters", nsParameters)
- execution.setVariable("nsServiceModelUUID", nsServiceModelUUID);
+ execution.setVariable("nsServiceModelUUID", nsServiceModelUUID)
String vfcAdapterUrl = UrnPropertiesReader.getVariable("mso.adapters.vfc.rest.endpoint", execution)
@@ -128,7 +128,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
execution.setVariable("vfcAdapterUrl", vfcAdapterUrl)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.info(msg)
@@ -143,9 +143,9 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
public void createNetworkService(DelegateExecution execution) {
logger.trace("createNetworkService ")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
- String nsOperationKey = execution.getVariable("nsOperationKey");
- String nsServiceModelUUID = execution.getVariable("nsServiceModelUUID");
- String nsParameters = execution.getVariable("nsParameters");
+ String nsOperationKey = execution.getVariable("nsOperationKey")
+ String nsServiceModelUUID = execution.getVariable("nsServiceModelUUID")
+ String nsParameters = execution.getVariable("nsParameters")
String nsServiceName = execution.getVariable("nsServiceName")
String nsServiceDescription = execution.getVariable("nsServiceDescription")
String locationConstraints = jsonUtil.getJsonValue(nsParameters, "locationConstraints")
@@ -163,7 +163,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
Response apiResponse = postRequest(execution, vfcAdapterUrl + "/ns", reqBody)
String returnCode = apiResponse.getStatus ()
String aaiResponseAsString = apiResponse.readEntity(String.class)
- String nsInstanceId = "";
+ String nsInstanceId = ""
if(returnCode== "200" || returnCode == "201"){
nsInstanceId = jsonUtil.getJsonValue(aaiResponseAsString, "nsInstanceId")
}
@@ -177,8 +177,8 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
public void instantiateNetworkService(DelegateExecution execution) {
logger.trace("instantiateNetworkService ")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
- String nsOperationKey = execution.getVariable("nsOperationKey");
- String nsParameters = execution.getVariable("nsParameters");
+ String nsOperationKey = execution.getVariable("nsOperationKey")
+ String nsParameters = execution.getVariable("nsParameters")
String nsServiceName = execution.getVariable("nsServiceName")
String nsServiceDescription = execution.getVariable("nsServiceDescription")
String reqBody ="""{
@@ -192,7 +192,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
Response apiResponse = postRequest(execution, url, reqBody)
String returnCode = apiResponse.getStatus()
String aaiResponseAsString = apiResponse.readEntity(String.class)
- String jobId = "";
+ String jobId = ""
if(returnCode== "200"|| returnCode == "201"){
jobId = jsonUtil.getJsonValue(aaiResponseAsString, "jobId")
}
@@ -207,7 +207,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
logger.trace("queryNSProgress ")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String jobId = execution.getVariable("jobId")
- String nsOperationKey = execution.getVariable("nsOperationKey");
+ String nsOperationKey = execution.getVariable("nsOperationKey")
String url = vfcAdapterUrl + "/jobs/" + jobId
Response apiResponse = postRequest(execution, url, nsOperationKey)
String returnCode = apiResponse.getStatus()
@@ -225,9 +225,9 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
*/
public void timeDelay(DelegateExecution execution) {
try {
- Thread.sleep(5000);
+ Thread.sleep(5000)
} catch(InterruptedException e) {
- logger.error("Time Delay exception" + e.getMessage());
+ logger.error("Time Delay exception" + e.getMessage())
}
}
@@ -252,7 +252,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
getAAIClient().connect(nsUri,relatedServiceUri)
logger.info("NS relationship to Service added successfully")
}catch(Exception e){
- logger.error("Exception occured while Creating NS relationship."+ e.getMessage());
+ logger.error("Exception occured while Creating NS relationship."+ e.getMessage())
throw new BpmnError("MSOWorkflowException")
}
}
@@ -268,7 +268,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
Response apiResponse = null
try{
- URL url = new URL(urlString);
+ URL url = new URL(urlString)
// Get the Basic Auth credentials for the VFCAdapter, username is 'bpel', auth is '07a7159d3bf51a0e53be7a8f89699be7'
// user 'bepl' authHeader is the same with mso.db.auth
@@ -282,7 +282,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
logger.debug("response code:"+ apiResponse.getStatus() +"\nresponse body:"+ apiResponse.readEntity(String.class))
}catch(Exception e){
- logger.error("VFC Aatpter Post Call Exception:" + e.getMessage());
+ logger.error("VFC Aatpter Post Call Exception:" + e.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "VFC Aatpter Post Call Exception")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
index 097a1be291..1a689d426c 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory
* flow for SDNC Network Resource Activate
*/
public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( DeActivateSDNCNetworkResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( DeActivateSDNCNetworkResource.class)
String Prefix = "DEACTSDNCRES_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -53,7 +53,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
MsoUtils msoUtils = new MsoUtils()
- public void preProcessRequest(DelegateExecution execution) {
+ void preProcessRequest(DelegateExecution execution) {
logger.info(" ***** Started preProcessRequest *****")
@@ -96,7 +96,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
execution.setVariable("mso-request-id", requestId)
execution.setVariable("mso-service-instance-id", resourceInputObj.getServiceInstanceId())
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.debug(msg)
@@ -104,7 +104,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
}
}
- public void prepareSDNCRequest(DelegateExecution execution) {
+ void prepareSDNCRequest(DelegateExecution execution) {
logger.info(" ***** Started prepareSDNCRequest *****")
try {
@@ -127,7 +127,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
String serviceModelVersion = resourceInputObj.getServiceModelInfo().getModelVersion()
String serviceModelName = resourceInputObj.getServiceModelInfo().getModelName()
String globalCustomerId = resourceInputObj.getGlobalSubscriberId()
- String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid();
+ String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid()
String modelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
String modelUuid = resourceInputObj.getResourceModelInfo().getModelUuid()
String modelName = resourceInputObj.getResourceModelInfo().getModelName()
@@ -390,7 +390,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
logger.info(" ***** Exit prepareSDNCRequest *****")
}
- public void prepareUpdateAfterDeActivateSDNCResource(DelegateExecution execution) {
+ void prepareUpdateAfterDeActivateSDNCResource(DelegateExecution execution) {
String resourceInput = execution.getVariable("resourceInput")
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
String operType = resourceInputObj.getOperationType()
@@ -418,7 +418,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
<statusDescription>${msoUtils.xmlEscape(statusDescription)}</statusDescription>
</ns:updateResourceOperationStatus>
</soapenv:Body>
- </soapenv:Envelope>""";
+ </soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
}
@@ -429,7 +429,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
execution.setVariable("CVFMI_updateResOperStatusRequest", body)
}
- public void postDeactivateSDNCCall(DelegateExecution execution) {
+ void postDeactivateSDNCCall(DelegateExecution execution) {
logger.info(" ***** Started prepareSDNCRequest *****")
String responseCode = execution.getVariable(Prefix + "sdncDeleteReturnCode")
String responseObj = execution.getVariable(Prefix + "SuccessIndicator")
@@ -438,7 +438,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
logger.info(" ***** Exit prepareSDNCRequest *****")
}
- public void sendSyncResponse(DelegateExecution execution) {
+ void sendSyncResponse(DelegateExecution execution) {
logger.debug(" *** sendSyncResponse *** ")
try {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
index 64ae3dfbef..da486bb1c3 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -60,7 +60,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
JsonUtils jsonUtil = new JsonUtils()
- private static final Logger logger = LoggerFactory.getLogger( Delete3rdONAPE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( Delete3rdONAPE2EServiceInstance.class)
public void checkSPPartnerInfoFromAAI (DelegateExecution execution) {
logger.info(" ***** Started checkSPPartnerInfo *****")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
index a9b1fdaac3..2a65ae97a2 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
@@ -8,7 +8,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -22,9 +22,9 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.infrastructure.scripts;
+package org.onap.so.bpmn.infrastructure.scripts
-import static org.apache.commons.lang3.StringUtils.*;
+import static org.apache.commons.lang3.StringUtils.*
import org.apache.commons.lang3.*
import org.camunda.bpm.engine.delegate.BpmnError
@@ -38,7 +38,7 @@ import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import org.springframework.web.util.UriUtils;
+import org.springframework.web.util.UriUtils
import groovy.json.*
@@ -52,7 +52,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
VidUtils vidUtils = new VidUtils()
- private static final Logger logger = LoggerFactory.getLogger( DeleteCustomE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DeleteCustomE2EServiceInstance.class)
public void preProcessRequest (DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
index 7c8b7eb7cc..61b1250522 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
@@ -67,7 +67,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
MsoUtils msoUtils = new MsoUtils()
- public void preProcessRequest(DelegateExecution execution){
+ void preProcessRequest(DelegateExecution execution){
logger.info(" ***** Started preProcessRequest *****")
try {
@@ -184,7 +184,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
* generate the nsOperationKey
* generate the nsParameters
*/
- public void prepareSDNCRequest (DelegateExecution execution) {
+ void prepareSDNCRequest (DelegateExecution execution) {
logger.info(" ***** Started prepareSDNCRequest *****")
try {
@@ -475,7 +475,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
execution.setVariable("CVFMI_updateResOperStatusRequest", body)
}
- public void prepareUpdateBeforeDeleteSDNCResource(DelegateExecution execution) {
+ void prepareUpdateBeforeDeleteSDNCResource(DelegateExecution execution) {
logger.debug(" *** prepareUpdateBeforeDeleteSDNCResource *** ")
String resourceInput = execution.getVariable(Prefix + "resourceInput");
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
@@ -511,7 +511,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
- public void prepareUpdateAfterDeleteSDNCResource(DelegateExecution execution) {
+ void prepareUpdateAfterDeleteSDNCResource(DelegateExecution execution) {
logger.debug(" *** prepareUpdateAfterDeleteSDNCResource *** ")
String resourceInput = execution.getVariable(Prefix + "resourceInput");
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
@@ -546,7 +546,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
logger.debug(" ***** Exit prepareUpdateAfterDeleteSDNCResource *****")
}
- public void postDeleteSDNCCall(DelegateExecution execution){
+ void postDeleteSDNCCall(DelegateExecution execution){
logger.info(" ***** Started postDeleteSDNCCall *****")
String responseCode = execution.getVariable(Prefix + "sdncDeleteReturnCode")
String responseObj = execution.getVariable(Prefix + "SuccessIndicator")
@@ -555,7 +555,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
logger.info(" ***** Exit postDeleteSDNCCall *****")
}
- public void sendSyncResponse (DelegateExecution execution) {
+ void sendSyncResponse (DelegateExecution execution) {
logger.debug( " *** sendSyncResponse *** ")
try {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy
index 9b269c734f..642609a970 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy
@@ -63,14 +63,14 @@ public class DeleteVFCNSResource extends AbstractServiceTaskProcessor {
logger.info(" ***** end preProcessRequest *****")
}
- public void postProcessRequest (DelegateExecution execution) {
+ void postProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
logger.info(" ***** start postProcessRequest *****")
logger.info(" ***** end postProcessRequest *****")
}
- public void sendSyncResponse (DelegateExecution execution) {
+ void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.debug( " *** sendSyncResponse *** ")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy
index fff2503308..324e6b42ba 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -19,9 +19,9 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-package org.onap.so.bpmn.infrastructure.scripts;
+package org.onap.so.bpmn.infrastructure.scripts
-import static org.apache.commons.lang3.StringUtils.*;
+import static org.apache.commons.lang3.StringUtils.*
import org.onap.so.bpmn.core.domain.ServiceDecomposition
import org.onap.so.bpmn.core.domain.Resource
@@ -52,7 +52,7 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
String Prefix="DCMPMDV_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- private static final Logger logger = LoggerFactory.getLogger( DoCompareModelVersions.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCompareModelVersions.class)
public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
@@ -196,8 +196,8 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
ServiceDecomposition serviceDecomposition_Target = execution.getVariable("serviceDecomposition_Target")
ServiceDecomposition serviceDecomposition_Original = execution.getVariable("serviceDecomposition_Original")
- List<Resource> allSR_target = serviceDecomposition_Target.getServiceResources();
- List<Resource> allSR_original = serviceDecomposition_Original.getServiceResources();
+ List<Resource> allSR_target = serviceDecomposition_Target.getServiceResources()
+ List<Resource> allSR_original = serviceDecomposition_Original.getServiceResources()
List<Resource> addResourceList = new ArrayList<String>()
List<Resource> delResourceList = new ArrayList<String>()
@@ -214,8 +214,8 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
if(rc_o.getModelInfo().getModelUuid() == muuid
&& rc_o.getModelInfo().getModelInvariantUuid() == mIuuid
&& rc_o.getModelInfo().getModelCustomizationUuid() == mCuuid) {
- addResourceList.remove(rc_t);
- delResourceList.remove(rc_o);
+ addResourceList.remove(rc_t)
+ delResourceList.remove(rc_o)
}
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
index 0191439dac..9d8b953f0e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
@@ -7,7 +7,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -26,9 +26,9 @@ import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
import org.onap.so.logger.LoggingAnchor
-import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.ErrorCode
-import static org.apache.commons.lang3.StringUtils.*;
+import static org.apache.commons.lang3.StringUtils.*
import javax.ws.rs.NotFoundException
@@ -83,7 +83,7 @@ import org.onap.so.bpmn.core.UrnPropertiesReader
*
*/
public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( DoCreateE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateE2EServiceInstance.class)
String Prefix="DCRESI_"
@@ -165,7 +165,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("serviceInstanceData", si)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.info(msg)
@@ -210,7 +210,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
//we need a service plugin platform here.
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String uuiRequest = execution.getVariable("uuiRequest")
- String newUuiRequest = ServicePluginFactory.getInstance().preProcessService(serviceDecomposition, uuiRequest);
+ String newUuiRequest = ServicePluginFactory.getInstance().preProcessService(serviceDecomposition, uuiRequest)
execution.setVariable("uuiRequest", newUuiRequest)
}
@@ -218,7 +218,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
//we need a service plugin platform here.
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String uuiRequest = execution.getVariable("uuiRequest")
- String newUuiRequest = ServicePluginFactory.getInstance().doServiceHoming(serviceDecomposition, uuiRequest);
+ String newUuiRequest = ServicePluginFactory.getInstance().doServiceHoming(serviceDecomposition, uuiRequest)
execution.setVariable("uuiRequest", newUuiRequest)
}
@@ -254,7 +254,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}
}
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex) {
msg = "Exception in DoCreateServiceInstance.postProcessAAIGET. " + ex.getMessage()
logger.info(msg)
@@ -276,7 +276,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
client.create(uri, si)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex) {
//start rollback set up
RollbackData rollbackData = new RollbackData()
@@ -310,11 +310,11 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
AAIResultWrapper aaiResult = client.get(uri,NotFoundException.class)
Map<String, Object> result = aaiResult.asMap()
List<Object> resources =
- (List<Object>) result.getOrDefault("result-data", Collections.emptyList());
+ (List<Object>) result.getOrDefault("result-data", Collections.emptyList())
if(resources.size()>0) {
String relationshipUrl = ((Map<String, Object>) resources.get(0)).get("resource-link")
- final Relationship body = new Relationship();
+ final Relationship body = new Relationship()
body.setRelatedLink(relationshipUrl)
createRelationShipInAAI(execution, body)
@@ -329,7 +329,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex) {
msg = "Exception in DoCreateE2EServiceInstance.createCustomRelationship. " + ex.getMessage()
@@ -349,7 +349,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
client.create(uri, relationship)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex) {
msg = "Exception in DoCreateE2EServiceInstance.createRelationShipInAAI. " + ex.getMessage()
@@ -362,9 +362,9 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
private String isNeedProcessCustomRelationship(String uuiRequest) {
String requestInput = jsonUtil.getJsonValue(uuiRequest, "service.parameters.requestInputs")
- Map<String, String> requestInputObject = getJsonObject(requestInput, Map.class);
+ Map<String, String> requestInputObject = getJsonObject(requestInput, Map.class)
if (requestInputObject == null) {
- return null;
+ return null
}
Optional<Map.Entry> firstKey =
@@ -380,15 +380,15 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}
private static <T> T getJsonObject(String jsonstr, Class<T> type) {
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
+ ObjectMapper mapper = new ObjectMapper()
+ mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true)
try {
- return mapper.readValue(jsonstr, type);
+ return mapper.readValue(jsonstr, type)
} catch (IOException e) {
logger.error("{} {} fail to unMarshal json", MessageEnum.RA_NS_EXC.toString(),
- ErrorCode.BusinessProcesssError.getValue(), e);
+ ErrorCode.BusinessProcesssError.getValue(), e)
}
- return null;
+ return null
}
@@ -409,7 +409,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("serviceInstanceName", si.get().getServiceInstanceName())
}catch(BpmnError e) {
- throw e;
+ throw e
}catch(Exception ex) {
String msg = "Internal Error in getServiceInstance: " + ex.getMessage()
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
@@ -449,7 +449,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}
}
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex) {
msg = "Exception in DoCreateServiceInstance.postProcessAAIGET2 " + ex.getMessage()
logger.info(msg)
@@ -462,12 +462,12 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("preProcessRollback ")
try {
- Object workflowException = execution.getVariable("WorkflowException");
+ Object workflowException = execution.getVariable("WorkflowException")
if (workflowException instanceof WorkflowException) {
logger.info("Prev workflowException: " + workflowException.getErrorMessage())
- execution.setVariable("prevWorkflowException", workflowException);
- //execution.setVariable("WorkflowException", null);
+ execution.setVariable("prevWorkflowException", workflowException)
+ //execution.setVariable("WorkflowException", null)
}
} catch (BpmnError e) {
logger.info("BPMN Error during preProcessRollback")
@@ -482,15 +482,15 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("postProcessRollback ")
String msg = ""
try {
- Object workflowException = execution.getVariable("prevWorkflowException");
+ Object workflowException = execution.getVariable("prevWorkflowException")
if (workflowException instanceof WorkflowException) {
logger.info("Setting prevException to WorkflowException: ")
- execution.setVariable("WorkflowException", workflowException);
+ execution.setVariable("WorkflowException", workflowException)
}
execution.setVariable("rollbackData", null)
} catch (BpmnError b) {
logger.info("BPMN Error during postProcessRollback")
- throw b;
+ throw b
} catch(Exception ex) {
msg = "Exception in postProcessRollback. " + ex.getMessage()
logger.info(msg)
@@ -547,19 +547,19 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}catch(Exception e){
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
"Exception Occured Processing preInitResourcesOperStatus.", "BPMN",
- ErrorCode.UnknownError.getValue(), e);
+ ErrorCode.UnknownError.getValue(), e)
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
}
logger.trace("COMPLETED preInitResourcesOperStatus Process ")
}
- // if site location is in local Operator, create all resources in local ONAP;
+ // if site location is in local Operator, create all resources in local ONAP
// if site location is in 3rd Operator, only process sp-partner to create all resources in 3rd ONAP
public void doProcessSiteLocation(DelegateExecution execution){
logger.trace("======== Start doProcessSiteLocation Process ======== ")
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String uuiRequest = execution.getVariable("uuiRequest")
- uuiRequest = ServicePluginFactory.getInstance().doProcessSiteLocation(serviceDecomposition, uuiRequest);
+ uuiRequest = ServicePluginFactory.getInstance().doProcessSiteLocation(serviceDecomposition, uuiRequest)
execution.setVariable("uuiRequest", uuiRequest)
execution.setVariable("serviceDecomposition", serviceDecomposition)
@@ -571,7 +571,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("======== Start doTPResourcesAllocation Process ======== ")
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String uuiRequest = execution.getVariable("uuiRequest")
- uuiRequest = ServicePluginFactory.getInstance().doTPResourcesAllocation(execution, uuiRequest);
+ uuiRequest = ServicePluginFactory.getInstance().doTPResourcesAllocation(execution, uuiRequest)
execution.setVariable("uuiRequest", uuiRequest)
logger.trace("======== COMPLETED doTPResourcesAllocation Process ======== ")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
index b1356b9fb6..bc26aa10ec 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -72,13 +72,13 @@ import java.lang.reflect.Type
* @param - WorkflowException
*/
public class DoCreateResources extends AbstractServiceTaskProcessor{
- private static final Logger logger = LoggerFactory.getLogger( DoCreateResources.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateResources.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
CatalogDbUtils catalogDbUtils = new CatalogDbUtilsFactory().create()
- public void preProcessRequest(DelegateExecution execution) {
+ void preProcessRequest(DelegateExecution execution) {
logger.trace("preProcessRequest ")
String msg = ""
@@ -95,7 +95,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
logger.trace("Exit preProcessRequest ")
}
- public void sequenceResoure(DelegateExecution execution) {
+ void sequenceResoure(DelegateExecution execution) {
logger.trace("Start sequenceResoure Process ")
String incomingRequest = execution.getVariable("uuiRequest")
@@ -170,7 +170,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
String isContainsWanResource = networkResourceList.isEmpty() ? "false" : "true"
//if no networkResource, get SDNC config from properties file
if( "false".equals(isContainsWanResource)) {
- String serviceNeedSDNC = "mso.workflow.custom." + serviceModelName + ".sdnc.need";
+ String serviceNeedSDNC = "mso.workflow.custom." + serviceModelName + ".sdnc.need"
isContainsWanResource = BPMNProperties.getProperty(serviceNeedSDNC, isContainsWanResource)
}
@@ -181,7 +181,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
logger.trace("COMPLETED sequenceResoure Process ")
}
- public prepareServiceTopologyRequest(DelegateExecution execution) {
+ void prepareServiceTopologyRequest(DelegateExecution execution) {
logger.trace("======== Start prepareServiceTopologyRequest Process ======== ")
@@ -201,7 +201,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
logger.trace("======== End prepareServiceTopologyRequest Process ======== ")
}
- public void getCurrentResoure(DelegateExecution execution){
+ void getCurrentResoure(DelegateExecution execution){
logger.trace("Start getCurrentResoure Process ")
def currentIndex = execution.getVariable("currentResourceIndex")
List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
@@ -211,7 +211,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
logger.trace("COMPLETED getCurrentResource Process ")
}
- public void parseNextResource(DelegateExecution execution){
+ void parseNextResource(DelegateExecution execution){
logger.trace("Start parseNextResource Process ")
def currentIndex = execution.getVariable("currentResourceIndex")
def nextIndex = currentIndex + 1
@@ -225,7 +225,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
logger.trace("COMPLETED parseNextResource Process ")
}
- public void prepareResourceRecipeRequest(DelegateExecution execution){
+ void prepareResourceRecipeRequest(DelegateExecution execution){
logger.trace("Start prepareResourceRecipeRequest Process ")
ResourceInput resourceInput = new ResourceInput()
String serviceInstanceName = execution.getVariable("serviceInstanceName")
@@ -242,7 +242,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
resourceInput.setServiceType(serviceType)
resourceInput.setServiceInstanceId(serviceInstanceId)
resourceInput.setOperationId(operationId)
- resourceInput.setOperationType(operationType);
+ resourceInput.setOperationType(operationType)
def currentIndex = execution.getVariable("currentResourceIndex")
List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
Resource currentResource = sequencedResourceList.get(currentIndex)
@@ -284,7 +284,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
logger.trace("COMPLETED prepareResourceRecipeRequest Process ")
}
- public void executeResourceRecipe(DelegateExecution execution){
+ void executeResourceRecipe(DelegateExecution execution){
logger.trace("Start executeResourceRecipe Process ")
try {
@@ -338,7 +338,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
}
}
- public void postConfigRequest(DelegateExecution execution){
+ void postConfigRequest(DelegateExecution execution){
//now do noting
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
for (VnfResource resource : serviceDecomposition.vnfResources) {
@@ -346,4 +346,4 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
}
execution.setVariable("serviceDecomposition", serviceDecomposition)
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
index bf52b11de2..64d9827c7c 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
@@ -83,7 +83,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
JsonUtils jsonUtil = new JsonUtils()
CatalogDbUtils catalogDbUtils = new CatalogDbUtilsFactory().create()
- public void preProcessRequest (DelegateExecution execution) {
+ void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
String msg = ""
logger.trace("preProcessRequest")
@@ -286,7 +286,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit preProcessRequest")
}
- public void getAAICustomerById (DelegateExecution execution) {
+ void getAAICustomerById (DelegateExecution execution) {
// https://{aaiEP}/aai/v8/business/customers/customer/{globalCustomerId}
try {
@@ -306,7 +306,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
}
- public void putServiceInstance(DelegateExecution execution) {
+ void putServiceInstance(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("putServiceInstance")
String msg = ""
@@ -380,7 +380,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit putServiceInstance")
}
- public void preProcessSDNCAssignRequest(DelegateExecution execution) {
+ void preProcessSDNCAssignRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
String msg = ""
logger.trace("preProcessSDNCAssignRequest")
@@ -479,7 +479,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit preProcessSDNCAssignRequest")
}
- public void postProcessSDNCAssign (DelegateExecution execution) {
+ void postProcessSDNCAssign (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("postProcessSDNCAssign")
try {
@@ -518,7 +518,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit postProcessSDNCAssign")
}
- public void postProcessAAIGET2(DelegateExecution execution) {
+ void postProcessAAIGET2(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("postProcessAAIGET2")
String msg = ""
@@ -561,7 +561,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit postProcessAAIGET2")
}
- public void preProcessRollback (DelegateExecution execution) {
+ void preProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("preProcessRollback")
try {
@@ -582,7 +582,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit preProcessRollback")
}
- public void postProcessRollback (DelegateExecution execution) {
+ void postProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("postProcessRollback")
String msg = ""
@@ -603,7 +603,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit postProcessRollback")
}
- public void createProject(DelegateExecution execution) {
+ void createProject(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("createProject")
@@ -631,7 +631,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit createProject")
}
- public void createOwningEntity(DelegateExecution execution) {
+ void createOwningEntity(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
logger.trace("createOwningEntity")
String msg = "";
@@ -679,7 +679,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
// Build Error Section
// *******************************
- public void processJavaException(DelegateExecution execution){
+ void processJavaException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
try{
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
index cf3a0ef56f..a88becad1a 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
@@ -7,7 +7,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -25,7 +25,7 @@ package org.onap.so.bpmn.infrastructure.scripts
import org.onap.so.logger.LoggingAnchor
import org.onap.so.logger.ErrorCode
-import static org.apache.commons.lang3.StringUtils.*;
+import static org.apache.commons.lang3.StringUtils.*
import javax.xml.parsers.DocumentBuilder
import javax.xml.parsers.DocumentBuilderFactory
@@ -33,8 +33,8 @@ import javax.xml.parsers.DocumentBuilderFactory
import org.apache.commons.lang3.*
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.json.JSONArray;
-import org.json.JSONObject;
+import org.json.JSONArray
+import org.json.JSONObject
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.MsoUtils
@@ -44,7 +44,7 @@ import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import org.springframework.web.util.UriUtils;
+import org.springframework.web.util.UriUtils
import org.w3c.dom.Document
import org.w3c.dom.Element
import org.w3c.dom.Node
@@ -79,7 +79,7 @@ import groovy.json.*
* Rollback - Deferred
*/
public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
- private static final Logger logger = LoggerFactory.getLogger( DoCustomDeleteE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCustomDeleteE2EServiceInstance.class)
String Prefix="DDELSI_"
@@ -151,7 +151,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
execution.setVariable("siParamsXml", siParamsXml)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.info(msg)
@@ -271,7 +271,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
logger.info("sdncDelete:\n" + sdncDelete)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch(Exception ex) {
msg = "Exception in preProcessSDNCDelete. " + ex.getMessage()
logger.info(msg)
@@ -302,7 +302,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
exceptionUtil.buildAndThrowWorkflowException(execution, 3500, msg)
}
} catch (BpmnError e) {
- throw e;
+ throw e
} catch(Exception ex) {
msg = "Exception in postProcessSDNC " + method + " Exception:" + ex.getMessage()
logger.info(msg)
@@ -337,8 +337,8 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
//Confirm there are no related service instances (vnf/network or volume)
if (utils.nodeExists(siData, "relationship-list")) {
logger.info("SI Data relationship-list exists:")
- InputSource source = new InputSource(new StringReader(siData));
- DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ InputSource source = new InputSource(new StringReader(siData))
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance()
DocumentBuilder docBuilder = docFactory.newDocumentBuilder()
Document serviceXml = docBuilder.parse(source)
serviceXml.getDocumentElement().normalize()
@@ -433,7 +433,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
logger.info("Service-instance NOT found in AAI. Silent Success")
}
}catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex) {
msg = "Exception in DoDeleteE2EServiceInstance.postProcessAAIGET. " + ex.getMessage()
logger.info(msg)
@@ -452,7 +452,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
String serviceType = execution.getVariable("serviceType")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
- AAIResourcesClient resourceClient = new AAIResourcesClient();
+ AAIResourcesClient resourceClient = new AAIResourcesClient()
AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustId, serviceType, serviceInstanceId)
resourceClient.delete(serviceInstanceUri)
@@ -535,7 +535,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
}catch(Exception e){
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
"Exception Occured Processing preInitResourcesOperStatus.", "BPMN",
- ErrorCode.UnknownError.getValue(), e);
+ ErrorCode.UnknownError.getValue(), e)
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
}
logger.trace("COMPLETED preInitResourcesOperStatus Process ")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
index 481a79a7ef..34ea20ba62 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -90,7 +90,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
String Prefix="DDEESI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- private static final Logger logger = LoggerFactory.getLogger( DoDeleteE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoDeleteE2EServiceInstance.class)
public void preProcessRequest (DelegateExecution execution) {
@@ -158,7 +158,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("siParamsXml", siParamsXml)
} catch (BpmnError e) {
- throw e;
+ throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
logger.error(msg)
@@ -243,7 +243,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
// for sp-partner and others
else if (eKey.endsWith("-id")) {
jObj.put("resourceInstanceId", eValue)
- String resourceName = rt + eValue;
+ String resourceName = rt + eValue
jObj.put("resourceType", resourceName)
}
jObj.put("resourceLinkUrl", rl)
@@ -520,12 +520,12 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
if (StringUtils.containsIgnoreCase(obj.get("resourceType"), modelName)) {
resource.setResourceId(obj.get("resourceInstanceId"))
//deleteRealResourceList.add(resource)
- matches = true;
+ matches = true
} else if (modelCustomizationUuid.equals(obj.get("modelCustomizationId")) || modelUuid.equals(obj.get("model-version-id")) ) {
resource.setResourceId(obj.get("resourceInstanceId"))
resource.setResourceInstanceName(obj.get("resourceType"))
//deleteRealResourceList.add(resource)
- matches = true;
+ matches = true
}
return matches
}
@@ -646,7 +646,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
String serviceType = execution.getVariable("serviceType")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
- AAIResourcesClient resourceClient = new AAIResourcesClient();
+ AAIResourcesClient resourceClient = new AAIResourcesClient()
AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustId, serviceType, serviceInstanceId)
resourceClient.delete(serviceInstanceUri)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy
index cbeb1d3d69..97eb3b3960 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy
@@ -4,7 +4,7 @@
* ================================================================================
* Copyright (C) 2017 - 2019 Huawei Intellectual Property. All rights reserved.
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -34,7 +34,7 @@ import org.slf4j.Logger
import org.slf4j.LoggerFactory
public class HandlePNF extends AbstractServiceTaskProcessor{
- private static final Logger logger = LoggerFactory.getLogger( HandlePNF.class);
+ private static final Logger logger = LoggerFactory.getLogger( HandlePNF.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
@@ -95,7 +95,7 @@ public class HandlePNF extends AbstractServiceTaskProcessor{
<statusDescription>${msoUtils.xmlEscape(statusDescription)}</statusDescription>
</ns:updateResourceOperationStatus>
</soapenv:Body>
- </soapenv:Envelope>""";
+ </soapenv:Envelope>"""
logger.debug("body: "+body)
setProgressUpdateVariables(execution, body)
logger.debug("exit postProcess for HandlePNF")
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 357b571a5c..48061db887 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
@@ -90,7 +90,7 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
@Override
public synchronized Runnable unregister(String pnfCorrelationId) {
logger.debug("unregistering from pnf ready dmaap event for pnf correlation id: {}", pnfCorrelationId);
- Runnable runnable = runnable = pnfCorrelationIdToThreadMap.remove(pnfCorrelationId);
+ Runnable runnable = pnfCorrelationIdToThreadMap.remove(pnfCorrelationId);
synchronized (updateInfoMap) {
for (int i = updateInfoMap.size() - 1; i >= 0; i--) {
if (!updateInfoMap.get(i).containsKey("pnfCorrelationId"))
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java
index 7466df53b2..c9a937b824 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java
@@ -30,8 +30,6 @@ import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.AAINetworkResources;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -61,10 +59,10 @@ public class UnassignNetworkBB {
* @param execution - BuildingBlockExecution
* @param relatedToValue - String, ex: vf-module
* @return void - nothing
- * @throws Exception
+ *
*/
- public void checkRelationshipRelatedTo(BuildingBlockExecution execution, String relatedToValue) throws Exception {
+ public void checkRelationshipRelatedTo(BuildingBlockExecution execution, String relatedToValue) {
try {
L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
AAIResultWrapper aaiResultWrapper = aaiNetworkResources.queryNetworkWrapperById(l3network);
@@ -85,10 +83,10 @@ public class UnassignNetworkBB {
*
* @param execution - BuildingBlockExecution
* @return void - nothing
- * @throws Exception
+ *
*/
- public void getCloudSdncRegion(BuildingBlockExecution execution) throws Exception {
+ public void getCloudSdncRegion(BuildingBlockExecution execution) {
try {
String cloudRegionSdnc = networkBBUtils.getCloudRegion(execution, SourceSystem.SDNC);
execution.setVariable("cloudRegionSdnc", cloudRegionSdnc);
@@ -107,7 +105,7 @@ public class UnassignNetworkBB {
String msg;
boolean isRollbackNeeded =
execution.getVariable("isRollbackNeeded") != null ? execution.getVariable("isRollbackNeeded") : false;
- if (isRollbackNeeded == true) {
+ if (isRollbackNeeded) {
msg = execution.getVariable("ErrorUnassignNetworkBB") + messageErrorRollback;
} else {
msg = execution.getVariable("ErrorUnassignNetworkBB");
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
index f23e5cdb5a..5c69987a54 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
@@ -33,6 +33,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Optional;
import javax.annotation.PostConstruct;
import org.apache.commons.lang3.StringUtils;
@@ -210,23 +211,25 @@ public class VnfAdapterVfModuleObjectMapper {
protected void buildDirectivesParamFromMap(Map<String, Object> paramsMap, String directive,
Map<String, Object> srcMap) throws MissingValueTagException {
StringBuilder directives = new StringBuilder();
- int no_directives_size = 0;
+ int noOfDirectivesSize = 0;
if (directive.equals(MsoMulticloudUtils.USER_DIRECTIVES)
&& srcMap.containsKey(MsoMulticloudUtils.OOF_DIRECTIVES)) {
- no_directives_size = 1;
+ noOfDirectivesSize = 1;
}
- if (srcMap.size() > no_directives_size) {
+ if (srcMap.size() > noOfDirectivesSize) {
directives.append("{ \"attributes\": [ ");
int i = 0;
- for (String attributeName : srcMap.keySet()) {
+ for (Map.Entry<String, Object> attributeEntry : srcMap.entrySet()) {
+ String attributeName = attributeEntry.getKey();
+ Object attributeValue = attributeEntry.getValue();
if (!(MsoMulticloudUtils.USER_DIRECTIVES.equals(directive)
&& attributeName.equals(MsoMulticloudUtils.OOF_DIRECTIVES))) {
- if (srcMap.get(attributeName) == null) {
+ if (attributeValue == null) {
logger.error("No value tag found for attribute: {}", attributeName);
throw new MissingValueTagException("No value tag found for " + attributeName);
}
- directives.append(new AttributeNameValue(attributeName, srcMap.get(attributeName).toString()));
- if (i < (srcMap.size() - 1 + no_directives_size))
+ directives.append(new AttributeNameValue(attributeName, attributeValue.toString()));
+ if (i < (srcMap.size() - 1 + noOfDirectivesSize))
directives.append(", ");
i++;
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
index 21c0b971b8..d07574a1ad 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
@@ -57,10 +57,10 @@ public class SniroClient {
*
* @param homingRequest
* @return
- * @throws JsonProcessingException
+ * @throws BadResponseException
* @throws BpmnError
*/
- public void postDemands(SniroManagerRequest homingRequest) throws BadResponseException, JsonProcessingException {
+ public void postDemands(SniroManagerRequest homingRequest) throws BadResponseException {
logger.trace("Started Sniro Client Post Demands");
String url = managerProperties.getHost() + managerProperties.getUri().get("v2");
logger.debug("Post demands url: {}", url);
diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java
index 3bd646fada..d15fbf9322 100644
--- a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java
+++ b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java
@@ -135,7 +135,7 @@ public class CloudifyClient {
* @return An object of Class <R>
*/
public <R> CloudifyRequest<R> get(String path, Class<R> returnType) {
- return new CloudifyRequest<R>(this, HttpMethod.GET, path, null, returnType);
+ return new CloudifyRequest<>(this, HttpMethod.GET, path, null, returnType);
}
}
diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyRequest.java b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyRequest.java
index df63bd18d3..006768f2f1 100644
--- a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyRequest.java
+++ b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyRequest.java
@@ -37,7 +37,7 @@ public class CloudifyRequest<R> {
private StringBuilder path = new StringBuilder();
- private Map<String, List<Object>> headers = new HashMap<String, List<Object>>();
+ private Map<String, List<Object>> headers = new HashMap<>();
private Entity<?> entity;
@@ -100,7 +100,7 @@ public class CloudifyRequest<R> {
}
public <T> Entity<T> entity(T entity, String contentType) {
- return new Entity<T>(entity, contentType);
+ return new Entity<>(entity, contentType);
}
public Entity<?> entity() {
@@ -160,7 +160,7 @@ public class CloudifyRequest<R> {
+ headers + ", entity=" + entity + ", returnType=" + returnType + "]";
}
- private Map<String, List<Object>> queryParams = new LinkedHashMap<String, List<Object>>();
+ private Map<String, List<Object>> queryParams = new LinkedHashMap<>();
public Map<String, List<Object>> queryParams() {
return queryParams;
@@ -171,7 +171,7 @@ public class CloudifyRequest<R> {
List<Object> values = queryParams.get(key);
values.add(value);
} else {
- List<Object> values = new ArrayList<Object>();
+ List<Object> values = new ArrayList<>();
values.add(value);
queryParams.put(key, values);
}
diff --git a/common/src/main/java/org/onap/so/utils/TargetEntities.java b/common/src/main/java/org/onap/so/utils/TargetEntities.java
index 94385ec8ea..67016a1fa9 100644
--- a/common/src/main/java/org/onap/so/utils/TargetEntities.java
+++ b/common/src/main/java/org/onap/so/utils/TargetEntities.java
@@ -20,6 +20,8 @@
package org.onap.so.utils;
-public interface TargetEntities {
+import java.io.Serializable;
+
+public interface TargetEntities extends Serializable {
}
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Actions.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Actions.java
index 5dbe44f58b..5ae0cea549 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Actions.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Actions.java
@@ -20,6 +20,8 @@
package org.onap.so.apihandlerinfra;
-public interface Actions {
+import java.io.Serializable;
+
+public interface Actions extends Serializable {
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GenericStringConverter.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GenericStringConverter.java
new file mode 100644
index 0000000000..80144d8ca1
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GenericStringConverter.java
@@ -0,0 +1,33 @@
+package org.onap.so.apihandlerinfra;
+
+import java.net.URI;
+import java.util.Set;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
+import org.springframework.core.convert.TypeDescriptor;
+import org.springframework.core.convert.converter.GenericConverter;
+import org.springframework.stereotype.Component;
+import com.google.common.collect.ImmutableSet;
+
+@Component
+@ConfigurationPropertiesBinding
+public class GenericStringConverter implements GenericConverter {
+
+ @Autowired
+ private HealthCheckConverter converter;
+
+ @Override
+ public Set<ConvertiblePair> getConvertibleTypes() {
+
+ ConvertiblePair[] pairs = new ConvertiblePair[] {new ConvertiblePair(String.class, Subsystem.class),
+ new ConvertiblePair(String.class, URI.class)};
+ return ImmutableSet.copyOf(pairs);
+ }
+
+ @Override
+ public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
+
+ return converter.convert(source, sourceType, targetType);
+
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java
index 3d4b2c76fb..0379ae3578 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java
@@ -25,11 +25,8 @@ package org.onap.so.apihandlerinfra;
import java.net.URI;
import java.util.Collections;
-import org.onap.so.logger.LoggingAnchor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
+import java.util.List;
+import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import javax.transaction.Transactional;
import javax.ws.rs.DefaultValue;
@@ -42,14 +39,20 @@ import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import org.apache.http.HttpStatus;
+import org.onap.so.apihandlerinfra.HealthCheckConfig.Endpoint;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
-import org.springframework.http.HttpMethod;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -59,45 +62,38 @@ import io.swagger.annotations.ApiOperation;
@Api(value = "/globalhealthcheck", description = "APIH Infra Global Health Check")
public class GlobalHealthcheckHandler {
private static Logger logger = LoggerFactory.getLogger(GlobalHealthcheckHandler.class);
- private static final String CONTEXTPATH_PROPERTY = "management.context-path";
- private static final String PROPERTY_DOMAIN = "mso.health.endpoints";
- private static final String CATALOGDB_PROPERTY = PROPERTY_DOMAIN + ".catalogdb";
- private static final String REQUESTDB_PROPERTY = PROPERTY_DOMAIN + ".requestdb";
- private static final String SDNC_PROPERTY = PROPERTY_DOMAIN + ".sdnc";
- private static final String OPENSTACK_PROPERTY = PROPERTY_DOMAIN + ".openstack";
- private static final String BPMN_PROPERTY = PROPERTY_DOMAIN + ".bpmn";
- private static final String ASDC_PROPERTY = PROPERTY_DOMAIN + ".asdc";
- private static final String REQUESTDBATTSVC_PROPERTY = PROPERTY_DOMAIN + ".requestdbattsvc";
- private static final String DEFAULT_PROPERTY_VALUE = "";
+ protected static final String CONTEXTPATH_PROPERTY = "management.endpoints.web.base-path";
+ protected static final String PROPERTY_DOMAIN = "mso.health";
+ protected static final String CATALOGDB_PROPERTY = PROPERTY_DOMAIN + ".endpoints.catalogdb";
+ protected static final String REQUESTDB_PROPERTY = PROPERTY_DOMAIN + ".endpoints.requestdb";
+ protected static final String SDNC_PROPERTY = PROPERTY_DOMAIN + ".endpoints.sdnc";
+ protected static final String OPENSTACK_PROPERTY = PROPERTY_DOMAIN + ".endpoints.openstack";
+ protected static final String BPMN_PROPERTY = PROPERTY_DOMAIN + ".endpoints.bpmn";
+ protected static final String ASDC_PROPERTY = PROPERTY_DOMAIN + ".endpoints.asdc";
+ protected static final String REQUESTDBATTSVC_PROPERTY = PROPERTY_DOMAIN + ".endpoints.requestdbattsvc";
+ protected static final String MSO_AUTH_PROPERTY = PROPERTY_DOMAIN + ".auth";
+ protected static final String DEFAULT_PROPERTY_VALUE = "";
// e.g. /manage
private String actuatorContextPath;
- private String endpointCatalogdb;
- private String endpointRequestdb;
- private String endpointSdnc;
- private String endpointOpenstack;
- private String endpointBpmn;
- private String endpointAsdc;
- private String endpointRequestdbAttsvc;
@Autowired
private Environment env;
@Autowired
private RestTemplate restTemplate;
- private final String health = "/health";
+ @Autowired
+ private HealthCheckConfig config;
+
+ private static final String HEALTH = "/health";
+
+ private String msoAuth;
@PostConstruct
protected void init() {
actuatorContextPath = env.getProperty(CONTEXTPATH_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointCatalogdb = env.getProperty(CATALOGDB_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointRequestdb = env.getProperty(REQUESTDB_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointSdnc = env.getProperty(SDNC_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointOpenstack = env.getProperty(OPENSTACK_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointBpmn = env.getProperty(BPMN_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointAsdc = env.getProperty(ASDC_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
- endpointRequestdbAttsvc = env.getProperty(REQUESTDBATTSVC_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
+ msoAuth = env.getProperty(MSO_AUTH_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
}
@GET
@@ -108,29 +104,25 @@ public class GlobalHealthcheckHandler {
@Context ContainerRequestContext requestContext) {
Response HEALTH_CHECK_RESPONSE = null;
// Build internal response object
- HealthcheckResponse rsp = new HealthcheckResponse();
+ HealthCheckResponse rsp = new HealthCheckResponse();
try {
// Generated RequestId
String requestId = requestContext.getProperty("requestId").toString();
logger.info(LoggingAnchor.TWO, MessageEnum.APIH_GENERATED_REQUEST_ID.toString(), requestId);
- // set APIH status, this is the main entry point
- rsp.setApih(HealthcheckStatus.UP.toString());
- // set BPMN
- rsp.setBpmn(querySubsystemHealth(MsoSubsystems.BPMN));
- // set SDNCAdapter
- rsp.setSdncAdapter(querySubsystemHealth(MsoSubsystems.SDNC));
- // set ASDCController
- rsp.setAsdcController(querySubsystemHealth(MsoSubsystems.ASDC));
- // set CatalogDbAdapter
- rsp.setCatalogdbAdapter(querySubsystemHealth(MsoSubsystems.CATALOGDB));
- // set RequestDbAdapter
- rsp.setRequestdbAdapter(querySubsystemHealth(MsoSubsystems.REQUESTDB));
- // set OpenStackAdapter
- rsp.setOpenstackAdapter(querySubsystemHealth(MsoSubsystems.OPENSTACK));
- // set RequestDbAdapterAttSvc
- rsp.setRequestdbAdapterAttsvc(querySubsystemHealth(MsoSubsystems.REQUESTDBATT));
+ List<Endpoint> endpoints = config.getEndpoints().stream().filter(item -> {
+ if (!enableBpmn && SoSubsystems.BPMN.equals(item.getSubsystem())) {
+ return false;
+ } else {
+ return true;
+ }
+ }).collect(Collectors.toList());
+
+ for (Endpoint endpoint : endpoints) {
+ rsp.getSubsystems().add(querySubsystemHealth(endpoint));
+ }
+
// set Message
rsp.setMessage(String.format("HttpStatus: %s", HttpStatus.SC_OK));
logger.info(rsp.toString());
@@ -149,70 +141,51 @@ public class GlobalHealthcheckHandler {
protected HttpEntity<String> buildHttpEntityForRequest() {
HttpHeaders headers = new HttpHeaders();
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
- headers.set("Content-Type", "application/json");
+ headers.set(HttpHeaders.CONTENT_TYPE, "application/json");
+ headers.set(HttpHeaders.AUTHORIZATION, msoAuth);
HttpEntity<String> entity = new HttpEntity<>("parameters", headers);
return entity;
}
- protected String querySubsystemHealth(MsoSubsystems subsystem) {
+ protected HealthCheckSubsystem querySubsystemHealth(Endpoint subsystem) {
+ HealthCheckStatus status = HealthCheckStatus.DOWN;
+ URI uri = subsystem.getUri();
try {
// get port number for the subsystem
- String ept = getEndpointUrlForSubsystemEnum(subsystem);
-
// build final endpoint url
- UriBuilder builder = UriBuilder.fromPath(ept).path(actuatorContextPath).path(health);
- URI uri = builder.build();
- logger.info("Calculated URL: {}", uri.toString());
+ uri = UriBuilder.fromUri(subsystem.getUri()).path(actuatorContextPath).path(HEALTH).build();
+ logger.info("Calculated URL: {}", uri);
ResponseEntity<SubsystemHealthcheckResponse> result = restTemplate.exchange(uri, HttpMethod.GET,
buildHttpEntityForRequest(), SubsystemHealthcheckResponse.class);
- return processResponseFromSubsystem(result, subsystem);
+ status = processResponseFromSubsystem(result, subsystem);
+
} catch (Exception ex) {
logger.error("Exception occured in GlobalHealthcheckHandler.querySubsystemHealth() ", ex);
- return HealthcheckStatus.DOWN.toString();
}
+
+ return new HealthCheckSubsystem(subsystem.getSubsystem(), uri, status);
}
- protected String processResponseFromSubsystem(ResponseEntity<SubsystemHealthcheckResponse> result,
- MsoSubsystems subsystem) {
+ protected HealthCheckStatus processResponseFromSubsystem(ResponseEntity<SubsystemHealthcheckResponse> result,
+ Endpoint endpoint) {
if (result == null || result.getStatusCodeValue() != HttpStatus.SC_OK) {
logger.error(String.format("Globalhealthcheck: checking subsystem: %s failed ! result object is: %s",
- subsystem, result == null ? "NULL" : result));
- return HealthcheckStatus.DOWN.toString();
+ endpoint.getSubsystem(), result == null ? "NULL" : result));
+ return HealthCheckStatus.DOWN;
}
SubsystemHealthcheckResponse body = result.getBody();
String status = body.getStatus();
if ("UP".equalsIgnoreCase(status)) {
- return HealthcheckStatus.UP.toString();
+ return HealthCheckStatus.UP;
} else {
- logger.error("{}, query health endpoint did not return UP status!", subsystem);
- return HealthcheckStatus.DOWN.toString();
+ logger.error("{}, query health endpoint did not return UP status!", endpoint.getSubsystem());
+ return HealthCheckStatus.DOWN;
}
}
-
- protected String getEndpointUrlForSubsystemEnum(MsoSubsystems subsystem) {
- switch (subsystem) {
- case SDNC:
- return this.endpointSdnc;
- case ASDC:
- return this.endpointAsdc;
- case BPMN:
- return this.endpointBpmn;
- case CATALOGDB:
- return this.endpointCatalogdb;
- case OPENSTACK:
- return this.endpointOpenstack;
- case REQUESTDB:
- return this.endpointRequestdb;
- case REQUESTDBATT:
- return this.endpointRequestdbAttsvc;
- default:
- return "";
- }
- }
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheck.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheck.java
new file mode 100644
index 0000000000..1899cdd765
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheck.java
@@ -0,0 +1,84 @@
+package org.onap.so.apihandlerinfra;
+
+import java.net.URI;
+import javax.ws.rs.core.UriBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@ConfigurationProperties(prefix = "mso.health.enpoints")
+public class HealthCheck {
+
+ private Subsystem subsystem;
+ private URI uri;
+ private HealthCheckStatus status = HealthCheckStatus.DOWN;
+
+ public HealthCheck() {
+
+ }
+
+ public HealthCheck(String subsystem, String uri) {
+ this.subsystem = SoSubsystems.valueOf(subsystem.toUpperCase());
+ this.uri = UriBuilder.fromUri(uri).build();
+ }
+
+ public HealthCheck(Subsystem subsystem, URI uri) {
+ this.subsystem = subsystem;
+ this.uri = uri;
+ }
+
+ public HealthCheck(Subsystem subsystem, URI uri, HealthCheckStatus status) {
+ this.subsystem = subsystem;
+ this.uri = uri;
+ this.status = status;
+ }
+
+ public Subsystem getSubsystem() {
+ return subsystem;
+ }
+
+ public void setSubsystem(Subsystem component) {
+ this.subsystem = component;
+ }
+
+ public URI getUri() {
+ return uri;
+ }
+
+ public void setUri(URI uri) {
+ this.uri = uri;
+ }
+
+ public HealthCheckStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(HealthCheckStatus status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("subsystem", subsystem).append("uri", uri).append("status", status)
+ .toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof HealthCheck)) {
+ return false;
+ }
+ HealthCheck castOther = (HealthCheck) other;
+ return new EqualsBuilder().append(subsystem, castOther.subsystem).append(uri, castOther.uri)
+ .append(status, castOther.status).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(subsystem).append(uri).append(status).toHashCode();
+ }
+
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConfig.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConfig.java
new file mode 100644
index 0000000000..11fd94bc91
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConfig.java
@@ -0,0 +1,83 @@
+/*-
+ * ============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.apihandlerinfra;
+
+import java.net.URI;
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.validation.annotation.Validated;
+
+@Configuration
+@ConfigurationProperties(prefix = "mso.health")
+@Validated
+public class HealthCheckConfig {
+
+ @NotNull
+ private List<Endpoint> endpoints;
+
+ public List<Endpoint> getEndpoints() {
+ return endpoints;
+ }
+
+ public void setEndpoints(List<Endpoint> endpoints) {
+ this.endpoints = endpoints;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("endpoints", this.endpoints).toString();
+ }
+
+ @Validated
+ public static class Endpoint {
+ @NotNull
+ private Subsystem subsystem;
+ @NotNull
+ private URI uri;
+
+ public Endpoint() {
+
+ }
+
+ public Endpoint(Subsystem subsystem, URI uri) {
+ this.subsystem = subsystem;
+ this.uri = uri;
+ }
+
+ public Subsystem getSubsystem() {
+ return subsystem;
+ }
+
+ public void setSubsystem(Subsystem subsystem) {
+ this.subsystem = subsystem;
+ }
+
+ public URI getUri() {
+ return uri;
+ }
+
+ public void setUri(URI uri) {
+ this.uri = uri;
+ }
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConverter.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConverter.java
new file mode 100644
index 0000000000..ed06018e7b
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConverter.java
@@ -0,0 +1,22 @@
+package org.onap.so.apihandlerinfra;
+
+import java.net.URI;
+import javax.ws.rs.core.UriBuilder;
+import org.springframework.core.convert.TypeDescriptor;
+import org.springframework.stereotype.Component;
+
+@Component
+public class HealthCheckConverter {
+
+
+ public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
+ if (sourceType.getType() == String.class && targetType.getType() == Subsystem.class) {
+ return SoSubsystems.valueOf(((String) source).toUpperCase());
+ } else if (sourceType.getType() == String.class && targetType.getType() == URI.class) {
+ return UriBuilder.fromUri((String) source).build();
+ } else {
+ return source;
+ }
+ }
+
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckResponse.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckResponse.java
new file mode 100644
index 0000000000..5400249c65
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckResponse.java
@@ -0,0 +1,49 @@
+/*-
+ * ============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.apihandlerinfra;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class HealthCheckResponse {
+
+
+ private List<HealthCheckSubsystem> subsystems = new ArrayList<>();
+ private String message;
+
+
+ public List<HealthCheckSubsystem> getSubsystems() {
+ return subsystems;
+ }
+
+ public void setSubsystems(List<HealthCheckSubsystem> subsystems) {
+ this.subsystems = subsystems;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckStatus.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckStatus.java
index 077a3c2d60..6b31c1f1ed 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckStatus.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckStatus.java
@@ -19,12 +19,12 @@
*/
package org.onap.so.apihandlerinfra;
-public enum HealthcheckStatus {
+public enum HealthCheckStatus {
UP("UP"), DOWN("DOWN");
private String status;
- private HealthcheckStatus(String status) {
+ private HealthCheckStatus(String status) {
this.status = status;
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckSubsystem.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckSubsystem.java
new file mode 100644
index 0000000000..e1335b952c
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckSubsystem.java
@@ -0,0 +1,40 @@
+package org.onap.so.apihandlerinfra;
+
+import java.net.URI;
+
+public class HealthCheckSubsystem {
+
+ private Subsystem subsystem;
+ private URI uri;
+ private HealthCheckStatus status;
+
+ public HealthCheckSubsystem(Subsystem subsystem, URI uri, HealthCheckStatus status) {
+ this.subsystem = subsystem;
+ this.uri = uri;
+ this.status = status;
+ }
+
+ public Subsystem getSubsystem() {
+ return subsystem;
+ }
+
+ public void setSubsystem(Subsystem subsystem) {
+ this.subsystem = subsystem;
+ }
+
+ public URI getUri() {
+ return uri;
+ }
+
+ public void setUri(URI uri) {
+ this.uri = uri;
+ }
+
+ public HealthCheckStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(HealthCheckStatus status) {
+ this.status = status;
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java
deleted file mode 100644
index fad3dd4055..0000000000
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java
+++ /dev/null
@@ -1,116 +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.apihandlerinfra;
-
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-public class HealthcheckResponse {
- private String apih;
- private String bpmn;
- private String sdncAdapter;
- private String asdcController;
- private String catalogdbAdapter;
- private String requestdbAdapter;
- private String openstackAdapter;
- private String requestdbAdapterAttsvc;
- private String message = "";
-
- public String getApih() {
- return apih;
- }
-
- public void setApih(String apih) {
- this.apih = apih;
- }
-
- public String getBpmn() {
- return bpmn;
- }
-
- public void setBpmn(String bpmn) {
- this.bpmn = bpmn;
- }
-
- public String getSdncAdapter() {
- return sdncAdapter;
- }
-
- public void setSdncAdapter(String sdncAdapter) {
- this.sdncAdapter = sdncAdapter;
- }
-
- public String getAsdcController() {
- return asdcController;
- }
-
- public void setAsdcController(String asdcController) {
- this.asdcController = asdcController;
- }
-
- public String getCatalogdbAdapter() {
- return catalogdbAdapter;
- }
-
- public void setCatalogdbAdapter(String catalogdbAdapter) {
- this.catalogdbAdapter = catalogdbAdapter;
- }
-
- public String getRequestdbAdapter() {
- return requestdbAdapter;
- }
-
- public void setRequestdbAdapter(String requestdbAdapter) {
- this.requestdbAdapter = requestdbAdapter;
- }
-
- public String getOpenstackAdapter() {
- return openstackAdapter;
- }
-
- public void setOpenstackAdapter(String openstackAdapter) {
- this.openstackAdapter = openstackAdapter;
- }
-
- public String getRequestdbAdapterAttsvc() {
- return requestdbAdapterAttsvc;
- }
-
- public void setRequestdbAdapterAttsvc(String requestdbAdapterAttsvc) {
- this.requestdbAdapterAttsvc = requestdbAdapterAttsvc;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this).append("apih", this.apih).append("pbmn", this.bpmn)
- .append("sdncAdapter", this.sdncAdapter).append("asdcController", this.asdcController)
- .append("catalogdbAdapter", this.catalogdbAdapter).append("requestdbAdapter", this.requestdbAdapter)
- .append("openstackAdapter", this.openstackAdapter)
- .append("requestdbAdapterAttsvc", this.requestdbAdapterAttsvc).append("message", this.message)
- .toString();
- }
-}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java
index 9ab95a2319..b6f3f82ab1 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java
@@ -295,7 +295,7 @@ public class RequestHandlerUtils extends AbstractRestHandler {
String instanceName, String requestScope, InfraActiveRequests currentActiveReq) throws ApiException {
InfraActiveRequests dup = null;
try {
- if (!(instanceName == null && requestScope.equals("service") && (action == Action.createInstance
+ if (!(instanceName == null && "service".equals(requestScope) && (action == Action.createInstance
|| action == Action.activateInstance || action == Action.assignInstance))) {
dup = infraActiveRequestsClient.checkInstanceNameDuplicate(instanceIdMap, instanceName, requestScope);
}
@@ -334,7 +334,7 @@ public class RequestHandlerUtils extends AbstractRestHandler {
updateStatus(duplicateRecord, Status.COMPLETE, "Request Completed");
}
for (HistoricProcessInstance instance : response.getBody()) {
- if (instance.getState().equals("ACTIVE")) {
+ if (("ACTIVE").equals(instance.getState())) {
return true;
} else {
updateStatus(duplicateRecord, Status.COMPLETE, "Request Completed");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/SoSubsystems.java
index 13f1e52068..5842531dc3 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/SoSubsystems.java
@@ -19,18 +19,18 @@
*/
package org.onap.so.apihandlerinfra;
-public enum MsoSubsystems {
+public enum SoSubsystems implements Subsystem {
APIH("API Handler"),
ASDC("ASDC Controller"),
BPMN("BPMN Infra"),
CATALOGDB("CatalogDb Adapter"),
OPENSTACK("Openstack Adapter"),
REQUESTDB("RequestDB Adapter"),
- REQUESTDBATT("RequestDB Adapter ATT Svc"),
SDNC("SDNC Adapter");
+
private String subsystem;
- private MsoSubsystems(String subsystem) {
+ private SoSubsystems(String subsystem) {
this.subsystem = subsystem;
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Subsystem.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Subsystem.java
new file mode 100644
index 0000000000..88626f3168
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Subsystem.java
@@ -0,0 +1,5 @@
+package org.onap.so.apihandlerinfra;
+
+public interface Subsystem {
+
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java
index 928b488f6a..0291cfd2ea 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java
@@ -20,70 +20,67 @@
package org.onap.so.apihandlerinfra;
-import static org.junit.Assert.assertArrayEquals;
+import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyObject;
+import static org.junit.Assert.assertThat;
import static org.mockito.ArgumentMatchers.anyString;
import java.net.URI;
-import java.util.Collections;
-import java.util.List;
-import org.springframework.test.util.ReflectionTestUtils;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
-import org.springframework.core.ParameterizedTypeReference;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
import org.json.JSONException;
-import org.junit.Rule;
import org.junit.Test;
-import org.mockito.InjectMocks;
+import org.junit.runner.RunWith;
import org.mockito.ArgumentMatchers;
-import org.mockito.Mock;
import org.mockito.Mockito;
-import org.mockito.Spy;
-import org.mockito.junit.MockitoJUnit;
-import org.mockito.junit.MockitoRule;
+import org.onap.so.apihandlerinfra.HealthCheckConfig.Endpoint;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.boot.test.mock.mockito.SpyBean;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.web.client.RestTemplate;
+import com.fasterxml.jackson.core.JsonProcessingException;
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = {GenericStringConverter.class, HealthCheckConverter.class},
+ initializers = {ConfigFileApplicationContextInitializer.class})
+@ActiveProfiles("test")
+@EnableConfigurationProperties({HealthCheckConfig.class})
public class GlobalHealthcheckHandlerTest {
- @Mock
- RestTemplate restTemplate;
+ @MockBean
+ private RestTemplate restTemplate;
- @Mock
- ContainerRequestContext requestContext;
+ @MockBean
+ private ContainerRequestContext requestContext;
- @InjectMocks
- @Spy
- GlobalHealthcheckHandler globalhealth;
-
- @Rule
- public MockitoRule mockitoRule = MockitoJUnit.rule();
+ @SpyBean
+ private GlobalHealthcheckHandler globalhealth;
@Test
public void testQuerySubsystemHealthNullResult() {
ReflectionTestUtils.setField(globalhealth, "actuatorContextPath", "/manage");
- ReflectionTestUtils.setField(globalhealth, "endpointBpmn", "http://localhost:8080");
Mockito.when(restTemplate.exchange(ArgumentMatchers.any(URI.class), ArgumentMatchers.any(HttpMethod.class),
ArgumentMatchers.<HttpEntity<?>>any(), ArgumentMatchers.<Class<Object>>any())).thenReturn(null);
- String result = globalhealth.querySubsystemHealth(MsoSubsystems.BPMN);
- System.out.println(result);
- assertEquals(HealthcheckStatus.DOWN.toString(), result);
+ HealthCheckSubsystem result = globalhealth
+ .querySubsystemHealth(new Endpoint(SoSubsystems.BPMN, UriBuilder.fromPath("http://localhost").build()));
+ assertEquals(HealthCheckStatus.DOWN, result.getStatus());
}
@Test
public void testQuerySubsystemHealthNotNullResult() {
ReflectionTestUtils.setField(globalhealth, "actuatorContextPath", "/manage");
- ReflectionTestUtils.setField(globalhealth, "endpointAsdc", "http://localhost:8080");
SubsystemHealthcheckResponse subSystemResponse = new SubsystemHealthcheckResponse();
subSystemResponse.setStatus("UP");
@@ -92,20 +89,13 @@ public class GlobalHealthcheckHandlerTest {
Mockito.when(restTemplate.exchange(ArgumentMatchers.any(URI.class), ArgumentMatchers.any(HttpMethod.class),
ArgumentMatchers.<HttpEntity<?>>any(), ArgumentMatchers.<Class<Object>>any())).thenReturn(r);
- String result = globalhealth.querySubsystemHealth(MsoSubsystems.ASDC);
- System.out.println(result);
- assertEquals(HealthcheckStatus.UP.toString(), result);
+ HealthCheckSubsystem result = globalhealth
+ .querySubsystemHealth(new Endpoint(SoSubsystems.ASDC, UriBuilder.fromPath("http://localhost").build()));
+ assertEquals(HealthCheckStatus.UP, result.getStatus());
}
private Response globalHealthcheck(String status) {
ReflectionTestUtils.setField(globalhealth, "actuatorContextPath", "/manage");
- ReflectionTestUtils.setField(globalhealth, "endpointAsdc", "http://localhost:8080");
- ReflectionTestUtils.setField(globalhealth, "endpointSdnc", "http://localhost:8081");
- ReflectionTestUtils.setField(globalhealth, "endpointBpmn", "http://localhost:8082");
- ReflectionTestUtils.setField(globalhealth, "endpointCatalogdb", "http://localhost:8083");
- ReflectionTestUtils.setField(globalhealth, "endpointOpenstack", "http://localhost:8084");
- ReflectionTestUtils.setField(globalhealth, "endpointRequestdb", "http://localhost:8085");
- ReflectionTestUtils.setField(globalhealth, "endpointRequestdbAttsvc", "http://localhost:8086");
SubsystemHealthcheckResponse subSystemResponse = new SubsystemHealthcheckResponse();
@@ -116,70 +106,41 @@ public class GlobalHealthcheckHandlerTest {
Mockito.when(requestContext.getProperty(anyString())).thenReturn("1234567890");
Response response = globalhealth.globalHealthcheck(true, requestContext);
-
return response;
}
@Test
- public void globalHealthcheckAllUPTest() throws JSONException {
- Response response = globalHealthcheck("UP");
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- HealthcheckResponse root;
- root = (HealthcheckResponse) response.getEntity();
- String apistatus = root.getApih();
- assertTrue(apistatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
- String bpmnstatus = root.getBpmn();
- assertTrue(bpmnstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
- String sdncstatus = root.getSdncAdapter();
- assertTrue(sdncstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
+ public void globalHealthcheckAllUPTest() throws JSONException, JsonProcessingException {
- String asdcstatus = root.getAsdcController();
- assertTrue(asdcstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
+ HealthCheckResponse expected = new HealthCheckResponse();
- String catastatus = root.getCatalogdbAdapter();
- assertTrue(catastatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
- String reqdbstatus = root.getRequestdbAdapter();
- assertTrue(reqdbstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
- String openstatus = root.getOpenstackAdapter();
- assertTrue(openstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
+ for (Subsystem system : SoSubsystems.values()) {
+ expected.getSubsystems().add(new HealthCheckSubsystem(system,
+ UriBuilder.fromUri("http://localhost").build(), HealthCheckStatus.UP));
+ }
+ expected.setMessage("HttpStatus: 200");
+ Response response = globalHealthcheck("UP");
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
+ HealthCheckResponse root;
+ root = (HealthCheckResponse) response.getEntity();
+ assertThat(root, sameBeanAs(expected).ignoring("subsystems.uri").ignoring("subsystems.subsystem"));
- String reqdbattstatus = root.getRequestdbAdapterAttsvc();
- assertTrue(reqdbattstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
}
@Test
public void globalHealthcheckAllDOWNTest() throws JSONException {
+ HealthCheckResponse expected = new HealthCheckResponse();
+
+ for (Subsystem system : SoSubsystems.values()) {
+ expected.getSubsystems().add(new HealthCheckSubsystem(system,
+ UriBuilder.fromUri("http://localhost").build(), HealthCheckStatus.DOWN));
+ }
+ expected.setMessage("HttpStatus: 200");
Response response = globalHealthcheck("DOWN");
assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- HealthcheckResponse root;
- root = (HealthcheckResponse) response.getEntity();
- String apistatus = root.getApih();
- assertTrue(apistatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
- String bpmnstatus = root.getBpmn();
- assertTrue(bpmnstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
- String sdncstatus = root.getSdncAdapter();
- assertTrue(sdncstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
- String asdcstatus = root.getAsdcController();
- assertTrue(asdcstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
- String catastatus = root.getCatalogdbAdapter();
- assertTrue(catastatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
- String reqdbstatus = root.getRequestdbAdapter();
- assertTrue(reqdbstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
- String openstatus = root.getOpenstackAdapter();
- assertTrue(openstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
- String reqdbattstatus = root.getRequestdbAdapterAttsvc();
- assertTrue(reqdbattstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
+ HealthCheckResponse root;
+ root = (HealthCheckResponse) response.getEntity();
+ assertThat(root, sameBeanAs(expected).ignoring("subsystems.uri").ignoring("subsystems.subsystem"));
}
@Test
@@ -189,40 +150,15 @@ public class GlobalHealthcheckHandlerTest {
assertEquals(MediaType.APPLICATION_JSON, he.getHeaders().getContentType());
}
- @Test
- public void getEndpointUrlForSubsystemEnumTest() {
- ReflectionTestUtils.setField(globalhealth, "actuatorContextPath", "/manage");
- ReflectionTestUtils.setField(globalhealth, "endpointAsdc", "http://localhost:8080");
- ReflectionTestUtils.setField(globalhealth, "endpointSdnc", "http://localhost:8081");
- ReflectionTestUtils.setField(globalhealth, "endpointBpmn", "http://localhost:8082");
- ReflectionTestUtils.setField(globalhealth, "endpointCatalogdb", "http://localhost:8083");
- ReflectionTestUtils.setField(globalhealth, "endpointOpenstack", "http://localhost:8084");
- ReflectionTestUtils.setField(globalhealth, "endpointRequestdb", "http://localhost:8085");
- ReflectionTestUtils.setField(globalhealth, "endpointRequestdbAttsvc", "http://localhost:8086");
-
- String result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.ASDC);
- assertEquals("http://localhost:8080", result);
- result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.SDNC);
- assertEquals("http://localhost:8081", result);
- result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.BPMN);
- assertEquals("http://localhost:8082", result);
- result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.CATALOGDB);
- assertEquals("http://localhost:8083", result);
- result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.OPENSTACK);
- assertEquals("http://localhost:8084", result);
- result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.REQUESTDB);
- assertEquals("http://localhost:8085", result);
- result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.REQUESTDBATT);
- assertEquals("http://localhost:8086", result);
- }
@Test
public void processResponseFromSubsystemTest() {
SubsystemHealthcheckResponse subSystemResponse = new SubsystemHealthcheckResponse();
subSystemResponse.setStatus("UP");
ResponseEntity<SubsystemHealthcheckResponse> r = new ResponseEntity<>(subSystemResponse, HttpStatus.OK);
- String result = globalhealth.processResponseFromSubsystem(r, MsoSubsystems.BPMN);
- assertEquals("UP", result);
+ Endpoint endpoint = new Endpoint(SoSubsystems.BPMN, UriBuilder.fromUri("http://localhost").build());
+ HealthCheckStatus result = globalhealth.processResponseFromSubsystem(r, endpoint);
+ assertEquals(HealthCheckStatus.UP, result);
}
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml b/mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml
index 2e1c6a9bdc..27e1ae90d2 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml
@@ -9,14 +9,20 @@ server:
mso:
health:
endpoints:
- catalogdb: http://localhost:${wiremock.server.port}
- requestdb: http://localhost:${wiremock.server.port}
- sdnc: http://localhost:${wiremock.server.port}
- openstack: http://localhost:${wiremock.server.port}
- bpmn: http://localhost:${wiremock.server.port}
- asdc: http://localhost:${wiremock.server.port}
- requestdbattsvc: http://localhost:${wiremock.server.port}
-
+ - subsystem: apih
+ uri: http://localhost:${wiremock.server.port}
+ - subsystem: asdc
+ uri: http://localhost:${wiremock.server.port}
+ - subsystem: bpmn
+ uri: http://localhost:${wiremock.server.port}
+ - subsystem: catalogdb
+ uri: http://localhost:${wiremock.server.port}
+ - subsystem: openstack
+ uri: http://localhost:${wiremock.server.port}
+ - subsystem: requestdb
+ uri: http://localhost:${wiremock.server.port}
+ - subsystem: sdnc
+ uri: http://localhost:${wiremock.server.port}
infra-requests:
archived:
period: 180
@@ -118,7 +124,13 @@ mariaDB4j:
port: 3307
databaseName: catalogdb
databaseName2: requestdb
-
+#Actuator
+management:
+ endpoints:
+ web:
+ base-path: /manage
+ exposure:
+ include: "*"
org:
onap: