Public Member Functions

BinNavi.API.disassembly.DatabaseManager Class Reference

Keeps track of all known databases. More...

Inherits BinNavi::APIHelpers::ApiObject< IDatabaseManager >.

List of all members.

Public Member Functions

Database addDatabase (final String description, final String driver, final String host, final String name, final String user, final String password, final boolean savePassword, final boolean autoConnect)
 Adds a new database.
void addListener (final IDatabaseManagerListener listener)
 Adds a database manager listener.
List< DatabasegetDatabases ()
 Databases managed by this manager.
Iterator< Databaseiterator ()
 Iterates over all managed databases.
void removeDatabase (final Database database)
 Removes a database from the manager.
void removeListener (final IDatabaseManagerListener listener)
 Removes a database listener.
String toString ()
 Printable representation of the database manager.

Detailed Description

The database manager keeps track of the database configurations that are known to BinNavi. It can be used to access the individual database configurations, to create new database configurations, or to delete existing instances.


Member Function Documentation

Database BinNavi.API.disassembly.DatabaseManager.addDatabase ( final String  description,
final String  driver,
final String  host,
final String  name,
final String  user,
final String  password,
final boolean  savePassword,
final boolean  autoConnect 
)

Adds a new database configuration to the database manager.

Parameters:
description The description of the new database configuration. This is the text that is displayed in the project tree.
driver The driver that is used to connect to the database. The default driver to connect to a MySQL database is CJdbcDriverNames.jdbcMySQLDriverName.
host Host address of the database server.
name The name of the database on the database server.
user The user that is used to connect to the database.
password The password that is used to connect to the database.
savePassword Flag that indicates whether the password should be saved in the configuration file.
autoConnect Flag that indicates whether this a connection to this database is established automatically when BinNavi starts.
Returns:
The created database.
Exceptions:
IllegalArgumentException Thrown if any of the passed arguments are null.
void BinNavi.API.disassembly.DatabaseManager.addListener ( final IDatabaseManagerListener  listener  ) 

Adds a listener that is notified about changes in the database manager.

Parameters:
listener The listener object that is notified about changes in the database manager.
Exceptions:
IllegalArgumentException Thrown if the listener argument is null.
IllegalStateException Thrown if the listener object is already listening on the database manager.
List<Database> BinNavi.API.disassembly.DatabaseManager.getDatabases (  ) 

Returns a list of all database configurations known to the database manager.

Please note that the order of the databases inside the manager is not deterministic and may change at any time. If you reuse calculated indices into the returned list you will get undefined behavior.

Returns:
A list of database configurations.
Iterator<Database> BinNavi.API.disassembly.DatabaseManager.iterator (  ) 

Returns an iterator that can be used to iterate over the databases managed by this database manager.

Returns:
An iterator to iterate over the managed database.
void BinNavi.API.disassembly.DatabaseManager.removeDatabase ( final Database  database  ) 

Removes a database from the manager. If a database is removed from the database manager it is no longer available in BinNavi.

Parameters:
database The database to remove.
void BinNavi.API.disassembly.DatabaseManager.removeListener ( final IDatabaseManagerListener  listener  ) 

Removes a listener object from the database manager.

Parameters:
listener The listener object to remove from the database manager.
Exceptions:
IllegalArgumentException Thrown if the listener argument is null.
IllegalStateException Thrown if the listener object was not listening on the database manager.
String BinNavi.API.disassembly.DatabaseManager.toString (  ) 

Returns a string representation of the database manager.

Returns:
A string representation of the database manager.