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

java.lang.Object
  extended by com.metamatrix.common.connection.BaseTransaction
      extended by com.metamatrix.common.extensionmodule.spi.jdbc.JDBCExtensionModuleTransaction
All Implemented Interfaces:
TransactionInterface, ExtensionModuleTransaction

public class JDBCExtensionModuleTransaction
extends BaseTransaction
implements ExtensionModuleTransaction


Method Summary
 ExtensionModuleDescriptor addSource(java.lang.String principalName, java.lang.String type, java.lang.String sourceName, byte[] data, long checksum, java.lang.String description, boolean enabled)
          Adds an extension module to the end of the list of modules
 byte[] getSource(java.lang.String sourceName)
          Retrieves an extension module in byte[] form
 ExtensionModuleDescriptor getSourceDescriptor(java.lang.String sourceName)
          Returns the ExtensionModuleDescriptor object for the extension module indicated by sourceName
 java.util.List getSourceDescriptors()
          Returns List of ExtensionModuleDescriptor objects, in order of their search ordering
 java.util.List getSourceDescriptors(java.lang.String type, boolean includeDisabled)
          Returns List of ExtensionModuleDescriptor objects of indicated type, in order of their search ordering
 java.util.List getSourceNames()
          Returns List (of Strings) of all extension module names, in order of their search ordering
 boolean isNameInUse(java.lang.String sourceName)
          Indicates if an extension module name is already in used.
 boolean needsRefresh()
          Indicates that ExtensionModuleManager should clear its cache and refresh itself because the data this object fronts has changed (optional operation).
 void removeSource(java.lang.String principalName, java.lang.String sourceName)
          Deletes a module from the list of modules
 void setEnabled(java.lang.String principalName, java.util.Collection sourceNames, boolean enabled)
          Sets the "enabled" (for searching) property of all of the indicated extension modules.
 void setSearchOrder(java.lang.String principalName, java.util.List sourceNames)
          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.
 ExtensionModuleDescriptor setSource(java.lang.String principalName, java.lang.String sourceName, byte[] data, long checksum)
          Updates the indicated extension module
 ExtensionModuleDescriptor setSourceDescription(java.lang.String principalName, java.lang.String sourceName, java.lang.String description)
          Updates the indicated extension module's description
 ExtensionModuleDescriptor setSourceName(java.lang.String principalName, java.lang.String sourceName, java.lang.String newName)
          Updates the indicated extension module's source name
 
Methods inherited from class com.metamatrix.common.connection.BaseTransaction
close, commit, finalize, getConnection, getRollbackOnFinalize, isClosed, isEnded, isReadonly, rollback, setRollbackOnFinalize
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.metamatrix.common.connection.TransactionInterface
close, commit, isClosed, isReadonly, rollback
 

Method Detail

addSource

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

Specified by:
addSource in interface ExtensionModuleTransaction
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)

removeSource

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

Specified by:
removeSource in interface ExtensionModuleTransaction
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)

getSourceNames

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

Specified by:
getSourceNames in interface ExtensionModuleTransaction
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)

getSourceDescriptors

public java.util.List getSourceDescriptors()
                                    throws MetaMatrixComponentException
Returns List of ExtensionModuleDescriptor objects, in order of their search ordering

Specified by:
getSourceDescriptors in interface ExtensionModuleTransaction
Returns:
List of ExtensionModuleDescriptor objects, in order of their search ordering
Throws:
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

getSourceDescriptors

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

Specified by:
getSourceDescriptors in interface ExtensionModuleTransaction
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)

getSourceDescriptor

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

Specified by:
getSourceDescriptor in interface ExtensionModuleTransaction
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)

setSearchOrder

public void setSearchOrder(java.lang.String principalName,
                           java.util.List sourceNames)
                    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.

Specified by:
setSearchOrder in interface ExtensionModuleTransaction
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 void setEnabled(java.lang.String principalName,
                       java.util.Collection sourceNames,
                       boolean enabled)
                throws ExtensionModuleNotFoundException,
                       MetaMatrixComponentException
Sets the "enabled" (for searching) property of all of the indicated extension modules.

Specified by:
setEnabled in interface ExtensionModuleTransaction
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)

getSource

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

Specified by:
getSource in interface ExtensionModuleTransaction
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)

setSource

public ExtensionModuleDescriptor setSource(java.lang.String principalName,
                                           java.lang.String sourceName,
                                           byte[] data,
                                           long checksum)
                                    throws ExtensionModuleNotFoundException,
                                           MetaMatrixComponentException
Description copied from interface: ExtensionModuleTransaction
Updates the indicated extension module

Specified by:
setSource in interface ExtensionModuleTransaction
Parameters:
principalName - name of principal requesting this addition
sourceName - name (e.g. filename) of extension module
data - actual contents of module
checksum - Checksum of file contents
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)

setSourceName

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

Specified by:
setSourceName in interface ExtensionModuleTransaction
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 ExtensionModuleDescriptor setSourceDescription(java.lang.String principalName,
                                                      java.lang.String sourceName,
                                                      java.lang.String description)
                                               throws ExtensionModuleNotFoundException,
                                                      MetaMatrixComponentException
Updates the indicated extension module's description

Specified by:
setSourceDescription in interface ExtensionModuleTransaction
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)

needsRefresh

public boolean needsRefresh()
                     throws MetaMatrixComponentException,
                            java.lang.UnsupportedOperationException
Indicates that ExtensionModuleManager should clear its cache and refresh itself because the data this object fronts has changed (optional operation). A service provider is not required to keep track of whether data has changed by outside means, in fact it may not even make sense.

Specified by:
needsRefresh in interface ExtensionModuleTransaction
Returns:
whether data has changed since ExtensionModuleManager last accessed this data store.
Throws:
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)
java.lang.UnsupportedOperationException - - this operation is not supported by this Transaction.

isNameInUse

public boolean isNameInUse(java.lang.String sourceName)
                    throws MetaMatrixComponentException
Description copied from interface: ExtensionModuleTransaction
Indicates if an extension module name is already in used. The method will return true if the source name is already used,

Specified by:
isNameInUse in interface ExtensionModuleTransaction
Parameters:
sourceName - is the name of the extension module to check
Throws:
MetaMatrixComponentException


Copyright © 2009. All Rights Reserved.