Examples of AdminCommand


Examples of com.aerospike.client.command.AdminCommand

    if (cluster.getUser() == null) {
      throw new AerospikeException("Invalid user");
    }

    String hash = AdminCommand.hashPassword(password);
    AdminCommand command = new AdminCommand();
    byte[] userBytes = Buffer.stringToUtf8(user);

    if (Arrays.equals(userBytes, cluster.getUser())) {
      // Change own password.
      command.changePassword(cluster, policy, userBytes, hash);
    }
    else {
      // Change other user's password by user admin.
      command.setPassword(cluster, policy, userBytes, hash);
    }
    cluster.changePassword(userBytes, hash);
  }
View Full Code Here

Examples of com.aerospike.client.command.AdminCommand

   * @param user          user name
   * @param roles          role names.  Valid roles are listed in Role.cs
   * @throws AerospikeException  if command fails
   */
  public void GrantRoles(AdminPolicy policy, String user, List<String> roles) throws AerospikeException {
    AdminCommand command = new AdminCommand();
    command.grantRoles(cluster, policy, user, roles);
  }
View Full Code Here

Examples of com.aerospike.client.command.AdminCommand

   * @param user          user name
   * @param roles          role names.  Valid roles are listed in Role.cs
   * @throws AerospikeException  if command fails
   */
  public void RevokeRoles(AdminPolicy policy, String user, List<String> roles) throws AerospikeException {
    AdminCommand command = new AdminCommand();
    command.revokeRoles(cluster, policy, user, roles);
  }
View Full Code Here

Examples of com.aerospike.client.command.AdminCommand

   * @param user          user name
   * @param roles          role names.  Valid roles are listed in Role.cs
   * @throws AerospikeException  if command fails
   */
  public void ReplaceRoles(AdminPolicy policy, String user, List<String> roles) throws AerospikeException {
    AdminCommand command = new AdminCommand();
    command.replaceRoles(cluster, policy, user, roles);
  }
View Full Code Here

Examples of com.aerospike.client.command.AdminCommand

   * @param policy        admin configuration parameters, pass in null for defaults
   * @param user          user name filter
   * @throws AerospikeException  if command fails
   */
  public UserRoles QueryUser(AdminPolicy policy, String user) throws AerospikeException {
    AdminCommand command = new AdminCommand();
    return command.queryUser(cluster, policy, user);
  }
View Full Code Here

Examples of com.aerospike.client.command.AdminCommand

   *
   * @param policy        admin configuration parameters, pass in null for defaults
   * @throws AerospikeException  if command fails
   */
  public List<UserRoles> QueryUsers(AdminPolicy policy) throws AerospikeException {
    AdminCommand command = new AdminCommand();
    return command.queryUsers(cluster, policy);
  }
View Full Code Here

Examples of com.aerospike.client.command.AdminCommand

    }
    conn = new Connection(address, timeoutMillis, cluster.maxSocketIdle);
   
    if (cluster.user != null) {
      try {
        AdminCommand command = new AdminCommand();
        command.authenticate(conn, cluster.user, cluster.password);
      }
      catch (AerospikeException ae) {
        // Socket not authenticated.  Do not put back into pool.
        conn.close();
        throw ae;
View Full Code Here

Examples of com.aerospike.client.command.AdminCommand

        InetSocketAddress address = new InetSocketAddress(alias.name, alias.port);
        Connection conn = new Connection(address, cluster.getConnectionTimeout());
       
        try {     
          if (cluster.user != null) {
            AdminCommand command = new AdminCommand();
            command.authenticate(conn, cluster.user, cluster.password);
          }
          HashMap<String,String> map = Info.request(conn, "node", "build");
          String nodeName = map.get("node");
         
          if (nodeName != null) {
View Full Code Here

Examples of com.aerospike.client.command.AdminCommand

        conn = new AsyncConnection(node.getAddress(), cluster);
     
        if (cluster.getUser() != null) {
          inAuthenticate = true;
          dataBuffer = ThreadLocalData.getBuffer();
          AdminCommand command = new AdminCommand(dataBuffer);
          dataOffset = command.setAuthenticate(cluster.getUser(), cluster.getPassword());
          byteBuffer.clear();
          byteBuffer.put(dataBuffer, 0, dataOffset);
          byteBuffer.flip();
          conn.execute(this);
          return;
View Full Code Here

Examples of org.glassfish.api.admin.AdminCommand

    public ActionReport runCommand(final String command,
            final ParameterMap parameters,
            final ActionReport report,
            final Subject subject) {
        try {
            final AdminCommand adminCommand = commandRunner.getCommand(command, report, logger);
            if (adminCommand==null) {
                // maybe commandRunner already reported the failure?
                if (report.getActionExitCode() == ActionReport.ExitCode.FAILURE)
                    return report;
                String message =
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.