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

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

public class JDBCExtensionModuleWriter
extends java.lang.Object


Constructor Summary
JDBCExtensionModuleWriter()
           
 
Method Summary
static ExtensionModuleDescriptor addSource(java.lang.String principalName, java.lang.String type, java.lang.String sourceName, byte[] data, long checksum, java.lang.String description, boolean enabled, java.sql.Connection jdbcConnection)
          Adds an extension module to the end of the list of modules
static ExtensionModuleDescriptor addSource(java.lang.String createdBy, java.lang.String createdDate, java.lang.String updatedBy, java.lang.String updatedDate, java.lang.String type, java.lang.String sourceName, byte[] data, long checksum, java.lang.String description, boolean enabled, java.sql.Connection jdbcConnection)
          Adds an extension module to the end of the list of modules
static void removeSource(java.lang.String principalName, java.lang.String sourceName, java.sql.Connection jdbcConnection)
          Deletes a module from the list of modules
static void setEnabled(java.lang.String principalName, java.util.Collection sourceNames, boolean enabled, java.sql.Connection jdbcConnection)
          Sets the "enabled" (for searching) property of all of the indicated extension modules.
static void setSearchOrder(java.lang.String principalName, java.util.List sourceNames, java.sql.Connection jdbcConnection)
          Sets the positions in the search order of all modules (all modules must be included or an ExtensionModuleOrderingException will be thrown) The sourceNames List parameter should indicate the new desired order.
static void setSource(java.lang.String principalName, java.lang.String sourceName, byte[] data, long checksum, java.sql.Connection jdbcConnection)
           
static ExtensionModuleDescriptor setSourceDescription(java.lang.String principalName, java.lang.String sourceName, java.lang.String description, java.sql.Connection jdbcConnection)
          Updates the indicated extension module's description
static ExtensionModuleDescriptor setSourceName(java.lang.String principalName, java.lang.String sourceName, java.lang.String newName, java.sql.Connection jdbcConnection)
          Updates the indicated extension module's source name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCExtensionModuleWriter

public JDBCExtensionModuleWriter()
Method Detail

addSource

public static ExtensionModuleDescriptor addSource(java.lang.String principalName,
                                                  java.lang.String type,
                                                  java.lang.String sourceName,
                                                  byte[] data,
                                                  long checksum,
                                                  java.lang.String description,
                                                  boolean enabled,
                                                  java.sql.Connection jdbcConnection)
                                           throws DuplicateExtensionModuleException,
                                                  MetaMatrixComponentException
Adds an extension module to the end of the list of modules

Parameters:
principalName - name of principal requesting this addition
type - one of the known types of extension file
sourceName - name (e.g. filename) of extension module
data - actual contents of module
checksum - Checksum of file contents
description - (optional) description of the extension module
enabled - indicates whether each extension module is enabled for being searched or not (for convenience, a module can be disabled without being removed)
Returns:
ExtensionModuleDescriptor describing the newly-added extension module
Throws:
DuplicateExtensionModuleException - if an extension module with the same sourceName already exists
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

addSource

public static ExtensionModuleDescriptor addSource(java.lang.String createdBy,
                                                  java.lang.String createdDate,
                                                  java.lang.String updatedBy,
                                                  java.lang.String updatedDate,
                                                  java.lang.String type,
                                                  java.lang.String sourceName,
                                                  byte[] data,
                                                  long checksum,
                                                  java.lang.String description,
                                                  boolean enabled,
                                                  java.sql.Connection jdbcConnection)
                                           throws DuplicateExtensionModuleException,
                                                  MetaMatrixComponentException
Adds an extension module to the end of the list of modules

