com.metamatrix.platform.admin.apiimpl
Class ExtensionSourceAdminAPIImpl

java.lang.Object
  extended by com.metamatrix.platform.admin.apiimpl.ExtensionSourceAdminAPIImpl
All Implemented Interfaces:
ExtensionSourceAdminAPI, SubSystemAdminAPI

@RolesAllowed(value="Admin.ReadOnlyAdmin")
public class ExtensionSourceAdminAPIImpl
extends java.lang.Object
implements ExtensionSourceAdminAPI


Field Summary
 
Fields inherited from interface com.metamatrix.platform.admin.api.ExtensionSourceAdminAPI
SOURCE_DESCRIPTION_LENGTH_LIMIT, SOURCE_NAME_LENGTH_LIMIT
 
Method Summary
 ExtensionModuleDescriptor addSource(java.lang.String type, java.lang.String sourceName, byte[] source, java.lang.String description, boolean enabled)
          Adds an extension source to the end of the list of sources
static ExtensionSourceAdminAPI getInstance()
           
 ExtensionModuleDescriptor getSourceDescriptor(java.lang.String sourceName)
          Returns the ExtensionSourceDescriptor object for the extension source indicated by sourceName
 java.util.List getSourceDescriptors()
          Returns List of ExtensionSourceDescriptor objects, in order of their search ordering
 java.util.List getSourceNames()
          Returns List (of Strings) of all extension source names, in order of their search ordering
 java.util.Collection getSourceTypes()
          Returns List (of Strings) of all extension source types currently supported.
 boolean isSourceExists(java.lang.String sourceName)
          Checks if the extension module exists.
 void removeSource(java.lang.String sourceName)
          Deletes a source from the list of sources
 java.util.List setEnabled(java.util.Collection sourceNames, boolean enabled)
          Sets the "enabled" (for searching) property of all of the indicated extension sources.
 java.util.List setSearchOrder(java.util.List sourceNames)
          Sets the positions in the search order of all sources (all sources must be included or an ExtensionSourceOrderingException will be thrown) The sourceNames List parameter should indicate the new desired order.
 ExtensionModuleDescriptor setSource(java.lang.String sourceName, byte[] source)
          Updates the indicated extension source
 ExtensionModuleDescriptor setSourceDescription(java.lang.String sourceName, java.lang.String description)
          Updates the indicated extension source's description
 ExtensionModuleDescriptor setSourceName(java.lang.String sourceName, java.lang.String newName)
          Updates the indicated extension source's source name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ExtensionSourceAdminAPI getInstance()

addSource

@RolesAllowed(value="Admin.SystemAdmin")
public ExtensionModuleDescriptor addSource(java.lang.String type,
                                                             java.lang.String sourceName,
                                                             byte[] source,
                                                             java.lang.String description,
                                                             boolean enabled)
                                    throws InvalidSessionException,
                                           AuthorizationException,
                                           DuplicateExtensionModuleException,
                                           InvalidExtensionModuleTypeException,
                                           MetaMatrixComponentException
Adds an extension source to the end of the list of sources

Specified by:
addSource in interface ExtensionSourceAdminAPI
Parameters:
type - one of the known types of extension file
sourceName - name (e.g. filename) of extension source
source - actual contents of source
description - (optional) description of the extension source
enabled - indicates whether each extension source is enabled for being searched or not (for convenience, a source can be disabled without being removed)
Returns:
ExtensionSourceDescriptor describing the newly-added extension source
Throws:
InvalidSessionException - if there is not a valid administrative session
AuthorizationException - if the administrator does not have privileges to use this method
DuplicateExtensionSourceException - if an extension source with the same sourceName already exists
InvalidExtensionTypeException - if the indicated type is not one of the currently-supported extension source types
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)
DuplicateExtensionModuleException
InvalidExtensionModuleTypeException

removeSource

@RolesAllowed(value="Admin.SystemAdmin")
public void removeSource(java.lang.String sourceName)
                  throws InvalidSessionException,
                         AuthorizationException,
                         ExtensionModuleNotFoundException,
                         MetaMatrixComponentException
Deletes a source from the list of sources

Specified by:
removeSource in interface ExtensionSourceAdminAPI
Parameters:
sourceName - name (e.g. filename) of extension source
Throws:
InvalidSessionException - if there is not a valid administrative session
AuthorizationException - if the administrator does not have privileges to use this method
ExtensionSourceNotFoundException - if no extension source with name sourceName can be found
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)
ExtensionModuleNotFoundException

getSourceTypes

public java.util.Collection getSourceTypes()
                                    throws InvalidSessionException,
                                           AuthorizationException,
                                           MetaMatrixComponentException
Returns List (of Strings) of all extension source types currently supported.

Specified by:
getSourceTypes in interface ExtensionSourceAdminAPI
Returns:
List of the String names of the currently-supported extension source types
Throws:
InvalidSessionException - if there is not a valid administrative session
AuthorizationException - if the administrator does not have privileges to use this method
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

getSourceNames

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

Specified by:
getSourceNames in interface ExtensionSourceAdminAPI
Returns:
List (of Strings) of all extension source names, in order of their search ordering
Throws:
InvalidSessionException - if there is not a valid administrative session
AuthorizationException - if the administrator does not have privileges to use this method
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

getSourceDescriptors

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

Specified by:
getSourceDescriptors in interface ExtensionSourceAdminAPI
Returns:
List of ExtensionSourceDescriptor objects, in order of their search ordering
Throws:
InvalidSessionException - if there is not a valid administrative session
AuthorizationException - if the administrator does not have privileges to use this method
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)

getSourceDescriptor

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

