com.sibvisions.rad.server.security
Class DataSourceHandler

java.lang.Object
  extended by com.sibvisions.rad.server.security.DataSourceHandler

public final class DataSourceHandler
extends Object

The DataSourceHandler allows access to credentials configured in the application configuration. It offers quick-access methods to the specific datasources.


Method Summary
static DBCredentials createDBCredentials(ApplicationZone pZone, String pName)
          Creates a new instance of DBCredentials with information provided in a given application.
static DBCredentials createDBCredentials(IConfiguration pConfig, String pName)
          Creates a new instance of DBCredentials with information provided in a given configuration.
static DBCredentials createDBCredentials(XmlNode pNode)
          Creates a new instance of DBCredentials with information provided in xml format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createDBCredentials

public static DBCredentials createDBCredentials(ApplicationZone pZone,
                                                String pName)
Creates a new instance of DBCredentials with information provided in a given application.

Parameters:
pZone - the application zone which contains the configuration
pName - the name of the datasource in the configuration. The name must exist in the following format:
              <application>
                <datasource>
                  <db name="dbname">
                    <driver>JDBC driver class</driver> (optional tag)
                    <url>connection url</url>
                    <username>username</username>
                    <password>password</password>
                  </db>
                </datasource>
              </application>
              
Returns:
the credentials or null if there are no credentials with the given name

createDBCredentials

public static DBCredentials createDBCredentials(IConfiguration pConfig,
                                                String pName)
Creates a new instance of DBCredentials with information provided in a given configuration.

Parameters:
pConfig - the configuration
pName - the name of the datasource in the configuration. The name must exist in the following format:
              <application>
                <datasource>
                  <db name="dbname">
                    <driver>JDBC driver class</driver> (optional tag)
                    <url>connection url</url>
                    <username>username</username>
                    <password>password</password>
                  </db>
                </datasource>
              </application>
              
Returns:
the credentials or null if there are no credentials with the given name

createDBCredentials

public static DBCredentials createDBCredentials(XmlNode pNode)
Creates a new instance of DBCredentials with information provided in xml format.

Parameters:
pNode - the information as xml node. The node should contain at least
              <driver>JDBC driver class</driver> (optional tag)
              <url>connection url</url>
              <username>username</username>
              <password>password</password>
              
Returns:
the credentials or null if there are no credentials with the given name


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.