Search in sources :

Example 1 with MetaClient

use of co.cask.cdap.client.MetaClient in project cdap by caskdata.

the class CLIConfig method checkConnection.

private void checkConnection(ClientConfig baseClientConfig, ConnectionConfig connectionInfo, AccessToken accessToken) throws IOException, UnauthenticatedException, UnauthorizedException {
    ClientConfig clientConfig = new ClientConfig.Builder(baseClientConfig).setConnectionConfig(connectionInfo).setAccessToken(accessToken).build();
    MetaClient metaClient = new MetaClient(clientConfig);
    try {
        metaClient.ping();
    } catch (IOException e) {
        throw new IOException("Check hostname and/or port", e);
    }
}
Also used : MetaClient(co.cask.cdap.client.MetaClient) IOException(java.io.IOException) ClientConfig(co.cask.cdap.client.config.ClientConfig)

Aggregations

MetaClient (co.cask.cdap.client.MetaClient)1 ClientConfig (co.cask.cdap.client.config.ClientConfig)1 IOException (java.io.IOException)1