Specified by:
getSourceDescriptor in interface ExtensionSourceAdminAPI
Parameters:
sourceName - name (e.g. filename) of extension source
Returns:
the ExtensionSourceDescriptor object for the extension source indicated by sourceName
Throws:
InvalidSessionException - if there is not a valid administrative session
AuthorizationException - if the administrator does not have privileges to use this method
ExtensionSourceNotFoundException - if no extension source with name sourceName can be found
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)
ExtensionModuleNotFoundException

setSearchOrder

@RolesAllowed(value="Admin.SystemAdmin")
public java.util.List setSearchOrder(java.util.List sourceNames)
                              throws InvalidSessionException,
                                     AuthorizationException,
                                     ExtensionModuleOrderingException,
                                     MetaMatrixComponentException
Sets the positions in the search order of all sources (all sources must be included or an ExtensionSourceOrderingException will be thrown) The sourceNames List parameter should indicate the new desired order.

Specified by:
setSearchOrder in interface ExtensionSourceAdminAPI
Parameters:
sourceNames - Collection of String names of existing extension sources whose search position is to be set
Returns:
updated List of ExtensionSourceDescriptor objects, in order of their search ordering
Throws:
InvalidSessionException - if there is not a valid administrative session
AuthorizationException - if the administrator does not have privileges to use this method
ExtensionSourceOrderingException - 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)
ExtensionModuleOrderingException

setEnabled

@RolesAllowed(value="Admin.SystemAdmin")
public java.util.List setEnabled(java.util.Collection sourceNames,
                                                   boolean enabled)
                          throws InvalidSessionException,
                                 AuthorizationException,
                                 ExtensionModuleNotFoundException,
                                 MetaMatrixComponentException
Sets the "enabled" (for searching) property of all of the indicated extension sources.

Specified by:
setEnabled in interface ExtensionSourceAdminAPI
Parameters:
sourceNames - Collection of String names of existing extension sources whose "enabled" status is to be set
enabled - indicates whether each extension source is enabled for being searched or not (for convenience, a source can be disabled without being removed)
Returns:
updated List of ExtensionSourceDescriptor objects, in order of their search ordering
Throws:
InvalidSessionException - if there is not a valid administrative session
AuthorizationException - if the administrator does not have privileges to use this method
ExtensionSourceNotFoundException - if no extension source with name sourceName can be found
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)
ExtensionModuleNotFoundException

setSource

@RolesAllowed(value="Admin.SystemAdmin")
public ExtensionModuleDescriptor setSource(java.lang.String sourceName,
                                                             byte[] source)
                                    throws InvalidSessionException,
                                           AuthorizationException,
                                           ExtensionModuleNotFoundException,
                                           MetaMatrixComponentException
Updates the indicated extension source

Specified by:
setSource in interface ExtensionSourceAdminAPI
Parameters:
sourceName - name (e.g. filename) of extension source
source - actual contents of source
Returns:
ExtensionSourceDescriptor describing the newly-updated extension source
Throws:
InvalidSessionException - if there is not a valid administrative session
AuthorizationException - if the administrator does not have privileges to use this method
ExtensionSourceNotFoundException - if no extension source with name sourceName can be found
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)
ExtensionModuleNotFoundException

setSourceName

@RolesAllowed(value="Admin.SystemAdmin")
public ExtensionModuleDescriptor setSourceName(java.lang.String sourceName,
                                                                 java.lang.String newName)
                                        throws InvalidSessionException,
                                               AuthorizationException,
                                               ExtensionModuleNotFoundException,
                                               MetaMatrixComponentException
Updates the indicated extension source's source name

Specified by:
setSourceName in interface ExtensionSourceAdminAPI
Parameters:
sourceName - name (e.g. filename) of extension source
newName - new name for the source
Returns:
ExtensionSourceDescriptor describing the newly-updated extension source
Throws:
ExtensionSourceNotFoundException - if no extension source with name sourceName can be found
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)
InvalidSessionException
AuthorizationException
ExtensionModuleNotFoundException

setSourceDescription

@RolesAllowed(value="Admin.SystemAdmin")
public ExtensionModuleDescriptor setSourceDescription(java.lang.String sourceName,
                                                                        java.lang.String description)
                                               throws InvalidSessionException,
                                                      AuthorizationException,
                                                      ExtensionModuleNotFoundException,
                                                      MetaMatrixComponentException
Updates the indicated extension source's description

Specified by:
setSourceDescription in interface ExtensionSourceAdminAPI
Parameters:
sourceName - name (e.g. filename) of extension source
description - (optional) description of the extension source. null can be passed in to indicate no description.
Returns:
ExtensionSourceDescriptor describing the newly-updated extension source
Throws:
ExtensionSourceNotFoundException - if no extension source with name sourceName can be found
MetaMatrixComponentException - indicating a non-business-related exception (such as a communication exception)
InvalidSessionException
AuthorizationException
ExtensionModuleNotFoundException

isSourceExists

public boolean isSourceExists(java.lang.String sourceName)
                       throws InvalidSessionException,
                              AuthorizationException,
                              MetaMatrixComponentException
Description copied from interface: ExtensionSourceAdminAPI
Checks if the extension module exists.

Specified by:
isSourceExists in interface ExtensionSourceAdminAPI
Parameters:
sourceName - name (e.g. filename) of extension source
Returns:
Returns true if the Extension module exists. false otherwise.
Throws:
InvalidSessionException
AuthorizationException
MetaMatrixComponentException
See Also:
com.metamatrix.platform.admin.api.ExtensionSourceAdminAPI#isSourceExists()


Copyright © 2009. All Rights Reserved.