use of uk.ac.ebi.spot.goci.curation.model.Ping in project goci by EBISPOT.
the class DailyEnsemblPing method pingEnsembl.
@Scheduled(cron = "0 0 7 * * *")
public void pingEnsembl() {
RestTemplate restTemplate = new RestTemplate();
String url = "http://rest.ensembl.org/info/ping?content-type=application/json";
Ping ping = new Ping();
try {
ping = restTemplate.getForObject(url, Ping.class);
Integer num = ping.getPing();
getLog().info("Pinging Ensembl: " + url);
if (num != 1) {
mailService.sendEnsemblPingFailureMail();
getLog().error("Pinging Ensembl returned " + num);
} else {
getLog().info("Pinging Ensembl returned " + num);
}
} catch (Exception e) {
getLog().error("Pinging Ensembl failed", e);
mailService.sendEnsemblPingFailureMail();
}
}
Aggregations