use of com.aerospike.client.AerospikeClient in project aerospike-client-java by aerospike.
the class Example method runExamples.
/**
* Connect and run one or more client examples.
*/
public static void runExamples(Console console, Parameters params, List<String> examples) throws Exception {
ClientPolicy policy = new ClientPolicy();
policy.user = params.user;
policy.password = params.password;
policy.authMode = params.authMode;
policy.tlsPolicy = params.tlsPolicy;
params.policy = policy.readPolicyDefault;
params.writePolicy = policy.writePolicyDefault;
Host[] hosts = Host.parseHosts(params.host, params.port);
AerospikeClient client = new AerospikeClient(policy, hosts);
try {
params.setServerSpecific(client);
for (String exampleName : examples) {
runExample(exampleName, client, params, console);
}
} finally {
client.close();
}
}
Aggregations