org.pentaho.di.trans.step
Class BaseStepMeta

java.lang.Object
  extended by org.pentaho.di.trans.step.BaseStepMeta
All Implemented Interfaces:
Cloneable, StepAttributesInterface
Direct Known Subclasses:
AbortMeta, AbstractStepMeta, AccessInputMeta, AccessOutputMeta, AddSequenceMeta, AddXMLMeta, AggregateRowsMeta, AnalyticQueryMeta, AppendMeta, AutoDocMeta, BlockingStepMeta, BlockUntilStepsFinishMeta, CalculatorMeta, ChangeFileEncodingMeta, CheckSumMeta, CloneRowMeta, ClosureGeneratorMeta, ColumnExistsMeta, CombinationLookupMeta, ConstantMeta, CreditCardValidatorMeta, CsvInputMeta, CubeInputMeta, CubeOutputMeta, DatabaseJoinMeta, DatabaseLookupMeta, DataGridMeta, DBProcMeta, DelayMeta, DeleteMeta, DenormaliserMeta, DetectEmptyStreamMeta, DetectLastRowMeta, DimensionLookupMeta, DummyTransMeta, DynamicSQLRowMeta, ElasticSearchBulkMeta, ExcelInputMeta, ExcelOutputMeta, ExcelWriterStepMeta, ExecProcessMeta, ExecSQLMeta, ExecSQLRowMeta, FieldsChangeSequenceMeta, FieldSplitterMeta, FileExistsMeta, FileLockedMeta, FilesFromResultMeta, FilesToResultMeta, FilterRowsMeta, FixedInputMeta, FlattenerMeta, FormulaMeta, FuzzyMatchMeta, GaInputStepMeta, GetFileNamesMeta, GetFilesRowsCountMeta, GetPreviousRowFieldMeta, GetRepositoryNamesMeta, GetSlaveSequenceMeta, GetSubFoldersMeta, GetTableNamesMeta, GetVariableMeta, GetXMLDataMeta, GPBulkLoaderMeta, GroupByMeta, HTTPMeta, HTTPPOSTMeta, IfNullMeta, IngresVectorwiseLoaderMeta, InjectorMeta, InsertUpdateMeta, JaninoMeta, JavaFilterMeta, JoinRowsMeta, JsonInputMeta, JsonOutputMeta, LDAPInputMeta, LDAPOutputMeta, LDIFInputMeta, LoadFileInputMeta, LucidDBBulkLoaderMeta, LucidDBStreamingLoaderMeta, MailInputMeta, MailMeta, MailValidatorMeta, MappingInputMeta, MappingMeta, MappingOutputMeta, MemoryGroupByMeta, MergeJoinMeta, MergeRowsMeta, MetaInjectMeta, MondrianInputMeta, MonetDBBulkLoaderMeta, MultiMergeJoinMeta, MySQLBulkLoaderMeta, NormaliserMeta, NullIfMeta, NumberRangeMeta, OlapInputMeta, OraBulkLoaderMeta, ParGzipCsvInputMeta, PentahoReportingOutputMeta, PGBulkLoaderMeta, PrioritizeStreamsMeta, ProcessFilesMeta, PropertyInputMeta, PropertyOutputMeta, RandomCCNumberGeneratorMeta, RandomValueMeta, RegexEvalMeta, ReplaceStringMeta, ReservoirSamplingMeta, RestMeta, RowGeneratorMeta, RowsFromResultMeta, RowsToResultMeta, RssInputMeta, RssOutputMeta, RulesMeta, SalesforceDeleteMeta, SalesforceInputMeta, SalesforceInsertMeta, SalesforceUpdateMeta, SalesforceUpsertMeta, SampleRowsMeta, SapInputMeta, ScriptMeta, ScriptValuesMetaMod, SecretKeyGeneratorMeta, SelectValuesMeta, SetValueConstantMeta, SetValueFieldMeta, SetVariableMeta, SingleThreaderMeta, SocketReaderMeta, SocketWriterMeta, SortedMergeMeta, SortRowsMeta, SplitFieldToRowsMeta, SQLFileOutputMeta, SSHMeta, StepMetastructureMeta, StepsMetricsMeta, StreamLookupMeta, StringCutMeta, StringOperationsMeta, SwitchCaseMeta, SymmetricCryptoTransMeta, SynchronizeAfterMergeMeta, SyslogMessageMeta, SystemDataMeta, TableExistsMeta, TableInputMeta, TableOutputMeta, TextFileInputMeta, TextFileOutputMeta, UniqueRowsByHashSetMeta, UniqueRowsMeta, UnivariateStatsMeta, UpdateMeta, UserDefinedJavaClassMeta, ValidatorMeta, ValueMapperMeta, WebServiceAvailableMeta, WebServiceMeta, WriteToLogMeta, XBaseInputMeta, XMLInputMeta, XMLInputSaxMeta, XMLInputStreamMeta, XMLJoinMeta, XMLOutputMeta, XsdValidatorMeta, XsltMeta, YamlInputMeta

