All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class examples.jdbc.RegistryTable

java.lang.Object
   |
   +----examples.jdbc.Table
           |
           +----examples.jdbc.RegistryTable

public class RegistryTable
extends Table
This class provides a basic service for managing a registry table in a database.
The registry manages the different domains in an agent. Each domain is represented by a domain table in the database.

The registry table structure:
Column Name Column Type
domainName VARCHAR

See Also:
DomainTable

Variable Index

 o VARCHAR_SIZE
The string column size.

Constructor Index

 o RegistryTable(Connection, String)
Creates a RegistryTable that manipulates registry tables in the database.

Method Index

 o add(String)
Adds a new row to the registry table and creates the related domain table.
 o contains(String)
Tests if the row exists in the registry table.
 o delete(String)
Removes existing rows from the registry table and drop related domain tables.
 o drop()
Removes the registry table definition and all data with related domain tables.
 o get(String)
Retrieves the domain table for the specified domain.
 o getAll()
Retrieves all the domain tables in the registry.
 o isEmpty()
Tests if there is any existing rows in the registry table.
 o size()
Determines the size of the registry table.
 o sizeAll()
Determines the size of all the domain tables in the registry table.

Variables

 o VARCHAR_SIZE
 public static int VARCHAR_SIZE
The string column size.

Constructors

 o RegistryTable
 public RegistryTable(Connection connection,
                      String registryName) throws SQLException
Creates a RegistryTable that manipulates registry tables in the database. If the table doesn't exist in the database, it will be created.

Parameters:
connection - A session with a specific database.
registryName - The name of the registry table.
Throws: SQLException
A database-access error occured.

Methods

 o add
 public DomainTable add(String domainName) throws SQLException
Adds a new row to the registry table and creates the related domain table.

Parameters:
domainName - The name of the domain within which the managed object exists.
Returns:
A DomainTable representing the newly added domain.
Throws: SQLException
A database-access error occured.
 o delete
 public void delete(String domainName) throws SQLException
Removes existing rows from the registry table and drop related domain tables.

Parameters:
domainName - The name of the domain within which the managed object exists.
Throws: SQLException
A database-access error occured.
 o get
 public DomainTable get(String domainName) throws SQLException
Retrieves the domain table for the specified domain.

Parameters:
domainName - The name of the domain within which the managed object exists.
Returns:
A DomainTable representing the domain.
Throws: SQLException
A database-access error occured.
 o getAll
 public Vector getAll() throws SQLException
Retrieves all the domain tables in the registry.

Returns:
A list of DomainTable representing the domains.
Throws: SQLException
A database-access error occured.
 o contains
 public boolean contains(String domainName) throws SQLException
Tests if the row exists in the registry table.

Parameters:
domainName - The name of the domain within which the managed object exists.
Returns:
True if the row exists in the registry table, else false.
Throws: SQLException
A database-access error occured.
 o size
 public int size() throws SQLException
Determines the size of the registry table.

Returns:
The number of existing rows in the registry table.
Throws: SQLException
A database-access error occured.
 o sizeAll
 public int sizeAll() throws SQLException
Determines the size of all the domain tables in the registry table.

Returns:
The number of existing rows of all the domain tables in the registry table.
Throws: SQLException
A database-access error occured.
 o isEmpty
 public boolean isEmpty() throws SQLException
Tests if there is any existing rows in the registry table.

Returns:
True if there are no existing rows in the registry table, else false.
Throws: SQLException
A database-access error occured.
 o drop
 public void drop() throws SQLException
Removes the registry table definition and all data with related domain tables.

Throws: SQLException
A database-access error occured.

All Packages  Class Hierarchy  This Package  Previous  Next  Index