|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.hsqldb.Access
Access Class
The collection (Vector) of User object instances within a specific database. Methods are provided for creating, modifying and deleting users, as well as manipulating their access rights to the database objects.
User
Field Summary | |
(package private) static int |
ALL
|
(package private) static int |
DELETE
|
(package private) static int |
INSERT
|
(package private) static int |
SELECT
|
(package private) static int |
UPDATE
|
Constructor Summary | |
(package private) |
Access()
Access Class constructor |
Method Summary | |
(package private) User |
createUser(java.lang.String name,
java.lang.String password,
boolean admin)
createUser method declaration |
(package private) void |
dropUser(java.lang.String name)
dropUser method declaration |
(package private) static java.lang.String |
getRight(int right)
getRight method declaration |
(package private) static int |
getRight(java.lang.String right)
getRight method declaration |
(package private) User |
getUser(java.lang.String name,
java.lang.String password)
getUser method declaration |
(package private) java.util.Vector |
getUsers()
getUsers method declaration |
(package private) void |
grant(java.lang.String name,
java.lang.String object,
int right)
grant method declaration |
(package private) void |
revoke(java.lang.String name,
java.lang.String object,
int right)
revoke method declaration |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final int SELECT
static final int DELETE
static final int INSERT
static final int UPDATE
static final int ALL
Constructor Detail |
Access() throws java.sql.SQLException
Creates a new Vector to contain the User object instances, as well as creating an initial PUBLIC user, with no password.
Method Detail |
static int getRight(java.lang.String right) throws java.sql.SQLException
This getRight method takes a String argument of the name of the access right.
A
- String representation of the right.static java.lang.String getRight(int right)
This getRight method takes a int argument of the access right.
A
- static int representing the right passed in.User createUser(java.lang.String name, java.lang.String password, boolean admin) throws java.sql.SQLException
This method is used to create a new user. The collection of users is first checked for a duplicate name, and an exception will be thrown if a user of the same name already exists.
name
- (User login)password
- (Plaintext password)admin
- (Is this a database admin user?)void dropUser(java.lang.String name) throws java.sql.SQLException
This method is used to drop a user. Since we are using a vector to hold the User objects, we must iterate through the Vector looking for the name. The user object is currently set to null, and all access rights revoked.
Note:An ACCESS_IS_DENIED exception will be thrown if an attempt is made to drop the PUBLIC user.
name
- of the user to be droppedUser getUser(java.lang.String name, java.lang.String password) throws java.sql.SQLException
This method is used to return an instance of a particular User object, given the user name and password.
Note:An ACCESS_IS_DENIED exception will be thrown if an attempt is made to get the PUBLIC user.
user
- nameuser
- passwordjava.util.Vector getUsers()
This method is used to access the entire Vector of User objects for this database.
void grant(java.lang.String name, java.lang.String object, int right) throws java.sql.SQLException
This method is used to grant a user rights to database objects.
name
- of the userobject
- in the databaseright
- to grant to the uservoid revoke(java.lang.String name, java.lang.String object, int right) throws java.sql.SQLException
This method is used to revoke a user's rights to database objects.
name
- of the userobject
- in the databaseright
- to grant to the user
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |