|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.engine.DbObjectBase
org.h2.engine.RightOwner
org.h2.engine.User
public class User
Represents a user object.
Field Summary |
---|
Fields inherited from class org.h2.engine.DbObjectBase |
---|
comment, database, trace |
Fields inherited from interface org.h2.engine.DbObject |
---|
AGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE |
Constructor Summary | |
---|---|
User(Database database,
int id,
java.lang.String userName,
boolean systemUser)
|
Method Summary | |
---|---|
void |
checkAdmin()
Check if this user has admin rights. |
void |
checkOwnsNoSchemas()
Check that this user does not own any schema. |
void |
checkRename()
Check if this object can be renamed. |
void |
checkRight(Table table,
int rightMask)
Checks that this user has the given rights for this database object. |
ObjectArray<DbObject> |
getChildren()
Get the list of dependent children (for tables, this includes indexes and so on). |
java.lang.String |
getCreateSQL()
Build a SQL statement to re-create this object. |
java.lang.String |
getCreateSQL(boolean password,
boolean ifNotExists)
Get the CREATE SQL statement for this object. |
java.lang.String |
getCreateSQLForCopy(Table table,
java.lang.String quotedName)
Build a SQL statement to re-create the object, or to create a copy of the object with a different name or referencing a different table |
java.lang.String |
getDropSQL()
Build a SQL statement to drop this object. |
int |
getType()
Get the object type. |
boolean |
isAdmin()
|
void |
removeChildrenAndResources(Session session)
Remove all dependent objects and free all resources (files, blocks in files) of this object. |
void |
setAdmin(boolean admin)
|
void |
setSaltAndHash(byte[] salt,
byte[] hash)
Set the salt and hash of the password for this user. |
void |
setUserPasswordHash(byte[] userPasswordHash)
Set the user name password hash. |
boolean |
validateUserPasswordHash(byte[] userPasswordHash)
Check the password of this user. |
Methods inherited from class org.h2.engine.RightOwner |
---|
getRightForRole, getRightForTable, grantRight, grantRole, isRoleGranted, revokeRight, revokeRole |
Methods inherited from class org.h2.engine.DbObjectBase |
---|
getComment, getDatabase, getHeadPos, getId, getModificationId, getName, getSQL, initDbObjectBase, invalidate, isTemporary, rename, setComment, setModified, setObjectName, setTemporary, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public User(Database database, int id, java.lang.String userName, boolean systemUser)
Method Detail |
---|
public void setAdmin(boolean admin)
public boolean isAdmin()
public void setSaltAndHash(byte[] salt, byte[] hash)
salt
- the salthash
- the password hashpublic void setUserPasswordHash(byte[] userPasswordHash)
userPasswordHash
- the user name password hashpublic java.lang.String getCreateSQLForCopy(Table table, java.lang.String quotedName)
DbObjectBase
getCreateSQLForCopy
in interface DbObject
getCreateSQLForCopy
in class DbObjectBase
table
- the new table namequotedName
- the new quoted name
public java.lang.String getCreateSQL()
DbObjectBase
getCreateSQL
in interface DbObject
getCreateSQL
in class DbObjectBase
public java.lang.String getDropSQL()
DbObjectBase
getDropSQL
in interface DbObject
getDropSQL
in class DbObjectBase
public void checkRight(Table table, int rightMask) throws java.sql.SQLException
table
- the database objectrightMask
- the rights required
java.sql.SQLException
- if this user does not have the required rightspublic java.lang.String getCreateSQL(boolean password, boolean ifNotExists)
password
- true if the password (actually the salt and hash) should
be returnedifNotExists
- true if IF NOT EXISTS should be used
public boolean validateUserPasswordHash(byte[] userPasswordHash)
userPasswordHash
- the password data (the user password hash)
public void checkAdmin() throws java.sql.SQLException
java.sql.SQLException
- if this user is not an adminpublic int getType()
DbObjectBase
getType
in interface DbObject
getType
in class DbObjectBase
public ObjectArray<DbObject> getChildren()
DbObject
getChildren
in interface DbObject
getChildren
in class DbObjectBase
public void removeChildrenAndResources(Session session) throws java.sql.SQLException
DbObjectBase
removeChildrenAndResources
in interface DbObject
removeChildrenAndResources
in class DbObjectBase
session
- the session
java.sql.SQLException
public void checkRename()
DbObjectBase
checkRename
in interface DbObject
checkRename
in class DbObjectBase
public void checkOwnsNoSchemas() throws java.sql.SQLException
java.sql.SQLException
- if this user owns a schema
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |