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,AutoCloseable
- Direct Known Subclasses:
ExasolUser,MySqlUser,OracleUser,PostgreSqlUser
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>globalPrivilegesGlobal privilegesprotected Map<DatabaseObject,ObjectPrivilege[]>objectPrivilegesObject privilegesprotected StringpasswordPassword-
Fields inherited from class com.exasol.dbbuilder.dialects.AbstractDatabaseObject
name, owned
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractUser(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 protected voiddropInternally()This is called byAbstractDatabaseObject.drop()to actually execute the DROP statement.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
drop, getFullyQualifiedName, getName, isOwned, markDeleted, verifyNotDeleted
-
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
close, drop, getFullyQualifiedName, getName, isOwned
-
Methods inherited from interface com.exasol.dbbuilder.dialects.User
getParent, getType, grantAllAccess, hasParent
-
-
-
-
Field Detail
-
password
protected final String password
Password
-
objectPrivileges
protected final Map<DatabaseObject,ObjectPrivilege[]> objectPrivileges
Object privileges
-
globalPrivileges
protected final Set<GlobalPrivilege> globalPrivileges
Global privileges
-
-
Constructor Detail
-
AbstractUser
protected 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.
-
grant
public User grant(GlobalPrivilege... privileges)
Description copied from interface:UserGrant system privileges to a user.
-
dropInternally
protected void dropInternally()
Description copied from class:AbstractDatabaseObjectThis is called byAbstractDatabaseObject.drop()to actually execute the DROP statement.- Specified by:
dropInternallyin classAbstractDatabaseObject
-
-