Class SqlUserUtil

java.lang.Object
io.vertx.mutiny.ext.auth.sqlclient.SqlUserUtil
All Implemented Interfaces:
MutinyDelegate

public class SqlUserUtil extends Object implements MutinyDelegate
Utility to create users/roles/permissions. This is a helper class and not intended to be a full user management utility. While the standard authentication and authorization interfaces will require usually read only access to the database, in order to use this API a full read/write access must be granted.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

See Also:
  • SqlUserUtil
  • Field Details

  • Constructor Details

    • SqlUserUtil

      public SqlUserUtil(io.vertx.ext.auth.sqlclient.SqlUserUtil delegate)
      Create a new instance of SqlUserUtil delegating to the given (non-null) instance of SqlUserUtil.
    • SqlUserUtil

      public SqlUserUtil(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.auth.sqlclient.SqlUserUtil getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • createUser

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> createUser(String username, String password)
      Insert a user into a database.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      username - the username to be set
      password - the passsword in clear text, will be adapted following the definitions of the defined strategy
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SqlUserUtil.createUser(String, String)
    • createUserAndAwait

      public void createUserAndAwait(String username, String password)
      Insert a user into a database.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      username - the username to be set
      password - the passsword in clear text, will be adapted following the definitions of the defined strategy
      See Also:
      • SqlUserUtil.createUser(String, String)
    • createUserAndForget

      public SqlUserUtil createUserAndForget(String username, String password)
      Insert a user into a database.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      username - the username to be set
      password - the passsword in clear text, will be adapted following the definitions of the defined strategy
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SqlUserUtil.createUser(String, String)
    • createHashedUser

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> createHashedUser(String username, String hash)
      Insert a user into a database.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      username - the username to be set
      hash - the password hash, as result of io.vertx.ext.auth.HashingStrategy#hash(String, Map, String, String)
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SqlUserUtil.createHashedUser(String, String)
    • createHashedUserAndAwait

      public void createHashedUserAndAwait(String username, String hash)
      Insert a user into a database.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      username - the username to be set
      hash - the password hash, as result of io.vertx.ext.auth.HashingStrategy#hash(String, Map, String, String)
      See Also:
      • SqlUserUtil.createHashedUser(String, String)
    • createHashedUserAndForget

      public SqlUserUtil createHashedUserAndForget(String username, String hash)
      Insert a user into a database.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      username - the username to be set
      hash - the password hash, as result of io.vertx.ext.auth.HashingStrategy#hash(String, Map, String, String)
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SqlUserUtil.createHashedUser(String, String)
    • createUserRole

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> createUserRole(String username, String role)
      Insert a user role into a database.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      username - the username to be set
      role - a to be set
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SqlUserUtil.createUserRole(String, String)
    • createUserRoleAndAwait

      public void createUserRoleAndAwait(String username, String role)
      Insert a user role into a database.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      username - the username to be set
      role - a to be set
      See Also:
      • SqlUserUtil.createUserRole(String, String)
    • createUserRoleAndForget

      public SqlUserUtil createUserRoleAndForget(String username, String role)
      Insert a user role into a database.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      username - the username to be set
      role - a to be set
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SqlUserUtil.createUserRole(String, String)
    • createRolePermission

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> createRolePermission(String role, String permission)
      Insert a role permission into a database.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      role - a to be set
      permission - the permission to be set
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SqlUserUtil.createRolePermission(String, String)
    • createRolePermissionAndAwait

      public void createRolePermissionAndAwait(String role, String permission)
      Insert a role permission into a database.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      role - a to be set
      permission - the permission to be set
      See Also:
      • SqlUserUtil.createRolePermission(String, String)
    • createRolePermissionAndForget

      public SqlUserUtil createRolePermissionAndForget(String role, String permission)
      Insert a role permission into a database.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      role - a to be set
      permission - the permission to be set
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SqlUserUtil.createRolePermission(String, String)
    • create

      public static SqlUserUtil create(SqlClient client)
      Create an instance of the user helper.
      Parameters:
      client - the client with write rights to the database.
      Returns:
      the instance
    • create

      public static SqlUserUtil create(SqlClient client, String insertUserSQL, String insertUserRoleSQL, String insertRolePermissionSQL)
      Create an instance of the user helper with custom queries.
      Parameters:
      client - the client with write rights to the database.
      Returns:
      the instance
    • newInstance

      public static SqlUserUtil newInstance(io.vertx.ext.auth.sqlclient.SqlUserUtil delegate)
      Creates a new instance of the SqlUserUtil.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object