com.infusers.core.eng.selfheal.SelfHealService Maven / Gradle / Ivy
package com.infusers.core.eng.selfheal;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.server.ResponseStatusException;
import com.infusers.core.eng.selfheal.deployment.CloudProviderService;
import com.infusers.core.eng.selfheal.insights.spring.pom.dto.ArtifactDependencyInsightDto;
import com.infusers.core.eng.selfheal.insights.spring.pom.dto.POMInsightDTO;
import com.infusers.core.eng.selfheal.util.SelfHealUtil;
import com.infusers.core.eng.selfheal.version.java.JavaVersionDetails;
import com.infusers.core.eng.selfheal.version.spring.VersionDependencyDetails;
@Service
public class SelfHealService {
private final Logger log = LogManager.getLogger(SelfHealService.class);
private static final String CLASS_NAME = "SelfHealService";
@Autowired(required = true)
private CloudProviderService cloudProviderService;
private ArtifactDependencyInsightDto infuserLibDependencyDto;
@Value("${infusers.app.name}")
private String appName;
@Value("${commit.timestamp}")
private String versionCommitTime;
@Value("${version.number}")
private String version;
private static final String LINE_SEPARATOR = System.lineSeparator();
private static final String PREFIX = " -- ";
public SelfHealService() {
init();
}
private void init() {
infuserLibDependencyDto = new ArtifactDependencyInsightDto("in.infusers.library", "infusers-library", "", POMInsightDTO.NO_PARENT);
String presentVersion = VersionDependencyDetails.getInstance().getDependencyVersion(infuserLibDependencyDto.getGroupId(), infuserLibDependencyDto.getArtifactId());
presentVersion = presentVersion!=null ? presentVersion.trim() : presentVersion;
infuserLibDependencyDto.setVersion(presentVersion);
infuserLibDependencyDto.fillLatestVersionV2();
}
public ResponseEntity
© 2015 - 2025 Weber Informatics LLC | Privacy Policy