Class SqlUserUtil


  • public class SqlUserUtil
    extends Object
    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 using Vert.x codegen.

    • Constructor Detail

      • SqlUserUtil

        public SqlUserUtil​(io.vertx.ext.auth.sqlclient.SqlUserUtil delegate)
      • SqlUserUtil

        public SqlUserUtil​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.ext.auth.sqlclient.SqlUserUtil getDelegate()
      • hashCode

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

        public static SqlUserUtil create​(SqlClient client)
        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)
        Parameters:
        client - the client with write rights to the database.
        insertUserSQL -
        insertUserRoleSQL -
        insertRolePermissionSQL -
        Returns:
        the instance
      • createUser

        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. 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:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • createUserAndAwait

        public Void createUserAndAwait​(String username,
                                       String password)
        Blocking variant of createUser(String,String).

        This method waits 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
        Returns:
        the Void instance produced by the operation.
      • createUserAndForget

        public SqlUserUtil createUserAndForget​(String username,
                                               String password)
        Variant of createUser(String,String) that ignores the result of the operation.

        This method subscribes on the result of createUser(String,String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from createUser(String,String) but you don't need to compose it with other operations.

        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 instance of SqlUserUtil to chain method calls.
      • createUserRole

        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. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        username - the username to be set
        role - a to be set
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • createUserRoleAndAwait

        public Void createUserRoleAndAwait​(String username,
                                           String role)
        Blocking variant of createUserRole(String,String).

        This method waits 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
        Returns:
        the Void instance produced by the operation.
      • createUserRoleAndForget

        public SqlUserUtil createUserRoleAndForget​(String username,
                                                   String role)
        Variant of createUserRole(String,String) that ignores the result of the operation.

        This method subscribes on the result of createUserRole(String,String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from createUserRole(String,String) but you don't need to compose it with other operations.

        Parameters:
        username - the username to be set
        role - a to be set
        Returns:
        the instance of SqlUserUtil to chain method calls.
      • createRolePermission

        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. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        role - a to be set
        permission - the permission to be set
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • createRolePermissionAndAwait

        public Void createRolePermissionAndAwait​(String role,
                                                 String permission)
        Blocking variant of createRolePermission(String,String).

        This method waits 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
        Returns:
        the Void instance produced by the operation.
      • newInstance

        public static SqlUserUtil newInstance​(io.vertx.ext.auth.sqlclient.SqlUserUtil arg)