org.objectweb.cjdbc.common.jmx.mbeans
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)
          Adds a driver jar file sent in its binary form in the drivers directory of the controller.
 void addVirtualDatabases(java.lang.String xml)
          Registers one or several virtual databases in the controller.
 java.lang.String generateLogReport()
          Generate a log report on the controller now
 java.lang.String generateReport()
          Generate a report on the controller now
 int getBacklogSize()
          Get the controller socket backlog size.
 java.lang.String getControllerName()
          Gets the controller name.
 java.lang.String getJmxName()
          Gets the JMX name of the controller.
 java.lang.String getLoggingConfiguration()
          Get the configuration of the logging now.
 int getPortNumber()
          Return this controller port number
 java.lang.String getVersionNumber()
          Gets the controller version.
 java.util.ArrayList getVirtualDatabaseNames()
          Returns the names of currently available virtual databases.
 java.lang.String getXml()
          Return the xml version of the controller.xml file without doc type declaration, just data.
 boolean hasVirtualDatabase(java.lang.String name)
          Tests if a VirtualDatabase of a given name exists in this controller.
 boolean isShuttingDown()
          Is the controller shutting down ?
 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 setBacklogSize(int size)
          Set the controller socket backlog size.
 void shutdown(int level)
          Turns the controller down by using default shutdown level
 void updateLogConfigurationFile(java.lang.String newConfiguration)
          Update the log4j configuration file with the given content Also call refreshLogConfiguration method
 java.lang.String viewLogConfigurationFile()
          Retrieve the content of the log4j configuration file
 

Method Detail

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

getVirtualDatabaseNames

public java.util.ArrayList getVirtualDatabaseNames()
Returns the names of currently available virtual databases.

Returns:
ArrayList of String objects.

hasVirtualDatabase

public boolean hasVirtualDatabase(java.lang.String name)
Tests if a VirtualDatabase of a given name exists in this controller.

Parameters:
name - the virtual database name
Returns:
true if the virtual database exists

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

addDriver

public void addDriver(byte[] bytes)
               throws java.lang.Exception
Adds a driver jar file sent in its binary form in the drivers directory of the controller.

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

generateLogReport

public java.lang.String generateLogReport()
                                   throws java.lang.Exception
Generate a log report on the controller now

Returns:
the content of the logreport
Throws:
java.lang.Exception - if fails

generateReport

public java.lang.String generateReport()
                                throws java.lang.Exception
Generate a report on the controller now

Returns:
the content of the report
Throws:
java.lang.Exception - if fails

getLoggingConfiguration

public java.lang.String getLoggingConfiguration()
                                         throws java.lang.Exception
Get the configuration of the logging now.

Returns:
a String representing the logging configuration
Throws:
java.lang.Exception - if the logging configuration can not be returned

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

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.

getBacklogSize

public int getBacklogSize()
Get the controller socket backlog size.

Returns:
the backlog size

getControllerName

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

Returns:
a String value containing the controller name.

getJmxName

public java.lang.String getJmxName()
Gets the JMX name of the controller.

Returns:
a String value containing the jmx name of the controller

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

getXml

public java.lang.String getXml()
Return the xml version of the controller.xml file without doc type declaration, just data. The content is formatted using the controller xsl stylesheet.

Returns:
controller xml data

isShuttingDown

public boolean isShuttingDown()
Is the controller shutting down ?

Returns:
true if the controller is no more accepting connection

setBacklogSize

public void setBacklogSize(int size)
Set the controller socket backlog size.

Parameters:
size - backlog size

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

updateLogConfigurationFile

public void updateLogConfigurationFile(java.lang.String newConfiguration)
                                throws java.io.IOException,
                                       ControllerException
Update the log4j configuration file with the given content Also call refreshLogConfiguration method

Parameters:
newConfiguration - the content of the new log4j configuration
Throws:
java.io.IOException - if cannot access the log4j file
ControllerException - if could not refresh the logs

viewLogConfigurationFile

public java.lang.String viewLogConfigurationFile()
                                          throws java.io.IOException
Retrieve the content of the log4j configuration file

Returns:
String
Throws:
java.io.IOException - if IO problems


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