import java.util.Date;
-import org.onap.clamp.clds.dao.CldsDao;
import org.onap.clamp.clds.model.CldsHealthCheck;
import org.onap.clamp.clds.util.LoggingUtils;
import org.onap.clamp.clds.util.ONAPLogConstants;
+import org.onap.clamp.loop.LoopController;
import org.slf4j.event.Level;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
public class CldsHealthcheckService {
@Autowired
- private CldsDao cldsDao;
+ private LoopController loopController;
protected static final EELFLogger logger = EELFManager.getInstance().getLogger(CldsHealthcheckService.class);
LoggingUtils.setTimeContext(startTime, new Date());
boolean healthcheckFailed = false;
try {
- cldsDao.doHealthCheck();
+ loopController.getLoopNames();
cldsHealthCheck.setHealthCheckComponent("CLDS-APP");
cldsHealthCheck.setHealthCheckStatus("UP");
cldsHealthCheck.setDescription("OK");
LoggingUtils.setTimeContext(startTime, new Date());
if (healthcheckFailed) {
util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), "Healthcheck failed", Level.INFO,
- ONAPLogConstants.ResponseStatus.ERROR);
+ ONAPLogConstants.ResponseStatus.ERROR);
return new ResponseEntity<>(cldsHealthCheck, HttpStatus.INTERNAL_SERVER_ERROR);
} else {
- util.exiting("200", "Healthcheck failed", Level.INFO,
- ONAPLogConstants.ResponseStatus.COMPLETED);
+ util.exiting("200", "Healthcheck failed", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
return new ResponseEntity<>(cldsHealthCheck, HttpStatus.OK);
}
}