org.pentaho.di.trans
Class StepLoader

java.lang.Object
  extended by org.pentaho.di.trans.StepLoader
All Implemented Interfaces:
org.pentaho.di.i18n.LoaderInputStreamProvider

public class StepLoader
extends Object
implements org.pentaho.di.i18n.LoaderInputStreamProvider

Since:
6-okt-2004
Author:
Matt

Method Summary
 StepPlugin findStepPluginWithDescription(String description)
           
 StepPlugin findStepPluginWithDescription(String description, String locale)
           
 StepPlugin findStepPluginWithID(String stepid)
           
 String[] getCategories(int type)
          Get a unique list of categories.
 String[] getCategories(int type, String locale)
          Get a unique list of categories.
 InputStream getInputStreamForFile(String filename)
          Search through all jarfiles in all steps and try to find a certain file in it.
static StepLoader getInstance()
           
static StepLoader getInstance(String[] pluginDirectory)
           
static Partitioner getPartitioner(String id)
           
static Map<String,Partitioner> getPartitionerList()
           
 List<Object[]> getPluginInformation()
           
 List<StepPlugin> getPluginList()
           
 String[] getPluginPackages()
           
 StepMetaInterface getStepClass(StepPlugin sp)
           
 StepMetaInterface getStepClass(String desc)
           
 StepPlugin getStepPlugin(StepMetaInterface sii)
          Determine the step's plugin based upon the StepMetaInterface we get...
 String getStepPluginID(StepMetaInterface sii)
          Determine the step's id based upon the StepMetaInterface we get...
 StepPlugin[] getStepsWithCategory(String category)
           
 StepPlugin[] getStepsWithType(int type)
           
 StepPlugin getStepWithCategory(String category, int position)
           
 StepPlugin getStepWithType(int type, int position)
           
static void init()
          Read & initialize all the steps and plugins
static void init(String[] pluginDirectory)
          Read & initialize all the steps and plugins
 int nrStepsWithCategory(String category)
           
 int nrStepsWithType(int type)
          Count's the number of steps with a certain type.
 boolean read()
          Deprecated. in favor of static method init() to flag the exception throwing in this method. (change of contract)
 void readNatives()
           
 void readPlugins()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final StepLoader getInstance(String[] pluginDirectory)

getInstance

public static final StepLoader getInstance()

read

public boolean read()
             throws org.pentaho.di.core.exception.KettleException
Deprecated. in favor of static method init() to flag the exception throwing in this method. (change of contract)

Read & initialize all the steps and plugins

Returns:
true in case all goes well.
Throws:
org.pentaho.di.core.exception.KettleException - In case a plug-in could not be loaded or something else went wrong in the process.

init

public static final void init(String[] pluginDirectory)
                       throws org.pentaho.di.core.exception.KettleException
Read & initialize all the steps and plugins

Parameters:
pluginDirectory - the directories to read plugins from
Throws:
org.pentaho.di.core.exception.KettleException - In case a plug-in could not be loaded or something else went wrong in the process.

init

public static final void init()
                       throws org.pentaho.di.core.exception.KettleException
Read & initialize all the steps and plugins

Throws:
org.pentaho.di.core.exception.KettleException - In case a plug-in could not be loaded or something else went wrong in the process.

readNatives

public void readNatives()

readPlugins

public void readPlugins()
                 throws org.pentaho.di.core.exception.KettleException
Throws:
org.pentaho.di.core.exception.KettleException

getStepClass

public StepMetaInterface getStepClass(String desc)
                               throws org.pentaho.di.core.exception.KettleStepLoaderException
Throws:
org.pentaho.di.core.exception.KettleStepLoaderException

getStepClass

public StepMetaInterface getStepClass(StepPlugin sp)
                               throws org.pentaho.di.core.exception.KettleStepLoaderException
Throws:
org.pentaho.di.core.exception.KettleStepLoaderException

nrStepsWithType

public int nrStepsWithType(int type)
Count's the number of steps with a certain type.

Parameters:
type - One of StepPlugin.TYPE_NATIVE, StepPlugin.TYPE_PLUGIN, StepPlugin.TYPE_ALL
Returns:
The number of steps with a certain type.

getStepWithType

public StepPlugin getStepWithType(int type,
                                  int position)

getStepsWithType

public StepPlugin[] getStepsWithType(int type)

findStepPluginWithID

public StepPlugin findStepPluginWithID(String stepid)
Parameters:
stepid -
Returns:
The StepPlugin for the step with the specified ID. Null is returned when the ID couldn't be found!

findStepPluginWithDescription

public StepPlugin findStepPluginWithDescription(String description)

findStepPluginWithDescription

public StepPlugin findStepPluginWithDescription(String description,
                                                String locale)

getCategories

public String[] getCategories(int type)
Get a unique list of categories. We can use this to display in trees etc.

Parameters:
type - The type of step plugins for which we want to categories...
Returns:
a unique list of categories

getCategories

public String[] getCategories(int type,
                              String locale)
Get a unique list of categories. We can use this to display in trees etc.

Parameters:
type - The type of step plugins for which we want to categories...
Returns:
a unique list of categories

nrStepsWithCategory

public int nrStepsWithCategory(String category)

getStepWithCategory

public StepPlugin getStepWithCategory(String category,
                                      int position)

getStepsWithCategory

public StepPlugin[] getStepsWithCategory(String category)

getStepPluginID

public String getStepPluginID(StepMetaInterface sii)
Determine the step's id based upon the StepMetaInterface we get...

Parameters:
sii - The StepMetaInterface
Returns:
the step's id or null if we couldn't find anything.

getStepPlugin

public StepPlugin getStepPlugin(StepMetaInterface sii)
Determine the step's plugin based upon the StepMetaInterface we get...

Parameters:
sii - The StepMetaInterface
Returns:
the step plugin or null if we couldn't find anything.

getInputStreamForFile

public InputStream getInputStreamForFile(String filename)
Search through all jarfiles in all steps and try to find a certain file in it.

Specified by:
getInputStreamForFile in interface org.pentaho.di.i18n.LoaderInputStreamProvider
Parameters:
filename -
Returns:
an inputstream for the given file.

getPluginList

public List<StepPlugin> getPluginList()
Returns:
the pluginList

getPartitionerList

public static Map<String,Partitioner> getPartitionerList()

getPartitioner

public static Partitioner getPartitioner(String id)

getPluginInformation

public List<Object[]> getPluginInformation()

getPluginPackages

public String[] getPluginPackages()
Returns:
a unique array of all the step plugin package names