com.virtuosotechnologies.asaph.maingui
Interface DatabaseConnector


public interface DatabaseConnector

This interface is implemented by plugins that know how to connect to a database identified by a DatabaseIdentifier


Method Summary
 SongDatabase openIdentifiedDatabase(DatabaseIdentifier identifier)
          Attempt to open the SongDatabase referenced by the given identifier.
 

Method Detail

openIdentifiedDatabase

public SongDatabase openIdentifiedDatabase(DatabaseIdentifier identifier)
                                    throws SongDatabaseFailedException,
                                           UnrecognizedDatabaseIdentifierException
Attempt to open the SongDatabase referenced by the given identifier. The identifier may or may not specify this connector. (Normally, the tool will attempt to open the database using its native connector first, and then try alternate connectors if the native connector isn't present.)

Returns the SongDatabase opened. If an error occurred while opening the database, throw a SongDatabaseFailedException. If the DatabaseConnector does not recognize the DatabaseIdentifier or otherwise believes that another DatabaseConnector should be used to open the database, throw DatabaseIdentifierNotRecognizedException.

Note that this method may be invoked off the AWT/Swing thread, so accesses to the GUI or callbacks to the maingui plugin should be appropriately wrapped.

Parameters:
identifier - identifier for the database to open
Returns:
the opened SongDatabase
Throws:
SongDatabaseFailedException - an error occurred while opening the database. This will usually have a cause exception, such as IOException or SQLException.
UnrecognizedDatabaseIdentifierException - this DatabaseConnector doesn't recognize the DatabaseIdentifier, or otherwise believes that it is the wrong DatabaseConnector for the job.