Package com.exasol.dbbuilder.dialects
Class AbstractUser
- java.lang.Object
-
- com.exasol.dbbuilder.dialects.AbstractDatabaseObject
-
- com.exasol.dbbuilder.dialects.AbstractUser
-
- All Implemented Interfaces:
DatabaseObject,User
- Direct Known Subclasses:
ExasolUser,MySqlUser
public abstract class AbstractUser extends AbstractDatabaseObject implements User
This class contains common logic for a database user.
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<GlobalPrivilege>globalPrivilegesprotected Map<DatabaseObject,ObjectPrivilege[]>objectPrivilegesprotected Stringpassword-
Fields inherited from class com.exasol.dbbuilder.dialects.AbstractDatabaseObject
name, owned
-
-
Constructor Summary
Constructors Constructor Description AbstractUser(com.exasol.db.Identifier name)Create a new database user with a default password.AbstractUser(com.exasol.db.Identifier name, String password)Create a new database user.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Set<GlobalPrivilege>getGlobalPrivileges()Get the systemPrivileges of the user.Map<DatabaseObject,ObjectPrivilege[]>getObjectPrivileges()Get the objectPrivileges of the user.StringgetPassword()Get the user's password.protected abstract DatabaseObjectWritergetWriter()Get aDatabaseObjectWriter.Usergrant(DatabaseObject object, ObjectPrivilege... privileges)Grant the user access to a database schema with the given privileges.Usergrant(GlobalPrivilege... privileges)Grant system privileges to a user.-
Methods inherited from class com.exasol.dbbuilder.dialects.AbstractDatabaseObject
getFullyQualifiedName, getName, isOwned
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.exasol.dbbuilder.dialects.DatabaseObject
getFullyQualifiedName, getName, isOwned
-
Methods inherited from interface com.exasol.dbbuilder.dialects.User
getParent, getType, grantAllAccess, hasParent
-
-
-
-
Field Detail
-
password
protected final String password
-
objectPrivileges
protected final Map<DatabaseObject,ObjectPrivilege[]> objectPrivileges
-
globalPrivileges
protected final Set<GlobalPrivilege> globalPrivileges
-
-
Constructor Detail
-
AbstractUser
public AbstractUser(com.exasol.db.Identifier name)
Create a new database user with a default password.This method creates a user with a password derived from the user name. Note that this is only acceptable in the scope of testing for which the TDDB is made. Never use something like this in production code!
- Parameters:
name- user name
-
AbstractUser
public AbstractUser(com.exasol.db.Identifier name, String password)Create a new database user.- Parameters:
name- user namepassword- login password
-
-
Method Detail
-
getPassword
public String getPassword()
Description copied from interface:UserGet the user's password.- Specified by:
getPasswordin interfaceUser- Returns:
- password
-
getObjectPrivileges
public Map<DatabaseObject,ObjectPrivilege[]> getObjectPrivileges()
Description copied from interface:UserGet the objectPrivileges of the user.- Specified by:
getObjectPrivilegesin interfaceUser- Returns:
- object privileges
-
getGlobalPrivileges
public Set<GlobalPrivilege> getGlobalPrivileges()
Description copied from interface:UserGet the systemPrivileges of the user.- Specified by:
getGlobalPrivilegesin interfaceUser- Returns:
- system privileges
-
getWriter
protected abstract DatabaseObjectWriter getWriter()
Get aDatabaseObjectWriter.- Returns:
DatabaseObjectWriter
-
grant
public User grant(DatabaseObject object, ObjectPrivilege... privileges)
Description copied from interface:UserGrant the user access to a database schema with the given privileges.
-
-