Revision 545

org.bridgedb
Class BridgeDb

java.lang.Object
  extended by org.bridgedb.BridgeDb

public final class BridgeDb
extends java.lang.Object

Central access point for connecting to IDMappers.


Method Summary
static IDMapper connect(java.lang.String connectionString)
          Finds the correct implementation of the IDMapper interface and instantiates it.
static void register(java.lang.String protocol, Driver driver)
          Used by Driver implementations to register themselves and make themselves available to the world.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

connect

public static IDMapper connect(java.lang.String connectionString)
                        throws IDMapperException
Finds the correct implementation of the IDMapper interface and instantiates it.

Parameters:
connectionString - used to configure a mapping resource. The connectionString has the form "protocol:location", where protocol can be e.g. "idmapper-text" or "idmapper-pgdb", and location is for example an url or a file, depending on the protocol.
Note that you need to load the driver that implements the protocol first by loading its class with Class.forName(). E.g. for idmapper-pgdb, the class "org.bridgedb.rdb.IDMapperRdb" needs to be loaded.
Returns:
the newly instantiated IDMapper
Throws:
IDMapperException - when the right IDMapper implementation could not be instantiated, or when the connection string is not formatted correctly

register

public static void register(java.lang.String protocol,
                            Driver driver)
Used by Driver implementations to register themselves and make themselves available to the world.

Parameters:
protocol - The protocol (part before ":" in connection string) that this Driver is for.
driver - An instance of the Driver.

Generated November 2 2011