Search in sources :

Example 6 with ClientPolicy

use of com.aerospike.client.policy.ClientPolicy 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.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();
    }
}
Also used : AerospikeClient(com.aerospike.client.AerospikeClient) ClientPolicy(com.aerospike.client.policy.ClientPolicy) Host(com.aerospike.client.Host)

Aggregations

ClientPolicy (com.aerospike.client.policy.ClientPolicy)6 AerospikeClient (com.aerospike.client.AerospikeClient)5 Host (com.aerospike.client.Host)4 AerospikeException (com.aerospike.client.AerospikeException)2 NettyEventLoops (com.aerospike.client.async.NettyEventLoops)2 NioEventLoops (com.aerospike.client.async.NioEventLoops)2 Args (com.aerospike.test.util.Args)2 EventLoopGroup (io.netty.channel.EventLoopGroup)2 EpollEventLoopGroup (io.netty.channel.epoll.EpollEventLoopGroup)2 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)2 BeforeClass (org.junit.BeforeClass)2 EventLoop (com.aerospike.client.async.EventLoop)1 EventLoops (com.aerospike.client.async.EventLoops)1 DBException (com.yahoo.ycsb.DBException)1 IOException (java.io.IOException)1 Properties (java.util.Properties)1 ServletException (javax.servlet.ServletException)1