Package | Class | Tree | Deprecated
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hsqldb
Class Access

    java.lang.Object
      |
      +--org.hsqldb.Access

class Access
extends java.lang.Object

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.

See Also:
  `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
`, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SELECT

    static final int SELECT

### DELETE

    static final int DELETE

### INSERT

    static final int INSERT

### UPDATE

    static final int UPDATE

### ALL

    static final int ALL

Constructor Detail

### Access

    Access()
     throws java.sql.SQLException

  Access Class constructor

  Creates a new Vector to contain the User object instances, as well as creating an initial PUBLIC user, with no password.

  Throws:
    java.sql.SQLException -

Method Detail

### getRight

    static int getRight(java.lang.String right)
                 throws java.sql.SQLException

  getRight method declaration

  This getRight method takes a String argument of the name of the access right.

  Parameters:
    `A` - String representation of the right.
  Returns:
    A static int representing the String right passed in.
  Throws:
    java.sql.SQLException -

### getRight

    static java.lang.String getRight(int right)

  getRight method declaration

  This getRight method takes a int argument of the access right.

  Parameters:
    `A` - static int representing the right passed in.
  Returns:
    A String representation of the right or rights associated with the argument.
  Throws:
    java.sql.SQLException -

### createUser

    User createUser(java.lang.String name,
                    java.lang.String password,
                    boolean admin)
              throws java.sql.SQLException

  createUser method declaration

  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.

  Parameters:
    `name` - (User login)
    `password` - (Plaintext password)
    `admin` - (Is this a database admin user?)
  Returns:
    An instance of the newly created User object
  Throws:
    java.sql.SQLException -

### dropUser

    void dropUser(java.lang.String name)
            throws java.sql.SQLException

  dropUser method declaration

  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.

  Parameters:
    `name` - of the user to be dropped
  Throws:
    java.sql.SQLException -

### getUser

    User getUser(java.lang.String name,
                 java.lang.String password)
           throws java.sql.SQLException

  getUser method declaration

  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.

  Parameters:
    `user` - name
    `user` - password
  Returns:
    The requested User object
  Throws:
    java.sql.SQLException -

### getUsers

    java.util.Vector getUsers()

  getUsers method declaration

  This method is used to access the entire Vector of User objects for this database.

  Returns:
    The Vector of our User objects

### grant

    void grant(java.lang.String name,
               java.lang.String object,
               int right)
         throws java.sql.SQLException

  grant method declaration

  This method is used to grant a user rights to database objects.

  Parameters:
    `name` - of the user
    `object` - in the database
    `right` - to grant to the user
  Throws:
    java.sql.SQLException -

### revoke

    void revoke(java.lang.String name,
                java.lang.String object,
                int right)
          throws java.sql.SQLException

  revoke method declaration

  This method is used to revoke a user's rights to database objects.

  Parameters:
    `name` - of the user
    `object` - in the database
    `right` - to grant to the user
  Throws:
    java.sql.SQLException -

Package | Class | Tree | Deprecated
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD