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 RX-ified interface using Vert.x codegen.

    • Constructor Detail

      • SqlUserUtil

        public SqlUserUtil​(SqlUserUtil delegate)
      • SqlUserUtil

        public SqlUserUtil​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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.
        insertUserSQL -
        insertUserRoleSQL -
        insertRolePermissionSQL -
        Returns:
        the instance
      • createUser

        public SqlUserUtil createUser​(String username,
                                      String password,
                                      Handler<AsyncResult<Void>> resultHandler)
        Insert a user into a database.
        Parameters:
        username - the username to be set
        password - the passsword in clear text, will be adapted following the definitions of the defined strategy
        resultHandler - the ResultHandler will be provided with the result of the operation
        Returns:
        fluent self
      • createUser

        public SqlUserUtil createUser​(String username,
                                      String password)
        Insert a user into a database.
        Parameters:
        username - the username to be set
        password - the passsword in clear text, will be adapted following the definitions of the defined strategy
        Returns:
        fluent self
      • rxCreateUser

        public rx.Single<Void> rxCreateUser​(String username,
                                            String password)
        Insert a user into a database.
        Parameters:
        username - the username to be set
        password - the passsword in clear text, will be adapted following the definitions of the defined strategy
        Returns:
        fluent self
      • createUserRole

        public SqlUserUtil createUserRole​(String username,
                                          String role,
                                          Handler<AsyncResult<Void>> resultHandler)
        Insert a user role into a database.
        Parameters:
        username - the username to be set
        role - a to be set
        resultHandler - the ResultHandler will be provided with the result of the operation
        Returns:
        fluent self
      • createUserRole

        public SqlUserUtil createUserRole​(String username,
                                          String role)
        Insert a user role into a database.
        Parameters:
        username - the username to be set
        role - a to be set
        Returns:
        fluent self
      • rxCreateUserRole

        public rx.Single<Void> rxCreateUserRole​(String username,
                                                String role)
        Insert a user role into a database.
        Parameters:
        username - the username to be set
        role - a to be set
        Returns:
        fluent self
      • createRolePermission

        public SqlUserUtil createRolePermission​(String role,
                                                String permission,
                                                Handler<AsyncResult<Void>> resultHandler)
        Insert a role permission into a database.
        Parameters:
        role - a to be set
        permission - the permission to be set
        resultHandler - the ResultHandler will be provided with the result of the operation
        Returns:
        fluent self
      • createRolePermission

        public SqlUserUtil createRolePermission​(String role,
                                                String permission)
        Insert a role permission into a database.
        Parameters:
        role - a to be set
        permission - the permission to be set
        Returns:
        fluent self
      • rxCreateRolePermission

        public rx.Single<Void> rxCreateRolePermission​(String role,
                                                      String permission)
        Insert a role permission into a database.
        Parameters:
        role - a to be set
        permission - the permission to be set
        Returns:
        fluent self