Package com.exasol.dbbuilder
Class User
- java.lang.Object
-
- com.exasol.dbbuilder.AbstractDatabaseObject
-
- com.exasol.dbbuilder.User
-
- All Implemented Interfaces:
DatabaseObject
public class User extends AbstractDatabaseObject
Database user
-
-
Field Summary
-
Fields inherited from class com.exasol.dbbuilder.AbstractDatabaseObject
name, writer
-
-
Constructor Summary
Constructors Constructor Description User(DatabaseObjectWriter writer, String name)Create a new database user with a default password.User(DatabaseObjectWriter writer, String name, String password)Create a new database user.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<DatabaseObject,ObjectPrivilege[]>getObjectPrivileges()Get the objectPrivileges of the user.DatabaseObjectgetParent()Get the parent object.StringgetPassword()Get the user's password.Set<SystemPrivilege>getSystemPrivileges()Get the systemPrivileges of the user.StringgetType()Get the type of the database object.Usergrant(DatabaseObject object, ObjectPrivilege... privileges)Grant the user access to a database schema with the given privileges.Usergrant(SystemPrivilege... privileges)Grant system privileges to a user.UsergrantAllAccess(DatabaseObject object)Grant the user access to all aspects of a database schema.booleanhasParent()Check if this object has a parent object that sets the scope within the database-
Methods inherited from class com.exasol.dbbuilder.AbstractDatabaseObject
getFullyQualifiedName, getName
-
-
-
-
Constructor Detail
-
User
public User(DatabaseObjectWriter writer, String 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:
writer- database object writername- user name
-
User
public User(DatabaseObjectWriter writer, String name, String password)
Create a new database user.- Parameters:
writer- database object writername- user namepassword- login password
-
-
Method Detail
-
getType
public String getType()
Description copied from interface:DatabaseObjectGet the type of the database object.- Returns:
- type of the database object
-
hasParent
public boolean hasParent()
Description copied from interface:DatabaseObjectCheck if this object has a parent object that sets the scope within the database- Returns:
trueif the object has a parent
-
getParent
public DatabaseObject getParent()
Description copied from interface:DatabaseObjectGet the parent object.- Returns:
- parent object
-
getPassword
public String getPassword()
Get the user's password.- Returns:
- password
-
getObjectPrivileges
public Map<DatabaseObject,ObjectPrivilege[]> getObjectPrivileges()
Get the objectPrivileges of the user.- Returns:
- object privileges
-
getSystemPrivileges
public Set<SystemPrivilege> getSystemPrivileges()
Get the systemPrivileges of the user.- Returns:
- system privileges
-
grantAllAccess
public User grantAllAccess(DatabaseObject object)
Grant the user access to all aspects of a database schema.- Parameters:
object- database object- Returns:
Userinstance for fluent programming
-
grant
public User grant(DatabaseObject object, ObjectPrivilege... privileges)
Grant the user access to a database schema with the given privileges.- Parameters:
object- database objectprivileges- privileges to grant the user- Returns:
Userinstance for fluent programming
-
grant
public User grant(SystemPrivilege... privileges)
Grant system privileges to a user.- Parameters:
privileges- system privileges- Returns:
Userinstance for fluent programming
-
-