public class BaseStepMeta
extends Object
implements Cloneable, StepAttributesInterface


Field Summary
static LoggingObjectInterface loggingObject
           
static String STEP_ATTRIBUTES_FILE
           
 
Constructor Summary
BaseStepMeta()
           
 
Method Summary
 void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info)
          Each step must be able to report on the impact it has on a database, table field, etc.
 void cancelQueries()
          Call this to cancel trailing database queries (too long running, etc)
 Object clone()
           
 boolean excludeFromCopyDistributeVerification()
          This method is added to exclude certain steps from copy/distribute checking.
 boolean excludeFromRowLayoutVerification()
          This method is added to exclude certain steps from layout checking.
 String exportResources(VariableSpace space, Map<String,ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository)
           
 KettleAttributeInterface findAttribute(String key)
           
 KettleAttributeInterface findParent(List<KettleAttributeInterface> attributes, String parentId)
           
 String getDescription(String attributeKey)
           
 String getDialogClassName()
          This returns the expected name for the dialog that edits a job entry.
 void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space)
           
 LogChannelInterface getLog()
           
 String getLogChannelId()
           
 String getName()
           
 String getObjectCopy()
           
 ObjectId getObjectId()
           
 ObjectRevision getObjectRevision()
           
 LoggingObjectType getObjectType()
           
 List<StreamInterface> getOptionalStreams()
           
 LoggingObjectInterface getParent()
           
 StepMeta getParentStepMeta()
           
 String getRepCode(String attributeKey)
           
 RepositoryDirectory getRepositoryDirectory()
           
 RowMetaInterface getRequiredFields()
          Deprecated.  
 RowMetaInterface getRequiredFields(VariableSpace space)
          The natural way of data flow in a transformation is source-to-target.
 List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo)
          Get a list of all the resource dependencies that the step is depending on.
 SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev)
          Standard method to return one or more SQLStatement objects that the step needs in order to work correctly.
 List<StepInjectionMetaEntry> getStepInjectionMetadataEntries(Class<?> PKG)
          Describe the metadata attributes that can be injected into this step metadata object.
 StepIOMetaInterface getStepIOMeta()
          Returns the Input/Output metadata for this step.
 StepMetaInjectionInterface getStepMetaInjectionInterface()
           
 TransMeta.TransformationType[] getSupportedTransformationTypes()
           
 RowMetaInterface getTableFields()
           
 String getTooltip(String attributeKey)
           
 Map<String,String> getUsedArguments()
          Default a step doesn't use any arguments.
 DatabaseMeta[] getUsedDatabaseConnections()
          This method returns all the database connections that are used by the step.
 String[] getUsedLibraries()
           
 String getXML()
          Produces the XML string that describes this step's information.
 String getXmlCode(String attributeKey)
           
 void handleStreamSelection(StreamInterface stream)
          When an optional stream is selected, this method is called to handled the ETL metadata implications of that.
 boolean hasChanged()
           
 boolean hasRepositoryReferences()
           
 boolean isBasic()
           
 boolean isDebug()
           
 boolean isDetailed()
           
 boolean isRowLevel()
           
 void logBasic(String message)
           
 void logBasic(String message, Object... arguments)
           
 void logDebug(String message)
           
 void logDebug(String message, Object... arguments)
           
 void logDetailed(String message)
           
 void logDetailed(String message, Object... arguments)
           
 void logError(String message)
           
 void logError(String message, Object... arguments)
           
 void logError(String message, Throwable e)
           
 void logMinimal(String message)
           
 void logMinimal(String message, Object... arguments)
           
 void logRowlevel(String message)
           
 void logRowlevel(String message, Object... arguments)
           
 void lookupRepositoryReferences(Repository repository)
          Look up the references after import
 void resetStepIoMeta()
           
 void searchInfoAndTargetSteps(List<StepMeta> steps)
          Change step names into step objects to allow them to be name-changed etc.
 void setChanged()
           
 void setChanged(boolean ch)
           
 void setParentStepMeta(StepMeta parentStepMeta)
           
 boolean supportsErrorHandling()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loggingObject

public static final LoggingObjectInterface loggingObject

STEP_ATTRIBUTES_FILE

public static final String STEP_ATTRIBUTES_FILE
See Also:
Constant Field Values
Constructor Detail

BaseStepMeta

public BaseStepMeta()
Method Detail