Parameters:
createdBy - name of principal requesting this addition
createdDate - is the date created
updatedBy - name is the principal that is doing the updating
updatedDate - is the date the source is updated
type - one of the known types of extension file
sourceName - name (e.g. filename) of extension module
data - actual contents of module
checksum - Checksum of file contents
description - (optional) description of the extension module
enabled - indicates whether each extension module is enabled for being searched or not (for convenience, a module can be disabled without being removed)
Returns:
ExtensionModuleDescriptor describing the newly-added extension module
Throws:
DuplicateExtensionModuleException - if an extension module with the same sourceName already exists
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

setSource

public static void setSource(java.lang.String principalName,
                             java.lang.String sourceName,
                             byte[] data,
                             long checksum,
                             java.sql.Connection jdbcConnection)
                      throws ExtensionModuleNotFoundException,
                             MetaMatrixComponentException
Throws:
ExtensionModuleNotFoundException
MetaMatrixComponentException

setSourceName

public static ExtensionModuleDescriptor setSourceName(java.lang.String principalName,
                                                      java.lang.String sourceName,
                                                      java.lang.String newName,
                                                      java.sql.Connection jdbcConnection)
                                               throws ExtensionModuleNotFoundException,
                                                      MetaMatrixComponentException
Updates the indicated extension module's source name

Parameters:
principalName - name of principal requesting this addition
sourceName - name (e.g. filename) of extension module
newName - new name for the module
Returns:
ExtensionModuleDescriptor describing the newly-updated extension module
Throws:
ExtensionModuleNotFoundException - if no extension module with name sourceName can be found
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

setSourceDescription

public static ExtensionModuleDescriptor setSourceDescription(java.lang.String principalName,
                                                             java.lang.String sourceName,
                                                             java.lang.String description,
                                                             java.sql.Connection jdbcConnection)
                                                      throws ExtensionModuleNotFoundException,
                                                             MetaMatrixComponentException
Updates the indicated extension module's description

Parameters:
principalName - name of principal requesting this addition
sourceName - name (e.g. filename) of extension module
description - (optional) description of the extension module. null can be passed in to indicate no description.
Returns:
ExtensionModuleDescriptor describing the newly-updated extension module
Throws:
ExtensionModuleNotFoundException - if no extension module with name sourceName can be found
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

setSearchOrder

public static void setSearchOrder(java.lang.String principalName,
                                  java.util.List sourceNames,
                                  java.sql.Connection jdbcConnection)
                           throws ExtensionModuleOrderingException,
                                  MetaMatrixComponentException
Sets the positions in the search order of all modules (all modules must be included or an ExtensionModuleOrderingException will be thrown) The sourceNames List parameter should indicate the new desired order.

Parameters:
principalName - name of principal requesting this addition
sourceNames - Collection of String names of existing extension modules whose search position is to be set
Throws:
ExtensionModuleOrderingException - if the extension files could not be ordered as requested because another administrator had concurrently added or removed an extension file or files, or because an indicated position is out of bounds.
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

setEnabled

public static void setEnabled(java.lang.String principalName,
                              java.util.Collection sourceNames,
                              boolean enabled,
                              java.sql.Connection jdbcConnection)
                       throws ExtensionModuleNotFoundException,
                              MetaMatrixComponentException
Sets the "enabled" (for searching) property of all of the indicated extension modules.

Parameters:
principalName - name of principal requesting this addition
sourceNames - Collection of String names of existing extension modules whose "enabled" status is to be set
enabled - indicates whether each extension module is enabled for being searched or not (for convenience, a module can be disabled without being removed)
Throws:
ExtensionModuleNotFoundException - if no extension module with name sourceName can be found
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

removeSource

public static void removeSource(java.lang.String principalName,
                                java.lang.String sourceName,
                                java.sql.Connection jdbcConnection)
                         throws ExtensionModuleNotFoundException,
                                MetaMatrixComponentException
Deletes a module from the list of modules

Parameters:
principalName - name of principal requesting this addition
sourceName - name (e.g. filename) of extension module
Throws:
ExtensionModuleNotFoundException - if no extension module with name sourceName can be found
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)


Copyright © 2009. All Rights Reserved.