Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hsqldb
Class UserManager  view UserManager download UserManager.java

java.lang.Object
  extended byorg.hsqldb.UserManager

class UserManager
extends java.lang.Object

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.

Version:
1.7.0

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
           
private  User uPublic
           
private  java.util.Vector uUser
           
 
Constructor Summary
(package private) UserManager()
          Creates a new Vector to contain the User object instances, as well as creating an initial PUBLIC user, with no password.
 
Method Summary
(package private)  User createUser(java.lang.String name, java.lang.String password, boolean admin)
          This method is used to create a new user.
(package private)  void dropUser(java.lang.String name)
          This method is used to drop a user.
private  User get(java.lang.String name)
          This private method is used to access the User objects in the collection and perform operations on them.
(package private) static java.lang.String getRight(int right)
          Returns comma separated list of String arguments based on int mask
(package private) static int getRight(java.lang.String right)
          Returns int value for the string argument
(package private)  User getUser(java.lang.String name, java.lang.String password)
          This method is used to return an instance of a particular User object, given the user name and password.
(package private)  java.util.Vector getUsers()
          This method is used to access the entire Vector of User objects for this database.
(package private)  void grant(java.lang.String name, java.lang.String object, int right)
          This method is used to grant a user rights to database objects.
(package private)  void revoke(java.lang.String name, java.lang.String object, int right)
          This method is used to revoke a user's rights to database objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECT

static final int SELECT
See Also:
Constant Field Values

DELETE

static final int DELETE
See Also:
Constant Field Values

INSERT

static final int INSERT
See Also:
Constant Field Values

UPDATE

static final int UPDATE
See Also:
Constant Field Values

ALL

static final int ALL
See Also:
Constant Field Values

uUser

private java.util.Vector uUser

uPublic

private User uPublic
Constructor Detail

UserManager

UserManager()
      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

getRight

static int getRight(java.lang.String right)
             throws java.sql.SQLException
Returns int value for the string argument


getRight

static java.lang.String getRight(int right)
Returns comma separated list of String arguments based on int mask


createUser

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.


dropUser

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.


getUser

User 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.


getUsers

java.util.Vector getUsers()
This method is used to access the entire Vector of User objects for this database.


grant

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.


revoke

void 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.


get

private User get(java.lang.String name)
          throws java.sql.SQLException
This private method is used to access the User objects in the collection and perform operations on them.