diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2019-04-25 14:49:42 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-25 14:49:42 +0000 |
commit | 569e6fd0b9109b04fff6a8816217f845d0ea6f3b (patch) | |
tree | 7204d46e00725f1566e516d569aa2a698a62beee | |
parent | 046eb620661451d3d62638d5253d3e112f565d1a (diff) | |
parent | 16d53674b166a9b3b4bf1a8d911a5c12e77edf7e (diff) |
Merge "Reorder modifiers. Reorder modifiers to complt with Java code specifications Issue-ID: SO-1490"
3 files changed, 35 insertions, 33 deletions
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 87008f1d8f..43eb277d21 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 @@ -91,7 +91,7 @@ public class DeployActivitySpecs { if (activitySpecActivitySpecCategories == null || activitySpecActivitySpecCategories.size() == 0) { return; } - List<String> categoryList = new ArrayList<String>(); + List<String> categoryList = new ArrayList<>(); for (ActivitySpecActivitySpecCategories activitySpecCat : activitySpecActivitySpecCategories) { if (activitySpecCat != null) { if (activitySpecCat.getActivitySpecCategories() != null) { @@ -107,8 +107,8 @@ public class DeployActivitySpecs { if (activitySpecActivitySpecParameters == null || activitySpecActivitySpecParameters.size() == 0) { return; } - List<Input> inputs = new ArrayList<Input>(); - List<Output> outputs = new ArrayList<Output>(); + List<Input> inputs = new ArrayList<>(); + List<Output> outputs = new ArrayList<>(); for (ActivitySpecActivitySpecParameters activitySpecParam : activitySpecActivitySpecParameters) { if (activitySpecParam != null) { if (activitySpecParam.getActivitySpecParameters() != null) { diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java index 9b838c4d98..fc0197dc52 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java @@ -77,6 +77,8 @@ public class ASDCController { protected static final Logger logger = LoggerFactory.getLogger(ASDCController.class); + private static final String UNKNOWN = "Unknown"; + protected boolean isAsdcClientAutoManaged = false; protected String controllerName; @@ -110,6 +112,25 @@ public class ASDCController { @Autowired DeployActivitySpecs deployActivitySpecs; + public ASDCController() { + this(""); + } + + public ASDCController(String controllerConfigName) { + isAsdcClientAutoManaged = true; + this.controllerName = controllerConfigName; + } + + public ASDCController(String controllerConfigName, IDistributionClient asdcClient, + IVfResourceInstaller resourceinstaller) { + distributionClient = asdcClient; + } + + public ASDCController(String controllerConfigName, IDistributionClient asdcClient) { + distributionClient = asdcClient; + this.controllerName = controllerConfigName; + } + public int getNbOfNotificationsOngoing() { return nbOfNotificationsOngoing; } @@ -150,25 +171,6 @@ public class ASDCController { return this.controllerStatus; } - public ASDCController() { - this(""); - } - - public ASDCController(String controllerConfigName) { - isAsdcClientAutoManaged = true; - this.controllerName = controllerConfigName; - } - - public ASDCController(String controllerConfigName, IDistributionClient asdcClient, - IVfResourceInstaller resourceinstaller) { - distributionClient = asdcClient; - } - - public ASDCController(String controllerConfigName, IDistributionClient asdcClient) { - distributionClient = asdcClient; - this.controllerName = controllerConfigName; - } - public String getControllerName() { return controllerName; } @@ -356,7 +358,7 @@ public class ASDCController { for (IArtifactInfo artifactInfo : resourceStructure.getResourceInstance().getArtifacts()) { if ((DistributionStatusEnum.DEPLOY_OK.equals(distribStatus) - && !artifactInfo.getArtifactType().equalsIgnoreCase("OTHER") + && !("OTHER").equalsIgnoreCase(artifactInfo.getArtifactType()) && !resourceStructure.isAlreadyDeployed()) // This could be NULL if the artifact is a VF module artifact, this won't be present in the MAP && resourceStructure.getArtifactsMapByUUID().get(artifactInfo.getArtifactUUID()) != null @@ -442,7 +444,7 @@ public class ASDCController { status.name(), artifactURL, "ASDC", "sendASDCNotification"); logger.debug(event); - String action = ""; + try { IDistributionStatusMessage message = new DistributionStatusMessage(artifactURL, consumerID, distributionID, status, timestamp); @@ -454,7 +456,7 @@ public class ASDCController { } else { this.distributionClient.sendDownloadStatus(message); } - action = "sendDownloadStatus"; + break; case DEPLOY: if (errorReason != null) { @@ -462,7 +464,7 @@ public class ASDCController { } else { this.distributionClient.sendDeploymentStatus(message); } - action = "sendDeploymentdStatus"; + break; default: break; @@ -667,12 +669,12 @@ public class ASDCController { String filePath = msoConfigPath + "/ASDC/" + iArtifact.getArtifactVersion() + "/" + iArtifact.getArtifactName(); File csarFile = new File(filePath); - String csarFilePath = csarFile.getAbsolutePath(); + for (IResourceInstance resource : iNotif.getResources()) { String resourceType = resource.getResourceType(); - String category = resource.getCategory(); + logger.info("Processing Resource Type: {}, Model UUID: {}", resourceType, resource.getResourceUUID()); @@ -832,7 +834,7 @@ public class ASDCController { } } - private static final String UNKNOWN = "Unknown"; + /** * @return the address of the ASDC we are connected to. diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/JsonVfModuleMetaData.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/JsonVfModuleMetaData.java index f4d3e5ce48..20cd9801e9 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/JsonVfModuleMetaData.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/JsonVfModuleMetaData.java @@ -33,16 +33,16 @@ public class JsonVfModuleMetaData implements IVfModuleData { @JsonProperty("artifacts") private List<String> artifacts; @JsonProperty("properties") - // private List<Map<String, Object>> properties = new ArrayList<>(); + private Map<String, String> properties = new HashMap<>(); + @JsonIgnore + private Map<String, Object> attributesMap = new HashMap<>(); + public Map<String, String> getProperties() { return properties; } - @JsonIgnore - private Map<String, Object> attributesMap = new HashMap<>(); - @Override public List<String> getArtifacts() { return artifacts; |