xmlBlaster 2.1.0 API

org.xmlBlaster.protocol.jdbc
Class JdbcDriver

java.lang.Object
  extended by org.xmlBlaster.protocol.jdbc.JdbcDriver
All Implemented Interfaces:
I_Driver, I_Publish, I_Plugin

public class JdbcDriver
extends java.lang.Object
implements I_Driver, I_Publish

JDBC driver class using the native interface.

The jdbc driver needs to be registered in xmlBlaster.properties and will be started on xmlBlaster startup, for example:

   ProtocolPlugin[JDBC][1.0]=org.xmlBlaster.protocol.jdbc.JdbcDriver

   CbProtocolPlugin[JDBC][1.0]=org.xmlBlaster.protocol.jdbc.CallbackJdbcDriver
 
The interface I_Driver is needed by xmlBlaster to instantiate and shutdown this driver implementation.

Author:
xmlBlaster@marcelruff.info
See Also:
engine.service.rdbms requirement

Field Summary
private  AddressServer addressServer
           
private  I_Authenticate authenticate
          The singleton handle for this xmlBlaster server
private  java.lang.String cbRegistrationKey
          key under which my callback is registered
private  Global glob
           
private static java.util.logging.Logger log
           
private  java.lang.String loginName
           
private  java.lang.String ME
           
private  NamedConnectionPool namedPool
          JDBC connection pooling, a pool for every user
private  java.lang.String passwd
           
private  java.lang.String sessionId
          The authentication session identifier
private  I_XmlBlaster xmlBlasterImpl
          The singleton handle for this xmlBlaster server
 
Constructor Summary
JdbcDriver()
           
 
Method Summary
 void activate()
          Activate xmlBlaster access through this protocol.
 void deActivate()
          Deactivate xmlBlaster access (standby), no clients can connect.
 java.lang.String getName()
          Get a human readable name of this driver.
 java.lang.String getProtocolId()
          Access the xmlBlaster internal name of the protocol driver.
 java.lang.String getRawAddress()
          Get the address how to access this driver.
 java.lang.String getType()
          Enforced by I_Plugin
 java.lang.String getVersion()
          Enforced by I_Plugin
private  void init(Global glob, AddressServer addressServer, I_Authenticate authenticate, I_XmlBlaster xmlBlasterImpl)
          Start xmlBlaster jdbc access.
 void init(Global glob, PluginInfo pluginInfo)
          Enforced by I_Plugin
private  void initDrivers()
          Load the JDBC drivers from xmlBlaster.properties.
 java.lang.String publish(MsgUnitRaw msgUnit)
          Send the XML based result set to the client.
 void shutdown()
          Instructs jdbc driver to shut down.
 void update(java.lang.String sender, byte[] content)
          Callback of xmlBlaster, a client wants to do a query ...
 java.lang.String usage()
          Command line usage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private java.lang.String ME

glob

private Global glob

log

private static java.util.logging.Logger log

authenticate

private I_Authenticate authenticate
The singleton handle for this xmlBlaster server


xmlBlasterImpl

private I_XmlBlaster xmlBlasterImpl
The singleton handle for this xmlBlaster server


sessionId

private java.lang.String sessionId
The authentication session identifier


namedPool

private NamedConnectionPool namedPool
JDBC connection pooling, a pool for every user


cbRegistrationKey

private java.lang.String cbRegistrationKey
key under which my callback is registered


addressServer

private AddressServer addressServer

loginName

private java.lang.String loginName

passwd

private java.lang.String passwd
Constructor Detail

JdbcDriver

public JdbcDriver()
Method Detail

getName

public java.lang.String getName()
Get a human readable name of this driver.

Enforced by interface I_Driver.

Specified by:
getName in interface I_Driver

getProtocolId

public java.lang.String getProtocolId()
Access the xmlBlaster internal name of the protocol driver.

Specified by:
getProtocolId in interface I_Driver
Returns:
"JDBC"

getType

public java.lang.String getType()
Enforced by I_Plugin

Specified by:
getType in interface I_Plugin

getVersion

public java.lang.String getVersion()
Enforced by I_Plugin

Specified by:
getVersion in interface I_Plugin

init

public void init(Global glob,
                 PluginInfo pluginInfo)
          throws XmlBlasterException
Enforced by I_Plugin

Specified by:
init in interface I_Plugin
Throws:
XmlBlasterException

getRawAddress

public java.lang.String getRawAddress()
Get the address how to access this driver.

Specified by:
getRawAddress in interface I_Driver
Returns:
null

init

private void init(Global glob,
                  AddressServer addressServer,
                  I_Authenticate authenticate,
                  I_XmlBlaster xmlBlasterImpl)
           throws XmlBlasterException
Start xmlBlaster jdbc access.

Enforced by interface I_Driver.

Parameters:
glob - Global handle to access logging, property and commandline args
Throws:
XmlBlasterException

activate

public void activate()
              throws XmlBlasterException
Activate xmlBlaster access through this protocol.

Specified by:
activate in interface I_Driver
Throws:
XmlBlasterException

deActivate

public void deActivate()
                throws XmlBlasterException
Deactivate xmlBlaster access (standby), no clients can connect.

Specified by:
deActivate in interface I_Driver
Throws:
XmlBlasterException

shutdown

public void shutdown()
              throws XmlBlasterException
Instructs jdbc driver to shut down.

Enforced by interface I_Driver.

Specified by:
shutdown in interface I_Plugin
Throws:
XmlBlasterException - if an exception occurs. The exception is handled by the RunLevelManager depending on how the plugin has been configured with the action:

<action do='STOP' onShutdownRunlevel='2' sequence='5' onFail='resource.configuration.pluginFailed'> If onFail is defined to something, the RunLevelManager will stop.


usage

public java.lang.String usage()
Command line usage.

Enforced by interface I_Driver.

Specified by:
usage in interface I_Driver

update

public void update(java.lang.String sender,
                   byte[] content)
Callback of xmlBlaster, a client wants to do a query ...


publish

public java.lang.String publish(MsgUnitRaw msgUnit)
                         throws XmlBlasterException
Send the XML based result set to the client.

Specified by:
publish in interface I_Publish
Throws:
XmlBlasterException

initDrivers

private void initDrivers()
Load the JDBC drivers from xmlBlaster.properties.

Default is JdbcDriver.drivers=sun.jdbc.odbc.JdbcOdbcDriver


xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.