|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbutler.sql.metadata.DatabaseBroker
public abstract class DatabaseBroker
Broker for database objects. This class is normally the starting point for using the butler.sql package. Normally using butler starts with the following call.
db = DatabaseBroker.getInstance().getDatabase("my-alias");
DefaultDatabaseBroker
Field Summary | |
---|---|
protected ButlerDriver |
_driver
|
protected SchemaParser |
_schemaParser
|
protected javax.transaction.TransactionManager |
_tm
|
Constructor Summary | |
---|---|
protected |
DatabaseBroker()
|
Method Summary | |
---|---|
void |
commit()
|
void |
completeRequest(boolean success)
Deprecated. Use getTransactionManager().commit() |
java.lang.Object |
getContext()
Returns an user context object that an implementation of butler.sql.metadata.Authorizator would use for extracting a user name. |
Database |
getDatabase(java.lang.String alias)
Returns the database with the given alias. |
java.util.Iterator |
getDatabaseNames()
Returns an iteraton of all names of databases registered to this DatabaseBroker. |
java.util.Map |
getDatabases()
|
static Database |
getDB(java.lang.String alias)
|
Schema |
getDefaultSchema()
Returns the default schema. |
ButlerDriver |
getDriver()
Returns the driver which is used for database operations. |
static DatabaseBroker |
getInstance()
Returns the DatabaseBroker that should be used. |
Schema |
getSchema(java.lang.String path)
Returns the schema for the given path. |
SchemaParser |
getSchemaParser()
|
Table |
getTable(java.lang.String path)
Returns the table for the given path. |
javax.transaction.TransactionManager |
getTransactionManager()
|
javax.transaction.UserTransaction |
getUserTransaction()
|
void |
initRequest()
Deprecated. Use getTransactionManager().begin() |
void |
registerChangedRecord(Record rec)
|
void |
saveRecords()
|
static void |
setInstance(DatabaseBroker instance)
Assigns the singelton DatabaseBroker instance to the given object. |
void |
setSchemaParser(SchemaParser parser)
|
void |
unregisterChangedRecord(Record rec)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected javax.transaction.TransactionManager _tm
protected ButlerDriver _driver
protected SchemaParser _schemaParser
Constructor Detail |
---|
protected DatabaseBroker()
Method Detail |
---|
public static DatabaseBroker getInstance() throws java.lang.Exception
java.lang.Exception
public static Database getDB(java.lang.String alias) throws java.lang.Exception
java.lang.Exception
public static void setInstance(DatabaseBroker instance)
public java.util.Iterator getDatabaseNames() throws java.lang.Exception
java.lang.Exception
public java.util.Map getDatabases() throws java.lang.Exception
java.lang.Exception
public Database getDatabase(java.lang.String alias) throws java.lang.Exception
java.lang.Exception
public Schema getSchema(java.lang.String path) throws java.lang.Exception
java.lang.Exception
public Schema getDefaultSchema() throws java.lang.Exception
java.lang.Exception
public ButlerDriver getDriver() throws java.lang.Exception
java.lang.Exception
public java.lang.Object getContext() throws java.lang.Exception
java.lang.Exception
public void initRequest()
public void completeRequest(boolean success) throws java.sql.SQLException
success
- Tells if the request was
a success or ended with an exception.
java.sql.SQLException
public void commit() throws java.lang.Exception
java.lang.Exception
public javax.transaction.TransactionManager getTransactionManager()
public javax.transaction.UserTransaction getUserTransaction() throws java.lang.Exception
java.lang.Exception
public SchemaParser getSchemaParser()
public void setSchemaParser(SchemaParser parser)
public Table getTable(java.lang.String path) throws java.lang.Exception
java.lang.Exception
public void registerChangedRecord(Record rec)
public void unregisterChangedRecord(Record rec)
public void saveRecords() throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |