com.metamatrix.common.extensionmodule.spi.jdbc
Class JDBCExtensionModuleReader

java.lang.Object
  extended by com.metamatrix.common.extensionmodule.spi.jdbc.JDBCExtensionModuleReader

public class JDBCExtensionModuleReader
extends java.lang.Object

Utility class that loads extension modules and other files from table ExtensionFilesTable.TABLE_NAME.


Constructor Summary
JDBCExtensionModuleReader()
           
 
Method Summary
static ExtensionModuleDescriptor buildExtensionDescriptor(java.sql.ResultSet resultSet)
           
static int executeIntFunctionSQL(java.lang.String sql, java.sql.Connection jdbcConnection)
           
static int getExtensionModuleCount(java.sql.Connection jdbcConnection)
           
static byte[] getSource(java.lang.String sourceName, java.sql.Connection jdbcConnection)
          Retrieves an extension module in byte[] form
static ExtensionModuleDescriptor getSourceDescriptor(java.lang.String sourceName, java.sql.Connection jdbcConnection)
          Returns the ExtensionModuleDescriptor object for the extension module indicated by sourceName
static java.util.List getSourceDescriptors(java.lang.String type, boolean includeDisabled, java.sql.Connection jdbcConnection)
          Returns List of ExtensionModuleDescriptor objects of indicated type, in order of their search ordering
static java.util.List getSourceNames(java.sql.Connection jdbcConnection)
          Returns List (of Strings) of all extension module names, in order of their search ordering
static boolean isNameInUse(java.lang.String sourceName, java.sql.Connection jdbcConnection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCExtensionModuleReader

public JDBCExtensionModuleReader()
Method Detail

getSourceNames

public static java.util.List getSourceNames(java.sql.Connection jdbcConnection)
                                     throws MetaMatrixComponentException
Returns List (of Strings) of all extension module names, in order of their search ordering

Returns:
List (of Strings) of all extension module names, in order of their search ordering
Throws:
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

getSource

public static byte[] getSource(java.lang.String sourceName,
                               java.sql.Connection jdbcConnection)
                        throws ExtensionModuleNotFoundException,
                               MetaMatrixComponentException,
                               java.sql.SQLException
Retrieves an extension module in byte[] form

Parameters:
sourceName - name (e.g. filename) of extension module
Returns:
actual contents of module in byte[] array form
Throws:
ExtensionModuleNotFoundException - if no extension module with name sourceName can be found
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)
java.sql.SQLException

getSourceDescriptor

public static ExtensionModuleDescriptor getSourceDescriptor(java.lang.String sourceName,
                                                            java.sql.Connection jdbcConnection)
                                                     throws ExtensionModuleNotFoundException,
                                                            MetaMatrixComponentException
Returns the ExtensionModuleDescriptor object for the extension module indicated by sourceName

Parameters:
sourceName - name (e.g. filename) of extension module
Returns:
the ExtensionModuleDescriptor object for the extension module indicated by sourceName
Throws:
ExtensionModuleNotFoundException - if no extension module with name sourceName can be found
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

getSourceDescriptors

public static java.util.List getSourceDescriptors(java.lang.String type,
                                                  boolean includeDisabled,
                                                  java.sql.Connection jdbcConnection)
                                           throws MetaMatrixComponentException
Returns List of ExtensionModuleDescriptor objects of indicated type, in order of their search ordering

Parameters:
type - one of the known types of extension file
includeDisabled - if "false", only descriptors for enabled extension modules will be returned; otherwise all modules will be.
Returns:
List of ExtensionModuleDescriptor objects of indicated type, in order of their search ordering
Throws:
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

getExtensionModuleCount

public static int getExtensionModuleCount(java.sql.Connection jdbcConnection)
                                   throws MetaMatrixComponentException
Throws:
MetaMatrixComponentException

executeIntFunctionSQL

public static int executeIntFunctionSQL(java.lang.String sql,
                                        java.sql.Connection jdbcConnection)
                                 throws MetaMatrixComponentException
Throws:
MetaMatrixComponentException

isNameInUse

public static boolean isNameInUse(java.lang.String sourceName,
                                  java.sql.Connection jdbcConnection)
                           throws MetaMatrixComponentException
Throws:
MetaMatrixComponentException

buildExtensionDescriptor

public static ExtensionModuleDescriptor buildExtensionDescriptor(java.sql.ResultSet resultSet)
                                                          throws MetaMatrixComponentException
Throws:
MetaMatrixComponentException


Copyright © 2009. All Rights Reserved.