use of org.nzbhydra.GenericResponse in project nzbhydra2 by theotherp.
the class Sabnzbd method checkConnection.
@Override
public GenericResponse checkConnection() {
logger.debug("Checking connection");
UriComponentsBuilder baseUrl = getBaseUrl();
try {
restTemplate.exchange(baseUrl.queryParam("mode", "get_cats").toUriString(), HttpMethod.GET, null, CategoriesResponse.class);
logger.info("Connection check with sabnzbd using URL {} successful", baseUrl.toUriString());
return new GenericResponse(true, null);
} catch (RestClientException e) {
logger.info("Connection check with sabnzbd using URL {} failed: {}", baseUrl.toUriString(), e.getMessage());
return new GenericResponse(false, e.getMessage());
}
}
use of org.nzbhydra.GenericResponse in project nzbhydra2 by theotherp.
the class NzbGet method checkConnection.
@Override
public GenericResponse checkConnection() {
logger.debug("Checking connection");
try {
boolean successful = client.invoke("writelog", new Object[] { "INFO", "NZBHydra 2 connected to test connection" }, Boolean.class);
logger.info("Connection check to NZBGet using URL {} successful", downloaderConfig.getUrl());
return new GenericResponse(successful, null);
} catch (Throwable e) {
logger.error("Connection check to NZBGet using URL {} failed", downloaderConfig.getUrl());
return new GenericResponse(false, e.getMessage());
}
}
Aggregations