Search in sources :

Example 1 with AppInfo

use of iris.client_bff.status.AppInfo in project iris-client by iris-connect.

the class EPSStatusClient method checkApp.

public AppInfo checkApp(String epsEndpoint) {
    var methodName = epsEndpoint + "._ping";
    try {
        var ping = epsRpcClient.invoke(methodName, null, Ping.class);
        var name = ping.serverInfo != null ? ping.serverInfo.name : messages.getMessage("StatusService.unknown_app_name");
        return new AppInfo(name, ping.version);
    } catch (ConnectException | SocketTimeoutException e) {
        // Connection timeout
        throw new EpsConnectionException(e.getMessage());
    } catch (JsonRpcClientException e) {
        throw new AppStatusException(e.getMessage());
    } catch (Throwable t) {
        throw new AppStatusInternalException(t.getMessage(), t);
    }
}
Also used : EpsConnectionException(iris.client_bff.status.EpsConnectionException) SocketTimeoutException(java.net.SocketTimeoutException) JsonRpcClientException(com.googlecode.jsonrpc4j.JsonRpcClientException) AppStatusException(iris.client_bff.status.AppStatusException) AppStatusInternalException(iris.client_bff.status.AppStatusInternalException) AppInfo(iris.client_bff.status.AppInfo) ConnectException(java.net.ConnectException)

Aggregations

JsonRpcClientException (com.googlecode.jsonrpc4j.JsonRpcClientException)1 AppInfo (iris.client_bff.status.AppInfo)1 AppStatusException (iris.client_bff.status.AppStatusException)1 AppStatusInternalException (iris.client_bff.status.AppStatusInternalException)1 EpsConnectionException (iris.client_bff.status.EpsConnectionException)1 ConnectException (java.net.ConnectException)1 SocketTimeoutException (java.net.SocketTimeoutException)1