org.objectweb.cjdbc.controller
Interface ControllerMBean

All Known Implementing Classes:
Controller

public interface ControllerMBean

JMX Interface of the C-JDBC Controller.

Version:
1.0
Author:
Emmanuel Cecchet , Mathieu Peltier

Method Summary
 void addDriver(byte[] bytes)
          Reads a driver binary data
 java.lang.String addDriver(java.lang.String filename)
          Reads a driver JAR file.
 void addVirtualDatabases(java.lang.String xml)
          Registers one or several virtual databases in the controller.
 void addVirtualDatabases(java.lang.String xml, java.lang.String virtualName, boolean autoEnable, java.lang.String checkPoint)
          Registers one or several virtual databases in the controller.
 java.lang.String getBindName()
          Gets the controller name.
 int getPortNumber()
          Return this controller port number
 java.lang.String getVersionNumber()
          Gets the controller version.
 java.util.ArrayList getVirtualDatabases()
          Gets the name of the available virtual databases.
 java.lang.String loadXML(java.lang.String filename)
          Reads a XML configuration file.
 java.lang.String loadXmlConfiguration(java.lang.String filename, java.lang.String virtualName, boolean autoEnable, java.lang.String checkPoint)
          Reads an xml configuration file and search information to load the specified database
 void refreshLogConfiguration()
          Refreshs the logging system configuration by re-reading the log4j.properties file.
 java.lang.String removeVirtualDatabase(java.lang.String virtualname)
          Prevent the controller from accessing a virtual database thereafter
 java.lang.String saveConfiguration()
          Save current configuration of the controller to a default file location.
 void shutdown(int level)
          Turns the controller down by using default shutdown level
 java.lang.String viewConfiguration()
          Retrieve the configuration about this controller in xml format.
 java.lang.String viewInfo()
          Retrieve the information about this controller in xml format.
 

Method Detail

getBindName

public java.lang.String getBindName()
Gets the controller name.

Returns:
a String value containing the controller name.

getPortNumber

public int getPortNumber()
Return this controller port number

Returns:
a int containing the port code number

getVersionNumber

public java.lang.String getVersionNumber()
                                  throws java.rmi.RemoteException
Gets the controller version.

Returns:
a String value containing the version number
Throws:
java.rmi.RemoteException - if an error occurs

getVirtualDatabases

public java.util.ArrayList getVirtualDatabases()
                                        throws java.lang.Exception
Gets the name of the available virtual databases.

Returns:
ArrayList containing information
Throws:
java.lang.Exception - if an error occurs

addVirtualDatabases

public void addVirtualDatabases(java.lang.String xml)
                         throws ControllerException
Registers one or several virtual databases in the controller. The description of each Virtual Database must contain the definition of the backends and components (cache, scheduler, load balancer) to use.

This function expects the content of an XML file conforming to the C-JDBC DTD to be given as a single String object.

Parameters:
xml - XML code to parse
Throws:
ControllerException - if an error occurs while interpreting XML

addVirtualDatabases

public void addVirtualDatabases(java.lang.String xml,
                                java.lang.String virtualName,
                                boolean autoEnable,
                                java.lang.String checkPoint)
                         throws ControllerException
Registers one or several virtual databases in the controller. The description of each Virtual Database must contain the definition of the backends and components (cache, scheduler, load balancer) to use.

This function expects the content of an XML file conforming to the C-JDBC DTD to be given as a single String object.

Parameters:
xml - XML code to parse
virtualName - name of the virtual database
autoEnable - specify if should be enabled as soon as it is added
checkPoint - the checkpoint to use to enable the database
Throws:
ControllerException - if an error occurs while interpreting XML

refreshLogConfiguration

public void refreshLogConfiguration()
                             throws ControllerException
Refreshs the logging system configuration by re-reading the log4j.properties file.

Throws:
ControllerException - if the log4j.properties file cannot be found in classpath

loadXML

public java.lang.String loadXML(java.lang.String filename)
                         throws java.lang.Exception
Reads a XML configuration file.

Parameters:
filename - XML configuration file name
Returns:
a diagnostic message
Throws:
java.lang.Exception - if an error occurs

loadXmlConfiguration

public java.lang.String loadXmlConfiguration(java.lang.String filename,
                                             java.lang.String virtualName,
                                             boolean autoEnable,
                                             java.lang.String checkPoint)
                                      throws java.lang.Exception
Reads an xml configuration file and search information to load the specified database

Parameters:
filename - the path to the xml file
virtualName - the virtual database we want to load
autoEnable - Specifiy whether the backends should be enabled
checkPoint - Recover from specified checkpoint if needed
Returns:
a diagnostic message
Throws:
java.lang.Exception - if an error occurs

shutdown

public void shutdown(int level)
              throws ControllerException
Turns the controller down by using default shutdown level

Parameters:
level - Smart,Fast or Immediate.
Throws:
ControllerException - if unknown level or other error occurs.

addDriver

public java.lang.String addDriver(java.lang.String filename)
                           throws java.lang.Exception
Reads a driver JAR file.

Parameters:
filename - name of the file
Returns:
a diagnostic message
Throws:
java.lang.Exception - if an error occurs

addDriver

public void addDriver(byte[] bytes)
               throws java.lang.Exception
Reads a driver binary data

Parameters:
bytes - the data in a byte array
Throws:
java.lang.Exception - if fails

removeVirtualDatabase

public java.lang.String removeVirtualDatabase(java.lang.String virtualname)
                                       throws java.lang.Exception
Prevent the controller from accessing a virtual database thereafter

Parameters:
virtualname - the virtual database name to remove
Returns:
description message
Throws:
java.lang.Exception - if fails

viewInfo

public java.lang.String viewInfo()
                          throws java.lang.Exception
Retrieve the information about this controller in xml format.

Returns:
the complete xml formatted description of this controller
Throws:
java.lang.Exception - if fails

viewConfiguration

public java.lang.String viewConfiguration()
                                   throws java.lang.Exception
Retrieve the configuration about this controller in xml format.

Returns:
the complete xml formatted description of this controller
Throws:
java.lang.Exception - if fails

saveConfiguration

public java.lang.String saveConfiguration()
                                   throws java.lang.Exception
Save current configuration of the controller to a default file location.

Returns:
status message
Throws:
java.lang.Exception - if fails


Copyright © 2002, 2003 - ObjectWeb Consortium - All Rights Reserved.