clone

public Object clone()
Overrides:
clone in class Object

setChanged

public void setChanged(boolean ch)

setChanged

public void setChanged()

hasChanged

public boolean hasChanged()

getTableFields

public RowMetaInterface getTableFields()

getXML

public String getXML()
              throws KettleException
Produces the XML string that describes this step's information.

Returns:
String containing the XML describing this step.
Throws:
KettleValueException - in case there is an XML conversion or encoding error
KettleException

getFields

public void getFields(RowMetaInterface inputRowMeta,
                      String name,
                      RowMetaInterface[] info,
                      StepMeta nextStep,
                      VariableSpace space)
               throws KettleStepException
Throws:
KettleStepException

analyseImpact

public void analyseImpact(List<DatabaseImpact> impact,
                          TransMeta transMeta,
                          StepMeta stepMeta,
                          RowMetaInterface prev,
                          String[] input,
                          String[] output,
                          RowMetaInterface info)
                   throws KettleStepException
Each step must be able to report on the impact it has on a database, table field, etc.

Parameters:
impact - The list of impacts @see org.pentaho.di.transMeta.DatabaseImpact
transMeta - The transformation information
stepMeta - The step information
prev - The fields entering this step
input - The previous step names
output - The output step names
info - The fields used as information by this step
Throws:
KettleStepException

getSQLStatements

public SQLStatement getSQLStatements(TransMeta transMeta,
                                     StepMeta stepMeta,
                                     RowMetaInterface prev)
                              throws KettleStepException
Standard method to return one or more SQLStatement objects that the step needs in order to work correctly. This can mean "create table", "create index" statements but also "alter table ... add/drop/modify" statements.

Parameters:
transMeta - TransInfo object containing the complete transformation
stepMeta - StepMeta object containing the complete step
prev - Row containing meta-data for the input fields (no data)
Returns:
The SQL Statements for this step or null if an error occurred. If nothing has to be done, the SQLStatement.getSQL() == null.
Throws:
KettleStepException

cancelQueries

public void cancelQueries()
                   throws KettleDatabaseException
Call this to cancel trailing database queries (too long running, etc)

Throws:
KettleDatabaseException

getUsedArguments

public Map<String,String> getUsedArguments()
Default a step doesn't use any arguments. Implement this to notify the GUI that a window has to be displayed BEFORE launching a transformation.

Returns:
A row of argument values. (name and optionally a default value)

getRequiredFields

public RowMetaInterface getRequiredFields()
                                   throws KettleException
Deprecated. 

The natural way of data flow in a transformation is source-to-target. However, this makes mapping to target tables difficult to do. To help out here, we supply information to the transformation meta-data model about which fields are required for a step. This allows us to automate certain tasks like the mapping to pre-defined tables. The Table Output step in this case will output the fields in the target table using this method. This default implementation returns an empty row meaning that no fields are required for this step to operate.

Returns:
the required fields for this steps meta data.
Throws:
KettleException - in case the required fields can't be determined

getRequiredFields

public RowMetaInterface getRequiredFields(VariableSpace space)
                                   throws KettleException
The natural way of data flow in a transformation is source-to-target. However, this makes mapping to target tables difficult to do. To help out here, we supply information to the transformation meta-data model about which fields are required for a step. This allows us to automate certain tasks like the mapping to pre-defined tables. The Table Output step in this case will output the fields in the target table using this method. This default implementation returns an empty row meaning that no fields are required for this step to operate.

Parameters:
space - the variable space to use to do variable substitution.
Returns:
the required fields for this steps meta data.
Throws:
KettleException - in case the required fields can't be determined

getUsedDatabaseConnections

public DatabaseMeta[] getUsedDatabaseConnections()
This method returns all the database connections that are used by the step.

Returns:
an array of database connections meta-data. Return an empty array if no connections are used.

getUsedLibraries

public String[] getUsedLibraries()
Returns:
the libraries that this step or plug-in uses.

supportsErrorHandling

public boolean supportsErrorHandling()
Returns:
true if this step supports error "reporting" on rows: the ability to send rows to a certain target step.

excludeFromRowLayoutVerification

public boolean excludeFromRowLayoutVerification()
This method is added to exclude certain steps from layout checking.

Since:
2.5.0

excludeFromCopyDistributeVerification

public boolean excludeFromCopyDistributeVerification()
This method is added to exclude certain steps from copy/distribute checking.

Since:
4.0.0

getResourceDependencies

public List<ResourceReference> getResourceDependencies(TransMeta transMeta,
                                                       StepMeta stepInfo)
Get a list of all the resource dependencies that the step is depending on.

Returns:
a list of all the resource dependencies that the step is depending on

exportResources

