Search in sources :

Example 1 with Ready

use of com.influxdb.client.domain.Ready in project openhab-addons by openhab.

the class InfluxDBClientFacadeImpl method checkConnectionStatus.

private boolean checkConnectionStatus() {
    final InfluxDBClient currentClient = client;
    if (currentClient != null) {
        Ready ready = currentClient.ready();
        boolean isUp = ready != null && ready.getStatus() == Ready.StatusEnum.READY;
        if (isUp) {
            logger.debug("database status is OK");
        } else {
            logger.warn("database not ready");
        }
        return isUp;
    } else {
        logger.warn("checkConnection: database is not connected");
        return false;
    }
}
Also used : InfluxDBClient(com.influxdb.client.InfluxDBClient) Ready(com.influxdb.client.domain.Ready)

Example 2 with Ready

use of com.influxdb.client.domain.Ready in project openhab-addons by openhab.

the class InfluxDB2RepositoryImpl method checkConnectionStatus.

/**
 * Check if connection is currently ready
 *
 * @return True if its ready, otherwise false
 */
@Override
public boolean checkConnectionStatus() {
    final InfluxDBClient currentClient = client;
    if (currentClient != null) {
        Ready ready = currentClient.ready();
        boolean isUp = ready != null && ready.getStatus() == Ready.StatusEnum.READY;
        if (isUp) {
            logger.debug("database status is OK");
        } else {
            logger.warn("database not ready");
        }
        return isUp;
    } else {
        logger.warn("checkConnection: database is not connected");
        return false;
    }
}
Also used : InfluxDBClient(com.influxdb.client.InfluxDBClient) Ready(com.influxdb.client.domain.Ready)

Example 3 with Ready

use of com.influxdb.client.domain.Ready in project addons by smarthomej.

the class InfluxDB2RepositoryImpl method checkConnectionStatus.

/**
 * Check if connection is currently ready
 *
 * @return True if its ready, otherwise false
 */
@Override
public boolean checkConnectionStatus() {
    final InfluxDBClient currentClient = client;
    if (currentClient != null) {
        Ready ready = currentClient.ready();
        boolean isUp = ready != null && ready.getStatus() == Ready.StatusEnum.READY;
        if (isUp) {
            logger.debug("database status is OK");
        } else {
            logger.warn("database not ready");
        }
        return isUp;
    } else {
        logger.warn("checkConnection: database is not connected");
        return false;
    }
}
Also used : InfluxDBClient(com.influxdb.client.InfluxDBClient) Ready(com.influxdb.client.domain.Ready)

Aggregations

InfluxDBClient (com.influxdb.client.InfluxDBClient)3 Ready (com.influxdb.client.domain.Ready)3