|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavax.management.StandardMBean
org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean
org.objectweb.cjdbc.controller.backend.DatabaseBackend
A DatabaseBackend represents a real database backend that will
have to be bound to a virtual C-JDBC database. All connections opened will
use the same url but possibly different login/password.
| Nested Class Summary |
| Nested classes inherited from class javax.management.StandardMBean |
|
| Field Summary | |
private java.util.ArrayList |
activeTransactions
List of started transactions. |
private java.util.HashMap |
connectionManagers
Connection managers for this backend. |
private java.lang.String |
connectionTestStatement
SQL statement used to check if a connection is still valid |
private java.lang.String |
driverClassName
Database native JDBC driver class name. |
private DriverCompliance |
driverCompliance
Driver compliance to C-JDBC requirements |
private java.lang.String |
driverPath
Path for driver |
private int |
dynamicPrecision
For metadata information generation |
private boolean |
gatherSystemTables
|
private java.lang.String |
lastKnownCheckpoint
|
protected Trace |
logger
Logger instance. |
private java.lang.String |
name
Logical name assigned to this backend. |
private java.util.Vector |
pendingRequests
List of pending requests. |
private java.util.ArrayList |
rewritingRules
List of AbstractRewritingRule objects. |
private java.util.Map |
savepoints
List of savepoints for each transaction |
private DatabaseSchema |
schema
The schema of the database. |
private boolean |
schemaIsDirty
true if schema is no more up-to-date and needs a refresh |
private boolean |
schemaIsNeededByVdb
true if the backend must maintain its schema dynamically for
the virtual database needs |
private boolean |
schemaIsStatic
true if schema is static. |
private java.lang.String |
schemaName
|
private int |
sqlShortFormLength
Short form of SQL statements to include in traces and exceptions |
private int |
state
The current state of the backend |
private BackendStateListener |
stateListener
|
private int |
totalReadRequest
|
private int |
totalRequest
Monitoring Values |
private int |
totalTransactions
|
private int |
totalWriteRequest
|
private java.lang.String |
url
Real URL to access the database (JDBC URL). |
private java.lang.String |
virtualDatabaseName
Name of the virtual database this backend is attached to |
private boolean |
writeCanBeEnabled
A boolean to know if we should allow this backend to be enabled for write |
| Fields inherited from class org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean |
|
| Fields inherited from class javax.management.StandardMBean |
|
| Fields inherited from interface org.objectweb.cjdbc.common.xml.XmlComponent |
DOCTYPE_CONTROLLER, DOCTYPE_DB, XML_VERSION |
| Constructor Summary | |
DatabaseBackend(BackendInfo info)
Creates a new DatabaseBackend object |
|
DatabaseBackend(java.lang.String name,
java.lang.String driverPath,
java.lang.String driverClassName,
java.lang.String url,
java.lang.String vdbName,
boolean writeCanBeEnabled,
java.lang.String connectionTestStatement)
Creates a new DatabaseBackend instance. |
|
DatabaseBackend(java.lang.String name,
java.lang.String driverPath,
java.lang.String driverClassName,
java.lang.String url,
java.lang.String vdbName,
java.lang.String connectionTestStatement,
java.lang.String dynamicSchemaLevel)
Additionnal constructor for setting a different dynamic schema level. |
|
| Method Summary | |
void |
addConnectionManager(java.lang.String vLogin,
AbstractConnectionManager connectionManager)
Adds a ConnectionManager to this backend. |
void |
addPendingReadRequest(java.lang.Object request)
Adds a pending request (or task) to this backend. |
void |
addPendingWriteRequest(java.lang.Object request)
Adds a pending request (or task) to this backend. |
void |
addRewritingRule(AbstractRewritingRule rule)
Add a AbstractRewritingRule at the end of the rule list. |
void |
addSavepoint(java.lang.Long tid,
java.sql.Savepoint savepoint)
Adds a savepoint to a given transaction |
boolean |
checkDatabaseSchema()
Checks that the current database schema is compatible with all schema gathered from each connection manager. |
void |
checkDriverCompliance()
Check if the driver used by this backend is compliant with C-JDBC needs. |
DatabaseBackend |
copy(java.lang.String newName,
java.util.Map parameters)
Returns a deeply copied clone of this backend Will use the same rewriting rules and will get new instance of connection managers with the same configuration |
void |
disable()
Sets the database backend state to disable. |
void |
disableRead()
Disables the database backend for reads. |
void |
disableWrite()
Disables the database backend for writes. |
void |
enableRead()
Enables the database backend for reads. |
void |
enableWrite()
Enables the database backend for writes. |
boolean |
equals(java.lang.Object other)
Two database backends are considered equal if they have the same name, URL and driver class name. |
void |
finalizeConnections()
Releases all the connections to the database held by the connection managers. |
java.util.ArrayList |
getActiveTransactions()
Returns the list of active transactions for this backend. |
java.lang.String |
getAssociatedString()
Allow to retrieve internationalization description on mbeans as well |
java.lang.String[] |
getBackendData()
Get data about this backend. |
BackendStatistics |
getBackendStats()
Get the statistics of the backend. |
java.sql.Connection |
getConnectionForTransactionAndLazyBeginIfNeeded(java.lang.Long tid,
AbstractConnectionManager cm,
int transactionIsolationLevel)
Retrieve a connection for a given transaction or create a new connection and start a new transaction. |
AbstractConnectionManager |
getConnectionManager(java.lang.String vLogin)
Returns the ConnectionManager associated to this backend for
a given virtual login. |
java.util.HashMap |
getConnectionManagers()
Returns a HashMap of all the ConnectionManager
associated with this DatabaseBackend |
java.lang.String |
getConnectionTestStatement()
Returns the SQL statement to use to check the connection validity. |
java.lang.String |
getDatabaseProductName()
Returns the databaseProductName value. |
DatabaseSchema |
getDatabaseSchema()
Returns the schema of this database. |
MetadataContainer |
getDatabaseStaticMetadata()
Get the Database static metadata from this backend using a connection from the first available connection manager. |
java.lang.String |
getDriverClassName()
Returns the database native JDBC driver class name. |
DriverCompliance |
getDriverCompliance()
|
java.lang.String |
getDriverPath()
Returns the driver path. |
int |
getDynamicPrecision()
|
java.lang.String |
getLastKnownCheckpoint()
Returns the lastKnownCheckpoint value. |
java.lang.String |
getName()
Returns the backend logical name. |
java.util.Vector |
getPendingRequests()
Returns the list of pending requests for this backend. |
java.util.ArrayList |
getPendingRequestsDescription(int count,
boolean fromFirst,
boolean clone)
Returns the list of pending requests for this backend. |
java.util.ArrayList |
getRewritingRules()
Returns the rewritingRules value. |
java.sql.Savepoint |
getSavepoint(java.lang.Long tid,
java.lang.String savepointName)
Retrieves a savepoint object by its name for a given transaction |
java.lang.String |
getSchemaName()
Returns the schemaName value. |
java.lang.String |
getSchemaXml(boolean expandSchema)
The getXml() method does not return the schema if it is not static anymore, to avoid confusion between static and dynamic schema. |
int |
getSQLShortFormLength()
Return the sql short form length to use when reporting an error. |
java.lang.String |
getState()
Retrieve the state of the backend. |
int |
getStateValue()
Return the integer value corresponding to the state of the backend. |
java.util.ArrayList |
getTables()
Get all the names of tables of this database |
long |
getTotalActiveConnections()
Get the total number of active connections for this backend |
int |
getTotalReadRequest()
Returns the total number of read requests executed by this backend. |
int |
getTotalRequest()
Returns the total number of requests executed by this backend. |
int |
getTotalTransactions()
Returns the total number of transactions executed by this backend. |
int |
getTotalWriteRequest()
Returns the total number of write requests executed by this backend. |
java.lang.String |
getURL()
Returns the JDBC URL used to access the database. |
java.lang.String |
getVirtualDatabaseName()
Returns the virtual database name this backend belongs to. |
java.lang.String |
getXml()
Get xml information about this backend. |
boolean |
hasSavepointForTransaction(java.lang.Long tid,
java.lang.String savepointName)
Checks if this backend has a savepoint with given name for a given transaction |
boolean |
hasStoredProcedure(java.lang.String procedureName)
Returns true if this backend has the given stored procedure
in its schema. |
boolean |
hasTable(java.lang.String table)
Returns true if this backend has the given table in its
schema. |
boolean |
hasTables(java.util.ArrayList tables)
Returns true if this backend has the given list of tables in
its schema. |
void |
initializeConnections()
Initializes the connection managers' connections. |
boolean |
isBackuping()
Returns the isBackuping value. |
boolean |
isDisabled()
Is the backend completely disabled ? |
boolean |
isDisabling()
Returns the isDisabling value. |
boolean |
isGatherSystemTables()
Returns the gatherSystemTables value. |
boolean |
isInitialized()
Tests if this backend is enabled (active and synchronized). |
boolean |
isJDBCConnected()
Is the backend accessible ? |
boolean |
isKilled()
Returns true if the backend cannot be used anymore |
boolean |
isReadEnabled()
Tests if this backend is read enabled (active and synchronized). |
boolean |
isRecovering()
Returns the isRecovering value. |
boolean |
isSchemaDirty()
Returns the schemaIsDirty value. |
boolean |
isSchemaNeededByVdb()
Returns true if an up-to-date schema is needed by the virtual database. |
boolean |
isSchemaStatic()
|
boolean |
isStartedTransaction(java.lang.Long tid)
Returns true if the specified transaction has been started
on this backend (a connection has been allocated for this transaction). |
boolean |
isValidConnection(java.sql.Connection connection)
Check if the given connection is valid or not. |
boolean |
isWriteCanBeEnabled()
Returns the writeCanBeEnabled value. |
boolean |
isWriteEnabled()
Tests if this backend is write enabled (active and synchronized). |
void |
notifyJmx(java.lang.String type)
Sends JMX notification |
private void |
notifyJmx(java.lang.String type,
java.lang.String level,
java.lang.String message)
|
void |
notifyJmxError(java.lang.String type,
java.lang.Exception e)
Sends JMX error notification |
void |
notifyStateChange()
Notify the state of the backend has changed. |
private void |
refreshSchema()
Erase the current schema and force a re-fetch of all the meta data |
boolean |
removePendingRequest(java.lang.Object request)
Removes a pending request from this backend. |
void |
removeSavepoint(java.lang.Long tid,
java.sql.Savepoint savepoint)
Removes a savepoint for a given transaction |
java.lang.String |
rewriteQuery(java.lang.String sqlQuery)
Rewrite the current query according to the rewriting rules. |
void |
setDatabaseSchema(DatabaseSchema databaseSchema,
boolean isStatic)
Sets the database schema. |
void |
setDisabling()
Deprecated. not used anymore. Please use the setState method instead |
void |
setDynamicPrecision(int dynamicPrecision,
boolean gatherSystemTables,
java.lang.String schemaName)
Set the amount of information that must be gathered when fetching database schema information. |
void |
setLastKnownCheckpoint(java.lang.String checkpoint)
setLastKnownCheckpoint for this backend |
void |
setRewritingRules(java.util.ArrayList rewritingRules)
Sets the rewritingRules value. |
void |
setSchemaIsDirty(boolean schemaIsDirty)
Sets the schemaIsDirty value if the backend schema needs to be refreshed. |
void |
setSchemaIsNeededByVdb(boolean schemaIsNeededByVdb)
Sets the schemaIsNeededByVdb value. |
void |
setSqlShortFormLength(int sqlShortFormLength)
Sets the sqlShortFormLength value. |
void |
setState(int state)
Set the state of a backend |
void |
setStateListener(BackendStateListener stateListener)
Sets the stateListener value. |
void |
startTransaction(java.lang.Long tid)
Signals that a transaction has been started on this backend. |
void |
stopTransaction(java.lang.Long tid)
Signals that a transaction has been stopped on this backend. |
java.lang.String |
toString()
String description |
void |
updateDatabaseBackendSchema(AbstractWriteRequest request)
Update the DatabaseBackend schema definition according to the successful execution of the provided request. |
void |
waitForAllTransactionsToComplete()
This method waits until all currently open transactions on this backend complete. |
| Methods inherited from class org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean |
addNotificationListener, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getNotificationInfo, getParameterName, getParameterName, removeNotificationListener, removeNotificationListener, sendNotification |
| Methods inherited from class javax.management.StandardMBean |
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, invoke, setAttribute, setAttributes, setImplementation |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private java.lang.String name
private java.lang.String driverPath
private java.lang.String driverClassName
private transient DriverCompliance driverCompliance
private java.lang.String url
private java.lang.String virtualDatabaseName
private boolean writeCanBeEnabled
private java.lang.String connectionTestStatement
private transient DatabaseSchema schema
private boolean schemaIsStatic
true if schema is static.
private boolean schemaIsNeededByVdb
true if the backend must maintain its schema dynamically for
the virtual database needs
private boolean schemaIsDirty
true if schema is no more up-to-date and needs a refresh
private transient java.util.HashMap connectionManagers
protected transient Trace logger
private transient java.util.ArrayList activeTransactions
private transient java.util.Map savepoints
private transient java.util.Vector pendingRequests
private int totalRequest
private int totalWriteRequest
private int totalReadRequest
private int totalTransactions
private java.util.ArrayList rewritingRules
AbstractRewritingRule objects.
private int dynamicPrecision
private boolean gatherSystemTables
private java.lang.String schemaName
private int sqlShortFormLength
private java.lang.String lastKnownCheckpoint
private int state
BackendStateprivate transient BackendStateListener stateListener
| Constructor Detail |
public DatabaseBackend(java.lang.String name,
java.lang.String driverPath,
java.lang.String driverClassName,
java.lang.String url,
java.lang.String vdbName,
boolean writeCanBeEnabled,
java.lang.String connectionTestStatement)
throws javax.management.NotCompliantMBeanException
DatabaseBackend instance.
name - logical name assigned to this backenddriverPath - path for driverdriverClassName - class name of the database native JDBC driver to
loadurl - URL to access the databasevdbName - Name of the virtual database this backend is attached towriteCanBeEnabled - if writes can be enabled on this backendconnectionTestStatement - SQL statement used to check if a connection
is still valid
javax.management.NotCompliantMBeanException - if the mbean can not be created (unless
we refactor the code this cannot happend)
public DatabaseBackend(BackendInfo info)
throws javax.management.NotCompliantMBeanException
DatabaseBackend object
info - a backend info object to create a database backend object from
javax.management.NotCompliantMBeanException - if mbean is not compliant (unless we
refactor the code this cannot happend)
public DatabaseBackend(java.lang.String name,
java.lang.String driverPath,
java.lang.String driverClassName,
java.lang.String url,
java.lang.String vdbName,
java.lang.String connectionTestStatement,
java.lang.String dynamicSchemaLevel)
throws javax.management.NotCompliantMBeanException
DatabaseBackend instance.
name - logical name assigned to this backenddriverPath - path for driverdriverClassName - class name of the database native JDBC driver to
loadurl - URL to access the databasevdbName - Name of the virtual database this backend is attached toconnectionTestStatement - SQL statement used to check if a connection
is still validdynamicSchemaLevel - for dynamically gathering schema from backend
javax.management.NotCompliantMBeanException - (unless we refactor the code this cannot
happend)| Method Detail |
public void setSqlShortFormLength(int sqlShortFormLength)
sqlShortFormLength - The sqlShortFormLength to set.public int getSQLShortFormLength()
AbstractRequest.getSQLShortForm(int)public boolean equals(java.lang.Object other)
other - an object
boolean valuepublic boolean hasTables(java.util.ArrayList tables)
true if this backend has the given list of tables in
its schema. The caller must ensure that the database schema has been
defined, using the setDatabaseSchema(DatabaseSchema, boolean)or
checkDatabaseSchema()methods.
hasTables in interface DatabaseBackendMBeantables - the list of table names (ArrayList of
String) to look for
true if all the tables are foundpublic boolean hasTable(java.lang.String table)
true if this backend has the given table in its
schema. The caller must ensure that the database schema has been defined,
using the setDatabaseSchema(DatabaseSchema, boolean)or
checkDatabaseSchema()
hasTable in interface DatabaseBackendMBeantable - The table name to look for
true if tables is found in the schemapublic java.util.ArrayList getTables()
ArrayList of DatabaseTablepublic boolean hasStoredProcedure(java.lang.String procedureName)
true if this backend has the given stored procedure
in its schema. The caller must ensure that the database schema has been
defined, using the setDatabaseSchema(DatabaseSchema, boolean)or
checkDatabaseSchema()
hasStoredProcedure in interface DatabaseBackendMBeanprocedureName - The stored procedure name to look for
true if procedure name is found in the schema
public void initializeConnections()
throws java.sql.SQLException
java.sql.SQLException - if an error occurs
public void finalizeConnections()
throws java.sql.SQLException
java.sql.SQLException - if an error occurspublic boolean isValidConnection(java.sql.Connection connection)
connection - the connection to test
public void addConnectionManager(java.lang.String vLogin,
AbstractConnectionManager connectionManager)
ConnectionManager to this backend. Note that the
ConnectionManager is not initialized in this method.
vLogin - the virtual login corresponding to this connection managerconnectionManager - the ConnectionManager to add
public java.sql.Connection getConnectionForTransactionAndLazyBeginIfNeeded(java.lang.Long tid,
AbstractConnectionManager cm,
int transactionIsolationLevel)
throws UnreachableBackendException,
NoTransactionStartWhenDisablingException,
java.sql.SQLException
tid - transaction identifiercm - connection manager to get the connection fromtransactionIsolationLevel - transaction isolation level to use for a
new transaction (does nothing if equals to
Connection.DEFAULT_TRANSACTION_ISOLATION_LEVEL)
UnreachableBackendException - if the backend is no more reachable
NoTransactionStartWhenDisablingException - if a new transaction
needed to be started but the backend is in the disabling state
java.sql.SQLException - if another error occurspublic void startTransaction(java.lang.Long tid)
tid - transaction identifierpublic void stopTransaction(java.lang.Long tid)
tid - transaction identifierpublic void waitForAllTransactionsToComplete()
public boolean isStartedTransaction(java.lang.Long tid)
true if the specified transaction has been started
on this backend (a connection has been allocated for this transaction).
tid - transaction identifier
true if the transaction has been started
public void addSavepoint(java.lang.Long tid,
java.sql.Savepoint savepoint)
tid - transaction identifiersavepoint - savepoint to add
public void removeSavepoint(java.lang.Long tid,
java.sql.Savepoint savepoint)
tid - transaction identifiersavepoint - savepoint to remove
public java.sql.Savepoint getSavepoint(java.lang.Long tid,
java.lang.String savepointName)
tid - transaction identifiersavepointName - name of the savepoint
public boolean hasSavepointForTransaction(java.lang.Long tid,
java.lang.String savepointName)
tid - transaction identifiersavepointName - name of the savepoint
true if this backend has a savepoint with a given
name for a given transaction
public boolean isInitialized()
throws java.sql.SQLException
isInitialized in interface DatabaseBackendMBeantrue if this backend is enabled
java.sql.SQLException - if an error occurspublic boolean isJDBCConnected()
isJDBCConnected in interface DatabaseBackendMBeanpublic boolean isReadEnabled()
isReadEnabled in interface DatabaseBackendMBeantrue if this backend is enabled.public boolean isWriteEnabled()
isWriteEnabled in interface DatabaseBackendMBeantrue if this backend is enabled.public boolean isRecovering()
public boolean isDisabling()
public boolean isDisabled()
DatabaseBackendMBean
isDisabled in interface DatabaseBackendMBeantrue if the backend is disabledDatabaseBackendMBean.isDisabled()public boolean isKilled()
public java.lang.String getState()
getState in interface DatabaseBackendMBeanCjdbcNotificationList.VIRTUALDATABASE_BACKEND_DISABLED,
CjdbcNotificationList.VIRTUALDATABASE_BACKEND_RECOVERING,
CjdbcNotificationList.VIRTUALDATABASE_BACKEND_BACKINGUP,
CjdbcNotificationList.VIRTUALDATABASE_BACKEND_DISABLING,
CjdbcNotificationList.VIRTUALDATABASE_BACKEND_ENABLED,
CjdbcNotificationList.VIRTUALDATABASE_BACKEND_DISABLEDpublic int getStateValue()
BackendState
BackendStatepublic void enableRead()
enableRead in interface DatabaseBackendMBeanpublic void disableRead()
DatabaseBackendMBean
disableRead in interface DatabaseBackendMBeanDatabaseBackendMBean.disableRead()public void disableWrite()
DatabaseBackendMBean
disableWrite in interface DatabaseBackendMBeanDatabaseBackendMBean.disableWrite()public void enableWrite()
enableWrite in interface DatabaseBackendMBeanpublic void setDisabling()
Reads are no more allowed on the backend and the state is updated so that isReadEnabled() returns false.
disable(),
isReadEnabled()public void disable()
disable in interface DatabaseBackendMBeanpublic AbstractConnectionManager getConnectionManager(java.lang.String vLogin)
ConnectionManager associated to this backend for
a given virtual login.
vLogin - the virtual login
AbstractConnectionManager instancepublic java.util.HashMap getConnectionManagers()
HashMap of all the ConnectionManager
associated with this DatabaseBackend
public java.lang.String getConnectionTestStatement()
getConnectionTestStatement in interface DatabaseBackendMBeanString containing a SQL statementpublic java.lang.String getDriverPath()
DatabaseBackendMBean
getDriverPath in interface DatabaseBackendMBeanDatabaseBackendMBean.getDriverPath()public java.lang.String getAssociatedString()
AbstractStandardMBean
getAssociatedString in class AbstractStandardMBeanAbstractStandardMBean.getAssociatedString()public java.lang.String getDriverClassName()
getDriverClassName in interface DatabaseBackendMBeanpublic java.lang.String getName()
getName in interface DatabaseBackendMBeanpublic java.lang.String getVirtualDatabaseName()
public java.util.Vector getPendingRequests()
Vector of AbstractRequests or
AbstractTask objects
public java.util.ArrayList getPendingRequestsDescription(int count,
boolean fromFirst,
boolean clone)
DatabaseBackendMBean
getPendingRequestsDescription in interface DatabaseBackendMBeancount - number of requests to retrieve, if 0, return all.fromFirst - count the request from first if true, or from last if falseclone - should clone the pending request if true, block it if false
ArrayList of String description of
each request.DatabaseBackendMBean.getPendingRequestsDescription(int,
boolean, boolean)public void addPendingReadRequest(java.lang.Object request)
request - the request to addpublic void addPendingWriteRequest(java.lang.Object request)
request - the request to addpublic boolean removePendingRequest(java.lang.Object request)
request - the request to remove
true if the request has been found and removedpublic boolean checkDatabaseSchema()
DatabaseBackendMBeanIf no schema has been defined, the first gathered schema is used as the current database schema.
For each schema that is not compatible with the current schema, a warning is issued on the logger for that backend
checkDatabaseSchema in interface DatabaseBackendMBeanDatabaseBackendMBean.checkDatabaseSchema()public DatabaseSchema getDatabaseSchema()
getDatabaseSchema in interface DatabaseBackendMBeannull if the
schema has not been set.setDatabaseSchema(DatabaseSchema, boolean)public MetadataContainer getDatabaseStaticMetadata()
public int getDynamicPrecision()
public java.lang.String getSchemaName()
public boolean isGatherSystemTables()
public boolean isSchemaDirty()
public boolean isSchemaStatic()
isSchemaStatic in interface DatabaseBackendMBeanpublic boolean isSchemaNeededByVdb()
private void refreshSchema()
public void setDatabaseSchema(DatabaseSchema databaseSchema,
boolean isStatic)
databaseSchema - the schema to setisStatic - true if the schema should be staticgetDatabaseSchema()
public void setDynamicPrecision(int dynamicPrecision,
boolean gatherSystemTables,
java.lang.String schemaName)
dynamicPrecision - The dynamicPrecision to set.gatherSystemTables - True if we must gather system tablesschemaName - Schema name to use to gather tablespublic void setSchemaIsDirty(boolean schemaIsDirty)
schemaIsDirty - The schemaIsDirty to set.public void setSchemaIsNeededByVdb(boolean schemaIsNeededByVdb)
schemaIsNeededByVdb - The schemaIsNeededByVdb to set.public void updateDatabaseBackendSchema(AbstractWriteRequest request)
request - the request that possibly updates the schemapublic DriverCompliance getDriverCompliance()
public void checkDriverCompliance()
throws java.sql.SQLException
checkDriverCompliance in interface DatabaseBackendMBeanjava.sql.SQLException - if the driver is not compliantpublic java.lang.String getURL()
getURL in interface DatabaseBackendMBeanpublic void addRewritingRule(AbstractRewritingRule rule)
AbstractRewritingRule at the end of the rule list.
rule - a AbstractRewritingRulepublic java.lang.String rewriteQuery(java.lang.String sqlQuery)
sqlQuery - request to rewrite
public java.lang.String getXml()
getXml in interface XmlComponentpublic java.lang.String getSchemaXml(boolean expandSchema)
DatabaseBackendMBean
getSchemaXml in interface DatabaseBackendMBeanexpandSchema - if we should force the schema to be expanded. This is
needed as the default getXml should call this method.
DatabaseBackendMBean.getSchemaXml(boolean)public java.util.ArrayList getActiveTransactions()
DatabaseBackendMBean
getActiveTransactions in interface DatabaseBackendMBeanpublic java.lang.String[] getBackendData()
data[0] = this.name; data[1] = this.driverClassName; data[2] = this.url; data[3] = String.valueOf(this.activeTransactions.size()); data[4] = String.valueOf(this.pendingRequests.size()); data[5] = String.valueOf(this.isReadEnabled()); data[6] = String.valueOf(this.isWriteEnabled()); data[7] = String.valueOf(this.isInitialized()); data[8] = String.valueOf(this.schemaIsStatic); data[9] = String.valueOf(this.connectionManagers.size()); data[10] = String.valueOf(getTotalActiveConnections()); data[11] = String.valueOf(totalRequest); data[12] = String.valueOf(totalTransactions); data[13] = lastKnownCheckpoint;
public BackendStatistics getBackendStats()
public long getTotalActiveConnections()
AbstractConnectionManager connected to this backendpublic int getTotalTransactions()
public int getTotalReadRequest()
public int getTotalWriteRequest()
public int getTotalRequest()
public void setLastKnownCheckpoint(java.lang.String checkpoint)
setLastKnownCheckpoint in interface DatabaseBackendMBeancheckpoint - the checkpointpublic java.lang.String getLastKnownCheckpoint()
getLastKnownCheckpoint in interface DatabaseBackendMBeanpublic java.lang.String getDatabaseProductName()
public java.util.ArrayList getRewritingRules()
public void setRewritingRules(java.util.ArrayList rewritingRules)
rewritingRules - The rewritingRules to set.
public DatabaseBackend copy(java.lang.String newName,
java.util.Map parameters)
throws java.lang.Exception
newName - the new name for this new backendparameters - a set of parameters to use to replace values from the
copied backend. DatabaseBackend instance
java.lang.Exception - if cannot proceed the copypublic boolean isBackuping()
public void setState(int state)
state - see BackendState for a possible list of the different stateBackendStatepublic void notifyStateChange()
CjdbcNotificationListpublic void notifyJmx(java.lang.String type)
type - notification typeCjdbcNotificationList
public void notifyJmxError(java.lang.String type,
java.lang.Exception e)
e - Exception object. Only the message will be usedtype - notification typeCjdbcNotificationList
private void notifyJmx(java.lang.String type,
java.lang.String level,
java.lang.String message)
public boolean isWriteCanBeEnabled()
public void setStateListener(BackendStateListener stateListener)
stateListener - The stateListener to set.public java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||