use of co.cask.cdap.client.config.ClientConfig in project cdap by caskdata.
the class CLITestBase method createCLIConfig.
protected static CLIConfig createCLIConfig(URI standaloneUri) throws Exception {
ConnectionConfig connectionConfig = InstanceURIParser.DEFAULT.parse(standaloneUri.toString());
ClientConfig clientConfig = new ClientConfig.Builder().setConnectionConfig(connectionConfig).build();
clientConfig.setAllTimeouts(60000);
return new CLIConfig(clientConfig, System.out, new CsvTableRenderer());
}
use of co.cask.cdap.client.config.ClientConfig 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);
}
}
Aggregations