public String exportResources(VariableSpace space,
                              Map<String,ResourceDefinition> definitions,
                              ResourceNamingInterface resourceNamingInterface,
                              Repository repository)
                       throws KettleException
Throws:
KettleException

getDialogClassName

public String getDialogClassName()
This returns the expected name for the dialog that edits a job entry. The expected name is in the org.pentaho.di.ui tree and has a class name that is the name of the job entry with 'Dialog' added to the end. e.g. if the job entry is org.pentaho.di.job.entries.zipfile.JobEntryZipFile the dialog would be org.pentaho.di.ui.job.entries.zipfile.JobEntryZipFileDialog If the dialog class for a job entry does not match this pattern it should override this method and return the appropriate class name

Returns:
full class name of the dialog

getParentStepMeta

public StepMeta getParentStepMeta()

setParentStepMeta

public void setParentStepMeta(StepMeta parentStepMeta)

getLog

public LogChannelInterface getLog()

isBasic

public boolean isBasic()

isDetailed

public boolean isDetailed()

isDebug

public boolean isDebug()

isRowLevel

public boolean isRowLevel()

logMinimal

public void logMinimal(String message)

logMinimal

public void logMinimal(String message,
                       Object... arguments)

logBasic

public void logBasic(String message)

logBasic

public void logBasic(String message,
                     Object... arguments)

logDetailed

public void logDetailed(String message)

logDetailed

public void logDetailed(String message,
                        Object... arguments)

logDebug

public void logDebug(String message)

logDebug

public void logDebug(String message,
                     Object... arguments)

logRowlevel

public void logRowlevel(String message)

logRowlevel

public void logRowlevel(String message,
                        Object... arguments)

logError

public void logError(String message)

logError

public void logError(String message,
                     Throwable e)

logError

public void logError(String message,
                     Object... arguments)

getLogChannelId

public String getLogChannelId()

getName

public String getName()

getObjectCopy

public String getObjectCopy()

getObjectId

public ObjectId getObjectId()

getObjectRevision

public ObjectRevision getObjectRevision()

getObjectType

public LoggingObjectType getObjectType()

getParent

public LoggingObjectInterface getParent()

getRepositoryDirectory

public RepositoryDirectory getRepositoryDirectory()

getStepIOMeta

public StepIOMetaInterface getStepIOMeta()
Returns the Input/Output metadata for this step. By default, each step produces and accepts optional input.


getOptionalStreams

public List<StreamInterface> getOptionalStreams()
Returns:
The list of optional input streams. It allows the user to select from a list of possible actions like "New target step"

handleStreamSelection

public void handleStreamSelection(StreamInterface stream)
When an optional stream is selected, this method is called to handled the ETL metadata implications of that.

Parameters:
stream - The optional stream to handle.

resetStepIoMeta

public void resetStepIoMeta()

searchInfoAndTargetSteps

public void searchInfoAndTargetSteps(List<StepMeta> steps)
Change step names into step objects to allow them to be name-changed etc.

Parameters:
steps - the steps to reference

getStepMetaInjectionInterface

public StepMetaInjectionInterface getStepMetaInjectionInterface()
Returns:
Optional interface that allows an external program to inject step metadata in a standardized fasion. This method will return null if the interface is not available for this step.

getStepInjectionMetadataEntries

public List<StepInjectionMetaEntry> getStepInjectionMetadataEntries(Class<?> PKG)
Describe the metadata attributes that can be injected into this step metadata object.


findParent

public KettleAttributeInterface findParent(List<KettleAttributeInterface> attributes,
                                           String parentId)
Specified by:
findParent in interface StepAttributesInterface

findAttribute

public KettleAttributeInterface findAttribute(String key)
Specified by:
findAttribute in interface StepAttributesInterface

getXmlCode

public String getXmlCode(String attributeKey)
Specified by:
getXmlCode in interface StepAttributesInterface

getRepCode

public String getRepCode(String attributeKey)
Specified by:
getRepCode in interface StepAttributesInterface

getDescription

public String getDescription(String attributeKey)
Specified by:
getDescription in interface StepAttributesInterface

getTooltip

public String getTooltip(String attributeKey)
Specified by:
getTooltip in interface StepAttributesInterface

getSupportedTransformationTypes

public TransMeta.TransformationType[] getSupportedTransformationTypes()
Returns:
The supported transformation types that this step supports.

hasRepositoryReferences

public boolean hasRepositoryReferences()
Returns:
True if the job entry defines one or more references to a repository object.

lookupRepositoryReferences

public void lookupRepositoryReferences(Repository repository)
                                throws KettleException
Look up the references after import

Parameters:
repository - the repository to reference.
Throws:
KettleException