Search in sources :

Example 21 with AdminCommand

use of com.aerospike.client.admin.AdminCommand in project aerospike-client-java by aerospike.

the class AerospikeClient method setQuotas.

/**
 * Set maximum reads/writes per second limits for a role.  If a quota is zero, the limit is removed.
 * Quotas require server security configuration "enable-quotas" to be set to true.
 *
 * @param policy				admin configuration parameters, pass in null for defaults
 * @param roleName				role name
 * @param readQuota				maximum reads per second limit, pass in zero for no limit.
 * @param writeQuota			maximum writes per second limit, pass in zero for no limit.
 * @throws AerospikeException	if command fails
 */
public final void setQuotas(AdminPolicy policy, String roleName, int readQuota, int writeQuota) throws AerospikeException {
    AdminCommand command = new AdminCommand();
    command.setQuotas(cluster, policy, roleName, readQuota, writeQuota);
}
Also used : AdminCommand(com.aerospike.client.admin.AdminCommand)

Example 22 with AdminCommand

use of com.aerospike.client.admin.AdminCommand in project aerospike-client-java by aerospike.

the class AerospikeClient method revokePrivileges.

/**
 * Revoke privileges from an user defined role.
 *
 * @param policy				admin configuration parameters, pass in null for defaults
 * @param roleName				role name
 * @param privileges			privileges assigned to the role.
 * @throws AerospikeException	if command fails
 */
public final void revokePrivileges(AdminPolicy policy, String roleName, List<Privilege> privileges) throws AerospikeException {
    AdminCommand command = new AdminCommand();
    command.revokePrivileges(cluster, policy, roleName, privileges);
}
Also used : AdminCommand(com.aerospike.client.admin.AdminCommand)

Aggregations

AdminCommand (com.aerospike.client.admin.AdminCommand)22 AerospikeException (com.aerospike.client.AerospikeException)2 ByteBuf (io.netty.buffer.ByteBuf)2 ChannelFuture (io.netty.channel.ChannelFuture)2 ChannelFutureListener (io.netty.channel.ChannelFutureListener)2 AsyncConnection (com.aerospike.client.async.AsyncConnection)1 InetSocketAddress (java.net.InetSocketAddress)1 UnknownHostException (java.net.UnknownHostException)1