com.autotrader.rhythmyx
Class DatasourceTools

java.lang.Object
  extended by com.percussion.extension.PSJexlUtilBase
      extended by com.autotrader.rhythmyx.DatasourceTools
All Implemented Interfaces:
com.percussion.extension.IPSExtension, com.percussion.extension.IPSJexlExpression

public class DatasourceTools
extends com.percussion.extension.PSJexlUtilBase

A JEXL tool that will allow you to load database publishing credentials from the JNDI configuration files for the Rhythmyx server. It will allow statements and bindings similar to:

#set($config = $user.datasourceTools.getDatasourceConfig('MyConnectionName'))

Name: $config.name
DataSource: $config.dataSource
Origin: $!{config.origin}
Database: $!{config.database}

#set($datasource = $user.datasourceTools.getJndiDatasource($config.dataSource))

Name: $datasource.name
Driver: $!{datasource.driverName}
Server: $!{datasource.server}
User: $!{datasource.userId}
Password: $!{datasource.password}
Security Domain: $!{datasource.securityDomain}
Idle Timeout: $!{datasource.idleTimeout}
Max Connections: $!{datasource.maxConnections}
Min Connections: $!{datasource.minConnections}


Field Summary
 
Fields inherited from interface com.percussion.extension.IPSExtension
BINARY_ASSEMBLER, DATABASE_ASSEMBLER, DEBUG_ASSEMBLER, DISPATCH_ASSEMBLER, ERROR_INVALID_PARAMETER, KNOWN_ASSEMBLERS, LEGACY_ASSEMBLER, NOT_INITIALIZED, VELOCITY_ASSEMBLER
 
Constructor Summary
DatasourceTools()
           
 
Method Summary
 com.percussion.utils.jdbc.IPSDatasourceConfig getDatasourceConfig(java.lang.String connectionName)
          finds the configuration entry for a database connection that would appear on the Datasources:Connections tab of the Server Administrator tool.
 com.percussion.utils.jboss.PSJndiDatasource getJndiDatasource(java.lang.String datasourceName)
          finds the JNDI configuration entry for a database connection that would appear on the Datasources:JNDI tab of the Server Administrator tool.
 com.percussion.utils.jboss.PSJndiDatasource getJndiDatasourceByServer(java.lang.String server)
          finds the JNDI configuration entry for a database connection that would appear on the Datasources:JNDI tab of the Server Administrator tool.
 
Methods inherited from class com.percussion.extension.PSJexlUtilBase
init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatasourceTools

public DatasourceTools()
Method Detail

getDatasourceConfig

public com.percussion.utils.jdbc.IPSDatasourceConfig getDatasourceConfig(java.lang.String connectionName)
finds the configuration entry for a database connection that would appear on the Datasources:Connections tab of the Server Administrator tool.

Parameters:
connectionName - The name of the connection whose configuration you wish to look up.
Returns:
a Datasource Configuration or null.

getJndiDatasource

public com.percussion.utils.jboss.PSJndiDatasource getJndiDatasource(java.lang.String datasourceName)
finds the JNDI configuration entry for a database connection that would appear on the Datasources:JNDI tab of the Server Administrator tool.

Parameters:
datasourceName - The name of the datasource whose configuration you wish to look up.
Returns:
a JNDI Datasource or null.

getJndiDatasourceByServer

public com.percussion.utils.jboss.PSJndiDatasource getJndiDatasourceByServer(java.lang.String server)
finds the JNDI configuration entry for a database connection that would appear on the Datasources:JNDI tab of the Server Administrator tool.

Parameters:
server - The server of the datasource whose configuration you wish to look up.
Returns:
a JNDI Datasource or null.