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
-
VARCHAR_SIZE
- The string column size.
-
RegistryTable(Connection, String)
- Creates a
RegistryTable that manipulates registry tables in the
database.
-
add(String)
- Adds a new row to the registry table and creates the related domain table.
-
contains(String)
- Tests if the row exists in the registry table.
-
delete(String)
- Removes existing rows from the registry table and drop related domain tables.
-
drop()
- Removes the registry table definition and all data with related domain tables.
-
get(String)
- Retrieves the domain table for the specified domain.
-
getAll()
- Retrieves all the domain tables in the registry.
-
isEmpty()
- Tests if there is any existing rows in the registry table.
-
size()
- Determines the size of the registry table.
-
sizeAll()
- Determines the size of all the domain tables in the registry table.
VARCHAR_SIZE
public static int VARCHAR_SIZE
- The string column size.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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