|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.StandardMBean org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase
A VirtualDatabase
represents a database from client point of
view and hide the complexity of the cluster distribution to the client. The
client always uses the virtual database name and the C-JDBC Controller will
use the real connections when an SQL request comes in.
Nested Class Summary |
Nested classes inherited from class javax.management.StandardMBean |
|
Field Summary | |
private java.util.ArrayList |
activeThreads
|
protected AuthenticationManager |
authenticationManager
Authentification manager matching virtual database login/password to backends login/password |
protected java.util.ArrayList |
backends
ArrayList of DatabaseBackend objects |
private AbstractBlobFilter |
blobFilter
The filter used to store blobs in the database |
static int |
CHECK_BACKEND_DISABLE
Use for method getAndCheck |
static int |
CHECK_BACKEND_ENABLE
Use for method getAndCheck |
(package private) Controller |
controller
The controller we belong to |
protected int |
currentNbOfThreads
Current number of worker threads |
private java.lang.String |
databaseProductNames
Comma separated list of database product names (one instance per name) |
private int |
idleThreads
|
Trace |
logger
Virtual database logger |
protected int |
maxNbOfConnections
Maximum number of concurrent accepted for this virtual database |
protected int |
maxNbOfThreads
Maximum number of worker threads to fork |
protected long |
maxThreadIdleTime
Maximum time a worker thread can remain idle before dying |
protected VirtualDatabaseDynamicMetaData |
metadata
Virtual Database MetaData |
protected int |
minNbOfThreads
Minimum number of worker threads to keep in the pool if poolConnectionThreads is true |
protected java.lang.String |
name
Virtual database name |
static int |
NO_CHECK_BACKEND
Use for method getAndCheck |
private java.util.ArrayList |
pendingConnections
|
protected boolean |
poolConnectionThreads
If false one worker thread is forked per connection else |
protected Trace |
requestLogger
|
protected RequestManager |
requestManager
The request manager to use for this database |
protected ReadPrioritaryFIFOWriteLock |
rwLock
Read/Write lock for backend list |
private static long |
serialVersionUID
|
private boolean |
shuttingDown
Marker to see if the database is shutting down |
private SQLMonitoring |
sqlMonitor
|
private int |
sqlShortFormLength
Short form of SQL statements to include in traces and exceptions |
private VirtualDatabaseStaticMetaData |
staticMetadata
|
protected java.util.LinkedList |
totalOrderQueue
ArrayList to store the order of requests |
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 | |
VirtualDatabase(Controller controller,
java.lang.String name,
int maxConnections,
boolean pool,
int minThreads,
int maxThreads,
long maxThreadIdleTime,
int sqlShortFormLength,
AbstractBlobFilter blobFilter)
Creates a new VirtualDatabase instance. |
Method Summary | |
void |
abort(long transactionId,
boolean logAbort)
Abort a transaction that has been started but in which no query was executed. |
void |
acquireReadLockBackendLists()
Acquires a read lock on the backend lists (both enabled and disabled backends). |
void |
addBackend(DatabaseBackend db)
Add a backend to this virtual database. |
void |
addBackend(DatabaseBackend db,
boolean checkForCompliance)
Add a backend to this virtual database. |
void |
addCurrentNbOfThread()
Adds one to currentNbOfThreads. |
void |
addIdleThread()
Method add an idle thread. |
void |
backupBackend(java.lang.String backendName,
java.lang.String login,
java.lang.String password,
java.lang.String dumpName,
java.lang.String backuperName,
java.lang.String path,
java.util.ArrayList tables)
Create a backup of a specific backend. |
long |
begin(java.lang.String login)
Begins a new transaction and returns the corresponding transaction identifier. |
boolean |
checkAdminAuthentication(java.lang.String adminLogin,
java.lang.String adminPassword)
Checks if a given admin login/password is ok. |
boolean |
checkUserAuthentication(java.lang.String virtualLogin,
java.lang.String virtualPassword)
Checks if a given virtual login/password is ok. |
void |
cleanMonitoringData()
Clean data collected by the current monitoring system, to avoid memory problems. |
void |
commit(long transactionId,
boolean logCommit)
Commits a transaction given its id. |
void |
copyDump(java.lang.String dumpName,
java.lang.String remoteControllerName)
Copy a local dump over to a remote member of this distributed vdb, making it available for restore operation. |
void |
copyLogFromCheckpoint(java.lang.String dumpName,
java.lang.String controllerName)
Copies a chunk of the local virtual database recovery log onto a remote controller's peer virtual database log. |
void |
deleteLogUpToCheckpoint(java.lang.String checkpointName)
Deletes the recovery log (if any) from the begining upto the specified checkpoint. |
void |
disableAllBackends()
Prepare this virtual database for shutdown. |
void |
disableAllBackendsWithCheckpoint(java.lang.String checkpoint)
Disable all backends and store a checkpoint |
void |
disableBackendWithCheckpoint(java.lang.String backendName)
Disables a backend once all the pending write queries are executed. |
void |
enableAllBackends()
Enable all the backends without any check. |
void |
enableAllBackendsFromCheckpoint()
Enable all backends from their last known states that has been recorded in the recovery log, and enable only the backends which where properly disabled. |
void |
enableBackendFromCheckpoint(java.lang.String backendName)
Enable the given backend from its last known checkpoint |
void |
enableBackendFromCheckpoint(java.lang.String backendName,
java.lang.String checkpointName)
Enable the given backend from the given checkpoint. |
boolean |
equals(java.lang.Object other)
Two virtual databases are equal if they have the same name and group. |
ControllerResultSet |
execReadRequest(SelectRequest request)
Performs a read request and returns the reply. |
ControllerResultSet |
execReadStoredProcedure(StoredProcedure proc)
Call a stored procedure that returns a ResultSet. |
int |
execWriteRequest(AbstractWriteRequest request)
Performs a write request and returns the number of rows affected. |
ControllerResultSet |
execWriteRequestWithKeys(AbstractWriteRequest request)
Performs a write request and returns the auto generated keys. |
protected int |
execWriteStoredProcedure(StoredProcedure proc)
Call a stored procedure that performs an update. |
void |
forceDisableBackend(java.lang.String backendName)
Disables a backend that is currently enabled on this virtual database (without further check). |
void |
forceEnableAllBackendsFromCheckpoint(java.lang.String checkpoint)
Prepare this virtual database for startup. |
void |
forceEnableBackend(java.lang.String backendName)
Enables a backend that has been previously added to this virtual database and that is in the disabled state. |
java.util.ArrayList |
getActiveThreads()
Returns the activeThreads. |
java.util.ArrayList |
getAllBackendNames()
Get a list of all DatabaseBackend names. |
DatabaseBackend |
getAndCheckBackend(java.lang.String backendName,
int testEnable)
Find the DatabaseBackend corresponding to the given backend name and check if it is possible to disable this backend. |
java.lang.String |
getAssociatedString()
Allow to retrieve internationalization description on mbeans as well |
AuthenticationManager |
getAuthenticationManager()
Returns the authentication manager of this virtual database. |
DumpInfo[] |
getAvailableDumps()
Get all available dump info for this virtual database |
java.lang.String |
getBackendInformation(java.lang.String backendName)
Return information about the specified backend. |
java.util.ArrayList |
getBackends()
Return the list of all backends |
java.lang.String |
getBackendSchema(java.lang.String backendName)
The getXml() method does not return the schema if it is not static anymore, to avoid confusion between static and dynamic schema. |
java.lang.String |
getBackendState(java.lang.String backendName)
Return the state of a given database backend |
BackendStatistics |
getBackendStatistics(java.lang.String backendName)
Retrieves an array of statistics of the given backend for this virtual database |
java.lang.String[] |
getBackuperNames()
Get the names of the Backupers available from this
BackupManager . |
AbstractBlobFilter |
getBlobFilter()
Return the BLOB filter used for this database |
int |
getCurrentNbOfThreads()
Returns the currentNbOfThreads. |
java.lang.String |
getDatabaseName()
Gets the virtual database name to be used by the client (C-JDBC driver) This method should be used for local references only (it is faster). |
java.lang.String |
getDatabaseProductName()
|
DatabaseSchema |
getDatabaseSchemaFromActiveBackends()
Get the current database schema from merging the schemas of all active backends. |
DatabaseSchema |
getDatabaseSchemaFromActiveBackendsAndRefreshDatabaseProductNames()
Get the current database schema from merging the schemas of all active backends. |
protected java.lang.String |
getDistributionXml()
Get the XML dump of the Distribution element if any. |
java.lang.String |
getDumpFormatForBackuper(java.lang.String backuperName)
Get the dump format associated to a given Backuper |
VirtualDatabaseDynamicMetaData |
getDynamicMetaData()
|
int |
getIdleThreads()
Returns the number of idle zorker threads. |
int |
getMaxNbOfConnections()
Returns the maxNbOfConnections. |
int |
getMaxNbOfThreads()
Returns the maxNbOfThreads. |
long |
getMaxThreadIdleTime()
Returns the maxThreadIdleTime. |
int |
getMinNbOfThreads()
Returns the minNbOfThreads. |
java.util.ArrayList |
getPendingConnections()
Returns the pendingConnections. |
RequestManager |
getRequestManager()
Gets the request manager associated to this database. |
SQLMonitoring |
getSQLMonitor()
Returns the current SQL monitor |
int |
getSQLShortFormLength()
Return the sql short form length to use when reporting an error. |
VirtualDatabaseStaticMetaData |
getStaticMetaData()
Get the whole static metadata for this virtual database. |
java.util.LinkedList |
getTotalOrderQueue()
Returns the totalOrderQueue value. |
java.lang.String |
getVirtualDatabaseName()
Gets the virtual database name to be used by the client (C-JDBC driver) |
java.lang.String |
getXml()
Retrieves this VirtualDatabase object in xml format |
boolean |
hasRecoveryLog()
Indicate if there is a recovery log defined for this virtual database |
boolean |
hasResultCache()
Indicate if there is a result cache defined for this virtual database |
boolean |
isDistributed()
Is this virtual database distributed ? |
boolean |
isPoolConnectionThreads()
Returns the poolConnectionThreads. |
boolean |
isShuttingDown()
Return true if this database is shutting down. |
void |
releaseReadLockBackendLists()
Releases the read lock on the backend lists (both enabled and disabled backends). |
void |
releaseSavepoint(long transactionId,
java.lang.String name)
Releases a savepoint given its name from a transaction given its id. |
void |
removeBackend(DatabaseBackend db)
Remove a backend from this virtual database. |
void |
removeBackend(java.lang.String backend)
Remove a backend from the virtual database list. |
void |
removeCheckpoint(java.lang.String checkpointName)
Remove a checkpoint from the recovery log of this virtual database |
void |
removeCurrentNbOfThread()
Substract one to currentNbOfThreads. |
boolean |
removeDump(java.lang.String dumpName)
Remove a dump from the controller repository |
void |
removeIdleThread()
Remove an idle thread. |
void |
replicateBackend(java.lang.String backendName,
java.lang.String newBackendName,
java.util.Map parameters)
Add an additionnal backend to the virtual database with connection managers identical to the backend replicated. |
void |
restoreDumpOnBackend(java.lang.String databaseBackendName,
java.lang.String login,
java.lang.String password,
java.lang.String dumpName,
java.util.ArrayList tables)
Restore a dump on a specific backend. |
java.lang.String[][] |
retrieveBackendsData()
Retrieves an array of data on the backends for this virtual database |
void |
rollback(long transactionId,
boolean logRollback)
Rollbacks a transaction given its id. |
void |
rollback(long transactionId,
java.lang.String savepointName)
Rollbacks a transaction given its id to a savepoint given its name |
void |
setAuthenticationManager(AuthenticationManager authenticationManager)
Sets the authentication manager for this virtual database. |
void |
setBackendLastKnownCheckpoint(java.lang.String backendName,
java.lang.String checkpoint)
Sets the last known checkpoint of a backend. |
void |
setBlobFilter(AbstractBlobFilter filter)
Set the BLOB filter to use for this database. |
void |
setCheckpoint(java.lang.String checkpointName)
Set a checkpoint for this virtual database. |
void |
setMaxNbOfConnections(int maxNbOfConnections)
Sets the maxNbOfConnections. |
void |
setMaxNbOfThreads(int maxNbOfThreads)
Sets the maxNbOfThreads. |
void |
setMaxThreadIdleTime(long maxThreadIdleTime)
Sets the maxThreadIdleTime. |
void |
setMinNbOfThreads(int minNbOfThreads)
Sets the minNbOfThreads. |
void |
setMonitoringToActive(boolean active)
If a monitoring section exists, we can set the monitoring on or off by calling this method. |
void |
setPoolConnectionThreads(boolean poolConnectionThreads)
Sets the poolConnectionThreads. |
void |
setRequestManager(RequestManager requestManager)
Sets a new request manager for this database. |
int |
setSavepoint(long transactionId)
Sets a unnamed savepoint to a transaction given its id. |
void |
setSavepoint(long transactionId,
java.lang.String name)
Sets a savepoint given its desired name to a transaction given its id. |
void |
setSQLMonitor(SQLMonitoring sqlMonitor)
Sets a new SQL Monitor |
void |
setStaticDatabaseSchema(DatabaseSchema schema)
Sets a new static database schema for this database if no one exist or merge the given schema to the existing one. |
void |
setTotalOrderQueue(java.util.LinkedList newQueue)
Sets the totalOrderQueue. |
void |
shutdown(int level)
Shutdown this virtual database. |
void |
storeBackendsInfo()
Write the checkpoints for all backends on the recovery log |
void |
transferBackend(java.lang.String backend,
java.lang.String controllerDestination)
Transfer the backend to the destinated controller. |
void |
transferDump(java.lang.String dumpName,
java.lang.String remoteControllerName,
boolean noCopy)
Transfer specified dump over to specified vdb's controller, making it available for restore operation. |
void |
updateDumpPath(java.lang.String dumpName,
java.lang.String newPath)
Update the path of the dump for a given dumpName. |
java.util.ArrayList |
viewAllClientNames()
Get all users connected to that database |
java.lang.String[] |
viewBackendInformation(java.lang.String backendName)
Returns an array of information on this backend The method above is not used at the moment ... |
java.util.ArrayList |
viewCheckpointNames()
Returns an array of names of all the checkpoint available in the recovery log of this virtual dabase. |
java.lang.String[] |
viewControllerList()
Return the list of controllers defining this virtual database. |
java.util.Hashtable |
viewGroupBackends()
Returns a mapping of controller jmx names with their backends. |
java.lang.String |
viewOwningController()
Name of the controller owning this virtual database |
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, toString, wait, wait, wait |
Field Detail |
private static final long serialVersionUID
protected java.lang.String name
protected AuthenticationManager authenticationManager
protected java.util.ArrayList backends
ArrayList
of DatabaseBackend
objects
protected ReadPrioritaryFIFOWriteLock rwLock
protected RequestManager requestManager
protected java.util.LinkedList totalOrderQueue
public Trace logger
protected Trace requestLogger
private java.util.ArrayList activeThreads
private int idleThreads
private java.util.ArrayList pendingConnections
protected int maxNbOfConnections
protected boolean poolConnectionThreads
protected long maxThreadIdleTime
protected int minNbOfThreads
protected int maxNbOfThreads
protected int currentNbOfThreads
protected VirtualDatabaseDynamicMetaData metadata
private VirtualDatabaseStaticMetaData staticMetadata
private SQLMonitoring sqlMonitor
public static final int CHECK_BACKEND_ENABLE
public static final int CHECK_BACKEND_DISABLE
public static final int NO_CHECK_BACKEND
private int sqlShortFormLength
private AbstractBlobFilter blobFilter
Controller controller
private java.lang.String databaseProductNames
private boolean shuttingDown
Constructor Detail |
public VirtualDatabase(Controller controller, java.lang.String name, int maxConnections, boolean pool, int minThreads, int maxThreads, long maxThreadIdleTime, int sqlShortFormLength, AbstractBlobFilter blobFilter) throws javax.management.NotCompliantMBeanException, JmxException
VirtualDatabase
instance.
name
- the virtual database name.maxConnections
- maximum number of concurrent connections.pool
- should we use a pool of threads for handling connections?minThreads
- minimum number of threads in the poolmaxThreads
- maximum number of threads in the poolmaxThreadIdleTime
- maximum time a thread can remain idle before being
removed from the pool.sqlShortFormLength
- maximum number of characters of an SQL statement
to diplay in traces or exceptionsblobFilter
- encoding method for blobscontroller
- the controller we belong to
javax.management.NotCompliantMBeanException
- in case the bean does not comply with
jmx
JmxException
- could not register mbeanMethod Detail |
public final void acquireReadLockBackendLists() throws java.lang.InterruptedException
ArrayList
.
java.lang.InterruptedException
- if an error occurspublic final void releaseReadLockBackendLists()
ArrayList
.
public boolean isDistributed()
isDistributed
in interface VirtualDatabaseMBean
public boolean checkUserAuthentication(java.lang.String virtualLogin, java.lang.String virtualPassword)
virtualLogin
- the virtual user loginvirtualPassword
- the virtual user password
true
if the login/password is known from the
AuthenticationManager
. Returns false
if no AuthenticationManager
is defined.public boolean checkAdminAuthentication(java.lang.String adminLogin, java.lang.String adminPassword)
checkAdminAuthentication
in interface VirtualDatabaseMBean
adminLogin
- admin user loginadminPassword
- admin user password
true
if the login/password is known from the
AuthenticationManager
. Returns false
if no AuthenticationManager
is defined.public ControllerResultSet execReadRequest(SelectRequest request) throws java.sql.SQLException
request
- the request to execute
ControllerResultSet
value
java.sql.SQLException
- if the request failspublic int execWriteRequest(AbstractWriteRequest request) throws java.sql.SQLException
request
- the request to execute
java.sql.SQLException
- if the request failspublic ControllerResultSet execWriteRequestWithKeys(AbstractWriteRequest request) throws java.sql.SQLException
request
- the request to execute
java.sql.SQLException
- if the request failspublic ControllerResultSet execReadStoredProcedure(StoredProcedure proc) throws java.sql.SQLException
proc
- the stored procedure call
java.sql.ResultSet
value
java.sql.SQLException
- if an error occursprotected int execWriteStoredProcedure(StoredProcedure proc) throws java.sql.SQLException
proc
- the stored procedure call
java.sql.SQLException
- if an error occurspublic long begin(java.lang.String login) throws java.sql.SQLException
Connection.setAutoCommit(boolean)
is
called with false
argument.
Note that the transaction begin is not logged in the recovery log by this method, you will have to call logLazyTransactionBegin.
login
- the login used by the connection
java.sql.SQLException
- if an error occursRequestManager.logLazyTransactionBegin(long)
public void abort(long transactionId, boolean logAbort) throws java.sql.SQLException
transactionId
- id of the transaction to abortlogAbort
- true if the abort (in fact rollback) should be logged in
the recovery log
java.sql.SQLException
- if an error occurspublic void commit(long transactionId, boolean logCommit) throws java.sql.SQLException
transactionId
- the transaction idlogCommit
- true if the commit should be logged in the recovery log
java.sql.SQLException
- if an error occurspublic void rollback(long transactionId, boolean logRollback) throws java.sql.SQLException
transactionId
- the transaction idlogRollback
- true if the rollback should be logged in the recovery
log
java.sql.SQLException
- if an error occurspublic void rollback(long transactionId, java.lang.String savepointName) throws java.sql.SQLException
transactionId
- the transaction idsavepointName
- the name of the savepoint
java.sql.SQLException
- if an error occurspublic int setSavepoint(long transactionId) throws java.sql.SQLException
transactionId
- the transaction id
java.sql.SQLException
- if an error occurspublic void setSavepoint(long transactionId, java.lang.String name) throws java.sql.SQLException
transactionId
- the transaction idname
- the desired name of the savepoint
java.sql.SQLException
- if an error occurspublic void releaseSavepoint(long transactionId, java.lang.String name) throws java.sql.SQLException
transactionId
- the transaction idname
- the name of the savepoint
java.sql.SQLException
- if an error occurspublic void addBackend(DatabaseBackend db) throws VirtualDatabaseException
db
- the database backend to add
VirtualDatabaseException
- if an error occurspublic void addBackend(DatabaseBackend db, boolean checkForCompliance) throws VirtualDatabaseException
db
- the database backend to addcheckForCompliance
- should load the driver ?
VirtualDatabaseException
- if an error occurspublic void forceDisableBackend(java.lang.String backendName) throws VirtualDatabaseException
VirtualDatabaseMBean
forceDisableBackend
in interface VirtualDatabaseMBean
backendName
- The database backend logical name to enable
VirtualDatabaseException
- in case of communication-related errorVirtualDatabaseMBean.forceDisableBackend(String)
public void disableAllBackends() throws VirtualDatabaseException
disableAllBackends
in interface VirtualDatabaseMBean
VirtualDatabaseException
- if an error occurspublic void disableBackendWithCheckpoint(java.lang.String backendName) throws VirtualDatabaseException
VirtualDatabaseMBean
disableBackendWithCheckpoint
in interface VirtualDatabaseMBean
backendName
- The database backend logical name to disable
VirtualDatabaseException
- in case of communication-related errorVirtualDatabaseMBean.disableBackendWithCheckpoint(String)
public void disableAllBackendsWithCheckpoint(java.lang.String checkpoint) throws VirtualDatabaseException
VirtualDatabaseMBean
disableAllBackendsWithCheckpoint
in interface VirtualDatabaseMBean
checkpoint
- the name of the checkpoitn
VirtualDatabaseException
- if failsVirtualDatabaseMBean.disableAllBackendsWithCheckpoint(java.lang.String)
public void forceEnableBackend(java.lang.String backendName) throws VirtualDatabaseException
VirtualDatabaseMBean
forceEnableBackend
in interface VirtualDatabaseMBean
backendName
- The database backend logical name to enable
VirtualDatabaseException
- in case of communication-related errorVirtualDatabaseMBean.forceEnableBackend(String)
public void enableBackendFromCheckpoint(java.lang.String backendName, java.lang.String checkpointName) throws VirtualDatabaseException
backendName
- backend to enablecheckpointName
- checkpoint to enable from
VirtualDatabaseException
- if an error occurspublic void enableBackendFromCheckpoint(java.lang.String backendName) throws VirtualDatabaseException
VirtualDatabaseMBean
enableBackendFromCheckpoint
in interface VirtualDatabaseMBean
backendName
- the name of the backend to enable
VirtualDatabaseException
- if enable failed, or if there is no last
known checkpointVirtualDatabaseMBean.enableBackendFromCheckpoint(java.lang.String)
public void enableAllBackends() throws VirtualDatabaseException
enableAllBackends
in interface VirtualDatabaseMBean
VirtualDatabaseException
- if failspublic void enableAllBackendsFromCheckpoint() throws VirtualDatabaseException
VirtualDatabaseMBean
enableAllBackendsFromCheckpoint
in interface VirtualDatabaseMBean
VirtualDatabaseException
- if failsVirtualDatabaseMBean.enableAllBackendsFromCheckpoint()
public void forceEnableAllBackendsFromCheckpoint(java.lang.String checkpoint) throws VirtualDatabaseException
checkpoint
- checkpoint for recovery log
VirtualDatabaseException
- if failspublic java.util.ArrayList getAllBackendNames() throws VirtualDatabaseException
VirtualDatabaseMBean
getAllBackendNames
in interface VirtualDatabaseMBean
ArrayList
of String
representing database backend names
VirtualDatabaseException
- if an error occursVirtualDatabaseMBean.getAllBackendNames()
public DatabaseBackend getAndCheckBackend(java.lang.String backendName, int testEnable) throws VirtualDatabaseException
backendName
- backend to look fortestEnable
- NO_CHECK_BACKEND no check is done, CHECK_BACKEND_DISABLE
check if it is possible to disable the backend,
CHECK_BACKEND_ENABLE check if it is possible to enable the backend
VirtualDatabaseException
- if an error occurspublic void replicateBackend(java.lang.String backendName, java.lang.String newBackendName, java.util.Map parameters) throws VirtualDatabaseException
VirtualDatabaseMBean
replicateBackend
in interface VirtualDatabaseMBean
backendName
- the backend to replicate and to use parameters from.newBackendName
- the new backend name.parameters
- parameters to override or modify when replicating to the
new backend
VirtualDatabaseException
- if cannot replicate backendVirtualDatabaseMBean.replicateBackend(java.lang.String,
java.lang.String, java.util.Map)
public void removeBackend(java.lang.String backend) throws VirtualDatabaseException
VirtualDatabaseMBean
removeBackend
in interface VirtualDatabaseMBean
backend
- the name of the backend to remove
VirtualDatabaseException
- if the backend does not existVirtualDatabaseMBean.removeBackend(java.lang.String)
public void removeBackend(DatabaseBackend db) throws VirtualDatabaseException
db
- the database backend to remove
VirtualDatabaseException
- if an error occurspublic void transferBackend(java.lang.String backend, java.lang.String controllerDestination) throws VirtualDatabaseException
VirtualDatabaseMBean
transferBackend
in interface VirtualDatabaseMBean
backend
- the backend to transfercontrollerDestination
- the controller to copy the backend to
VirtualDatabaseException
- if transfer failedVirtualDatabaseMBean.transferBackend(java.lang.String,
java.lang.String)
public java.lang.String[] getBackuperNames()
VirtualDatabaseMBean
Backupers
available from this
BackupManager
.
getBackuperNames
in interface VirtualDatabaseMBean
String
representing
the name of the Backupers
VirtualDatabaseMBean.getBackuperNames()
public java.lang.String getDumpFormatForBackuper(java.lang.String backuperName)
VirtualDatabaseMBean
Backuper
getDumpFormatForBackuper
in interface VirtualDatabaseMBean
backuperName
- name associated to a Backuper
Backuper
VirtualDatabaseMBean.getDumpFormatForBackuper(java.lang.String)
public void backupBackend(java.lang.String backendName, java.lang.String login, java.lang.String password, java.lang.String dumpName, java.lang.String backuperName, java.lang.String path, java.util.ArrayList tables) throws VirtualDatabaseException
VirtualDatabaseMBean
backupBackend
in interface VirtualDatabaseMBean
backendName
- the target backend to backuplogin
- the login to use to connect to the database for the backup
operationpassword
- the password to use to connect to the database for the
backup operationdumpName
- the name of the dump to createbackuperName
- the logical name of the backuper to usepath
- the path where to store the dumptables
- the list of tables to backup, null means all tables
VirtualDatabaseException
- if the backup failsVirtualDatabaseMBean.backupBackend(String,
String, String, String, String, String, ArrayList)
public DumpInfo[] getAvailableDumps() throws VirtualDatabaseException
VirtualDatabaseMBean
getAvailableDumps
in interface VirtualDatabaseMBean
DumpInfo
containing the available dump
info for this virtual database. Cannot be null but can be empty.
VirtualDatabaseException
- if cannot retrieve dump informationsVirtualDatabaseMBean.getAvailableDumps()
public void updateDumpPath(java.lang.String dumpName, java.lang.String newPath) throws VirtualDatabaseException
VirtualDatabaseMBean
updateDumpPath
in interface VirtualDatabaseMBean
dumpName
- name of the dumpnewPath
- new path for the dump
VirtualDatabaseException
- if cannot update the pathVirtualDatabaseMBean.updateDumpPath(java.lang.String,
java.lang.String)
public boolean removeDump(java.lang.String dumpName)
VirtualDatabaseMBean
removeDump
in interface VirtualDatabaseMBean
dumpName
- name of the dump to remove
true
if the dump was removed, false
otherwiseVirtualDatabaseMBean.removeDump(String)
public void removeCheckpoint(java.lang.String checkpointName) throws VirtualDatabaseException
removeCheckpoint
in interface VirtualDatabaseMBean
checkpointName
- to remove
VirtualDatabaseException
- if an error occurspublic void restoreDumpOnBackend(java.lang.String databaseBackendName, java.lang.String login, java.lang.String password, java.lang.String dumpName, java.util.ArrayList tables) throws VirtualDatabaseException
VirtualDatabaseMBean
This method disables the backend and leave it disabled after recovery
process. The user has to call the enableBackendFromCheckpoint
after this.
restoreDumpOnBackend
in interface VirtualDatabaseMBean
databaseBackendName
- the name of the backend to restorelogin
- the login to use to connect to the database for the restore
operationpassword
- the password to use to connect to the database for the
restore operationdumpName
- the name of the dump to restoretables
- the list of tables to restore, null means all tables
VirtualDatabaseException
- if the restore operation failedVirtualDatabaseMBean.restoreDumpOnBackend(String,
String, String, String, ArrayList)
public void setBackendLastKnownCheckpoint(java.lang.String backendName, java.lang.String checkpoint) throws VirtualDatabaseException
VirtualDatabaseMBean
setBackendLastKnownCheckpoint
in interface VirtualDatabaseMBean
backendName
- backendcheckpoint
- checkpoint
VirtualDatabaseException
- if failsVirtualDatabaseMBean.setBackendLastKnownCheckpoint(java.lang.String, java.lang.String)
public java.util.ArrayList viewCheckpointNames()
VirtualDatabaseMBean
viewCheckpointNames
in interface VirtualDatabaseMBean
ArrayList
of checkpoint names. Can be emptyVirtualDatabaseMBean.viewCheckpointNames()
public void addCurrentNbOfThread()
public void addIdleThread()
public int getCurrentNbOfThreads()
VirtualDatabaseMBean
getCurrentNbOfThreads
in interface VirtualDatabaseMBean
VirtualDatabaseMBean.getCurrentNbOfThreads()
public int getIdleThreads()
public int getMaxNbOfThreads()
public long getMaxThreadIdleTime()
public int getMinNbOfThreads()
public boolean isPoolConnectionThreads()
public void removeCurrentNbOfThread()
public void removeIdleThread()
public void setMaxThreadIdleTime(long maxThreadIdleTime)
maxThreadIdleTime
- The maxThreadIdleTime to setpublic void setMinNbOfThreads(int minNbOfThreads)
minNbOfThreads
- The minNbOfThreads to setpublic void setPoolConnectionThreads(boolean poolConnectionThreads)
poolConnectionThreads
- The poolConnectionThreads to setpublic java.util.ArrayList getActiveThreads()
public AuthenticationManager getAuthenticationManager()
AuthenticationManager
instancepublic java.lang.String getBackendInformation(java.lang.String backendName) throws VirtualDatabaseException
VirtualDatabaseMBean
getBackendInformation
in interface VirtualDatabaseMBean
backendName
- the backend logical name
VirtualDatabaseException
- if an error occursVirtualDatabaseMBean.getBackendInformation(String)
public java.util.ArrayList getBackends()
ArrayList
of DatabaseBackend
Objectspublic java.lang.String getBackendSchema(java.lang.String backendName) throws VirtualDatabaseException
VirtualDatabaseMBean
getBackendSchema
in interface VirtualDatabaseMBean
backendName
- the name of the backend to get the schema from
VirtualDatabaseException
- if an error occurs while accessing the
backend, or if the backend does not exist.VirtualDatabaseMBean.getBackendSchema(java.lang.String)
public java.lang.String getBackendState(java.lang.String backendName) throws VirtualDatabaseException
VirtualDatabaseMBean
getBackendState
in interface VirtualDatabaseMBean
backendName
- the name of the backend
String
description of the database backend
VirtualDatabaseException
- if failsVirtualDatabaseMBean.getBackendState(java.lang.String)
public AbstractBlobFilter getBlobFilter()
public java.lang.String getDatabaseName()
getVirtualDatabaseName()
.
getVirtualDatabaseName()
public java.lang.String getDatabaseProductName()
DatabaseMetaData.getDatabaseProductName()
public VirtualDatabaseDynamicMetaData getDynamicMetaData()
DatabaseMetaData
public DatabaseSchema getDatabaseSchemaFromActiveBackends() throws java.sql.SQLException
java.sql.SQLException
- if an error occurspublic DatabaseSchema getDatabaseSchemaFromActiveBackendsAndRefreshDatabaseProductNames() throws java.sql.SQLException
java.sql.SQLException
- if an error occurspublic int getMaxNbOfConnections()
public java.util.ArrayList getPendingConnections()
public RequestManager getRequestManager()
RequestManager
instancepublic VirtualDatabaseStaticMetaData getStaticMetaData()
public java.lang.String getVirtualDatabaseName()
getVirtualDatabaseName
in interface VirtualDatabaseMBean
public SQLMonitoring getSQLMonitor()
SQLMonitoring
instance or null if no monitor is
definedpublic int getSQLShortFormLength()
AbstractRequest.getSQLShortForm(int)
public java.util.LinkedList getTotalOrderQueue()
public boolean hasRecoveryLog()
VirtualDatabaseMBean
hasRecoveryLog
in interface VirtualDatabaseMBean
true
if the recovery log is defined and can be
accessed, false
otherwiseVirtualDatabaseMBean.hasRecoveryLog()
public boolean hasResultCache()
VirtualDatabaseMBean
hasResultCache
in interface VirtualDatabaseMBean
true
if a request cache is defined and can be
accessed, false
otherwiseVirtualDatabaseMBean.hasResultCache()
public void setAuthenticationManager(AuthenticationManager authenticationManager)
authenticationManager
- the AuthenticationManager
to
setpublic void setBlobFilter(AbstractBlobFilter filter)
filter
- the filter to use.public void setStaticDatabaseSchema(DatabaseSchema schema)
schema
- the new database shemapublic void setMaxNbOfConnections(int maxNbOfConnections)
maxNbOfConnections
- The maxNbOfConnections to setpublic void setMaxNbOfThreads(int maxNbOfThreads)
maxNbOfThreads
- The maxNbOfThreads to setpublic void setRequestManager(RequestManager requestManager)
requestManager
- the new request manager.public void setSQLMonitor(SQLMonitoring sqlMonitor)
sqlMonitor
- the new SQL monitorpublic void setTotalOrderQueue(java.util.LinkedList newQueue)
newQueue
- the new queue to usepublic void setMonitoringToActive(boolean active) throws VirtualDatabaseException
VirtualDatabaseMBean
setMonitoringToActive
in interface VirtualDatabaseMBean
active
- should set the monitor to on or off
VirtualDatabaseException
- if there is no monitor.VirtualDatabaseMBean.setMonitoringToActive(boolean)
public boolean equals(java.lang.Object other)
other
- the object to compare with
true
if the two virtual databases are equalspublic void cleanMonitoringData() throws VirtualDatabaseException
VirtualDatabaseMBean
cleanMonitoringData
in interface VirtualDatabaseMBean
VirtualDatabaseException
- if there is no monitor.VirtualDatabaseMBean.cleanMonitoringData()
public java.lang.String[][] retrieveBackendsData() throws VirtualDatabaseException
VirtualDatabaseMBean
retrieveBackendsData
in interface VirtualDatabaseMBean
String[][]
of formatted data for all backends
VirtualDatabaseException
VirtualDatabaseMBean.retrieveBackendsData()
public BackendStatistics getBackendStatistics(java.lang.String backendName) throws VirtualDatabaseException
VirtualDatabaseMBean
getBackendStatistics
in interface VirtualDatabaseMBean
backendName
- name of the backend
BackendStatistics[]
of formatted data for all
backends or null
if the backend does not exist
VirtualDatabaseException
VirtualDatabaseMBean.getBackendStatistics(java.lang.String)
public boolean isShuttingDown()
public void shutdown(int level)
VirtualDatabaseMBean
shutdown
in interface VirtualDatabaseMBean
level
- Constants.SHUTDOWN_WAIT, Constants.SHUTDOWN_SAFE or
Constants.SHUTDOWN_FORCEVirtualDatabaseMBean.shutdown(int)
public void storeBackendsInfo()
public java.util.ArrayList viewAllClientNames()
ArrayList
of strings containing the clients
usernamepublic java.lang.String[] viewBackendInformation(java.lang.String backendName) throws VirtualDatabaseException
VirtualDatabaseMBean
viewBackendInformation
in interface VirtualDatabaseMBean
backendName
- the name of the backend
String[]
VirtualDatabaseException
- if an error occursVirtualDatabaseMBean.viewBackendInformation(java.lang.String)
public java.lang.String[] viewControllerList()
VirtualDatabaseMBean
viewOwningController
otherwise returns an array of
controller configuring this DistributedVirtualDatabase
viewControllerList
in interface VirtualDatabaseMBean
String[]
of controller names.VirtualDatabaseMBean.viewControllerList()
public java.util.Hashtable viewGroupBackends() throws VirtualDatabaseException
VirtualDatabaseMBean
viewGroupBackends
in interface VirtualDatabaseMBean
Hashtable
of controllerName -->
ArrayList[BackendInfo]
VirtualDatabaseException
- if cannot return the resultVirtualDatabaseMBean.viewGroupBackends()
public java.lang.String viewOwningController()
VirtualDatabaseMBean
viewOwningController
in interface VirtualDatabaseMBean
VirtualDatabaseMBean.viewOwningController()
public java.lang.String getAssociatedString()
AbstractStandardMBean
getAssociatedString
in class AbstractStandardMBean
AbstractStandardMBean.getAssociatedString()
public java.lang.String getXml()
VirtualDatabase
object in xml format
getXml
in interface VirtualDatabaseMBean
protected java.lang.String getDistributionXml()
public void deleteLogUpToCheckpoint(java.lang.String checkpointName) throws VirtualDatabaseException
VirtualDatabaseMBean
deleteLogUpToCheckpoint
in interface VirtualDatabaseMBean
checkpointName
- the name of the checkpoint upto which to delete the
recovery log.
VirtualDatabaseException
- if there is no recovery log, or in case of
error.VirtualDatabaseMBean.deleteLogUpToCheckpoint(java.lang.String)
public void copyLogFromCheckpoint(java.lang.String dumpName, java.lang.String controllerName) throws VirtualDatabaseException
VirtualDatabaseMBean
copyLogFromCheckpoint
in interface VirtualDatabaseMBean
dumpName
- the name of the dump (which gives associated checkpoint)
from which to perform the copy.controllerName
- the remote controller to send the copy to
VirtualDatabaseException
- if there is no recovery log, or the
virtual database is not distributed, or in case of error.VirtualDatabaseMBean.copyLogFromCheckpoint(java.lang.String,
java.lang.String)
public void setCheckpoint(java.lang.String checkpointName) throws VirtualDatabaseException
checkpointName
- the desired name of the checkpoint
VirtualDatabaseException
- in case of error. Wraps any error: local
recovery log failure, comm failure, remote failure.public void copyDump(java.lang.String dumpName, java.lang.String remoteControllerName) throws VirtualDatabaseException
VirtualDatabaseMBean
copyDump
in interface VirtualDatabaseMBean
dumpName
- the name of the dump to copy. Should exist locally, and not
remotely.remoteControllerName
- the remote controller to talk to.
VirtualDatabaseException
- in case of error.VirtualDatabaseMBean.copyDump(java.lang.String,
java.lang.String)
public void transferDump(java.lang.String dumpName, java.lang.String remoteControllerName, boolean noCopy) throws VirtualDatabaseException
VirtualDatabaseMBean
transferDump
in interface VirtualDatabaseMBean
dumpName
- the name of the dump to copy. Should exist locally, and not
remotely.remoteControllerName
- the remote controller to talk to.noCopy
- specifies whether or not to actually copy the dump. Default:
false. No-copy is a useful option in case of NFS/shared dumps.
VirtualDatabaseException
- in case of errorVirtualDatabaseMBean.transferDump(java.lang.String,
java.lang.String, boolean)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |