File src/main/java/com/kingfisher/deployment/audit/controller/DeploymentAuditController.java changed (mode: 100644) (index d162dfd..ae1c9b7) |
1 |
1 |
package com.kingfisher.deployment.audit.controller;
|
package com.kingfisher.deployment.audit.controller;
|
2 |
2 |
|
|
3 |
|
import java.io.IOException;
|
|
4 |
|
import java.net.URISyntaxException;
|
|
5 |
|
import java.security.InvalidAlgorithmParameterException;
|
|
6 |
|
import java.security.InvalidKeyException;
|
|
7 |
|
import java.security.NoSuchAlgorithmException;
|
|
8 |
|
|
|
9 |
|
import javax.crypto.BadPaddingException;
|
|
10 |
|
import javax.crypto.IllegalBlockSizeException;
|
|
11 |
|
import javax.crypto.NoSuchPaddingException;
|
|
12 |
|
|
|
13 |
3 |
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
14 |
4 |
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
15 |
5 |
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
File src/main/java/com/kingfisher/deployment/audit/service/DeploymentAuditService.java changed (mode: 100644) (index 96aac17..8d72e5a) |
... |
... |
public class DeploymentAuditService { |
86 |
86 |
*/
|
*/
|
87 |
87 |
private Map<String, List<Deployment>> prepareDataForApplication(String application, String referenceEnv, List<String> reportingEnvs) throws DeploymentAuditException {
|
private Map<String, List<Deployment>> prepareDataForApplication(String application, String referenceEnv, List<String> reportingEnvs) throws DeploymentAuditException {
|
88 |
88 |
Map<String, List<Deployment>> latestDeploymentsInEnvironmentForApplication = new HashMap<>();
|
Map<String, List<Deployment>> latestDeploymentsInEnvironmentForApplication = new HashMap<>();
|
89 |
|
|
|
90 |
89 |
latestDeploymentsInEnvironmentForApplication.put(referenceEnv, updateDeploymentsWithIIBapi(deploymentRepository.findLatestDeploymentByApplicationNameAndEnvironment(referenceEnv, application)));
|
latestDeploymentsInEnvironmentForApplication.put(referenceEnv, updateDeploymentsWithIIBapi(deploymentRepository.findLatestDeploymentByApplicationNameAndEnvironment(referenceEnv, application)));
|
91 |
|
|
|
92 |
90 |
for (String reportingEnv : reportingEnvs)
|
for (String reportingEnv : reportingEnvs)
|
93 |
|
|
|
94 |
91 |
latestDeploymentsInEnvironmentForApplication.put(reportingEnv, updateDeploymentsWithIIBapi(deploymentRepository.findLatestDeploymentByApplicationNameAndEnvironment(reportingEnv, application)));
|
latestDeploymentsInEnvironmentForApplication.put(reportingEnv, updateDeploymentsWithIIBapi(deploymentRepository.findLatestDeploymentByApplicationNameAndEnvironment(reportingEnv, application)));
|
95 |
|
|
|
96 |
92 |
return latestDeploymentsInEnvironmentForApplication;
|
return latestDeploymentsInEnvironmentForApplication;
|
97 |
93 |
}
|
}
|
98 |
94 |
|
|
99 |
95 |
private List<Deployment> updateDeploymentsWithIIBapi(List<Deployment> deployments) throws DeploymentAuditException {
|
private List<Deployment> updateDeploymentsWithIIBapi(List<Deployment> deployments) throws DeploymentAuditException {
|
100 |
96 |
for (Deployment deployment : deployments) {
|
for (Deployment deployment : deployments) {
|
101 |
97 |
Instance instance = instanceRepository.findByInstanceName(deployment.getInstanceName());
|
Instance instance = instanceRepository.findByInstanceName(deployment.getInstanceName());
|
102 |
|
IIBDeploymentStatus iibDeploymentStatus = iibRestClient.getDeployemntProperties(deployment.getIntegrationServer(), deployment.getApplicationName(), instance.getHost(), instance.getApiPort(), instance.getApiUsername(), passwordCodec.decrypt(instance.getApiPassword()));
|
|
|
98 |
|
//IIBDeploymentStatus iibDeploymentStatus = iibRestClient.getDeployemntProperties(deployment.getIntegrationServer(), deployment.getApplicationName(), instance.getHost(), instance.getApiPort(), instance.getApiUsername(), passwordCodec.decrypt(instance.getApiPassword()));
|
103 |
99 |
}
|
}
|
104 |
100 |
return deployments;
|
return deployments;
|
105 |
101 |
}
|
}
|