com.metamatrix.common.extensionmodule.spi
Interface ExtensionModuleTransaction

All Superinterfaces:
TransactionInterface
All Known Implementing Classes:
JDBCExtensionModuleTransaction

public interface ExtensionModuleTransaction
extends TransactionInterface


Method Summary
 ExtensionModuleDescriptor addSource(java.lang.String principalName, java.lang.String type, java.lang.String sourceName, byte[] source, 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, or empty List if there are none
 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 (empty List if there are none)
 boolean isNameInUse(java.lang.String sourceName)
          Indicates if an extension module name is already in used.
 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[] source, 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 module name
 
Methods inherited from interface com.metamatrix.common.connection.TransactionInterface
close, commit, isClosed, isReadonly, rollback
 

Method Detail

addSource

ExtensionModuleDescriptor addSource(java.lang.String principalName,
                                    java.lang.String type,
                                    java.lang.String sourceName,
                                    byte[] source,
                                    long checksum,
                                    java.lang.String description,
                                    boolean enabled)
                                    throws DuplicateExtensionModuleException,
                                           MetaMatrixComponentException
Adds an extension module to the end of the list of modules. The type will be checked to be a known and supported type.

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
source - 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

void removeSource(java.lang.String principalName,
                  java.lang.String sourceName)
                  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)

getSourceNames

java.util.List getSourceNames()
                              throws MetaMatrixComponentException
Returns List (of Strings) of all extension module names, in order of their search ordering (empty List if there are none)

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

getSourceDescriptors

java.util.List getSourceDescriptors()
                                    throws MetaMatrixComponentException
Returns List of ExtensionModuleDescriptor objects, in order of their search ordering, or empty List if there are none

Returns:
List of ExtensionModuleDescriptor objects, in order of their search ordering, or empty List if there are none
Throws:
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

getSourceDescriptors

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. The type will be checked to be a known and supported type. (return empty List if there are none)

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, or empty List if there are none
Throws:
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

getSourceDescriptor

ExtensionModuleDescriptor getSourceDescriptor(java.lang.String sourceName)
                                              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)

setSearchOrder

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.

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

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.

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

byte[] getSource(java.lang.String sourceName)
                 throws ExtensionModuleNotFoundException,
                        MetaMatrixComponentException
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)

setSource

ExtensionModuleDescriptor setSource(java.lang.String principalName,
                                    java.lang.String sourceName,
                                    byte[] source,
                                    long checksum)
                                    throws ExtensionModuleNotFoundException,
                                           MetaMatrixComponentException
Updates the indicated extension module

Parameters:
principalName - name of principal requesting this addition
sourceName - name (e.g. filename) of extension module
source - 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

ExtensionModuleDescriptor setSourceName(java.lang.String principalName,
                                        java.lang.String sourceName,
                                        java.lang.String newName)
                                        throws ExtensionModuleNotFoundException,
                                               MetaMatrixComponentException
Updates the indicated extension module's module 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

ExtensionModuleDescriptor setSourceDescription(java.lang.String principalName,
                                               java.lang.String sourceName,
                                               java.lang.String description)
                                               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)

isNameInUse

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

Parameters:
sourceName - is the name of the extension module to check
Throws:
MetaMatrixComponentException


Copyright © 2009. All Rights Reserved.