org.pentaho.di.job.entry
Class JobEntryBase

java.lang.Object
  extended by org.pentaho.di.job.entry.JobEntryBase
All Implemented Interfaces:
Cloneable, org.pentaho.di.core.CheckResultSourceInterface, org.pentaho.di.core.variables.VariableSpace, ResourceHolderInterface
Direct Known Subclasses:
JobEntryAbort, JobEntryAddResultFilenames, JobEntryColumnsExist, JobEntryConnectedToRepository, JobEntryCopyFiles, JobEntryCopyMoveResultFilenames, JobEntryCreateFile, JobEntryCreateFolder, JobEntryDelay, JobEntryDeleteFile, JobEntryDeleteFiles, JobEntryDeleteFolders, JobEntryDeleteResultFilenames, JobEntryDTDValidator, JobEntryEmpty, JobEntryEval, JobEntryEvalTableContent, JobEntryExportRepository, JobEntryFileCompare, JobEntryFileExists, JobEntryFilesExist, JobEntryFolderIsEmpty, JobEntryFoldersCompare, JobEntryFTP, JobEntryFTPDelete, JobEntryFTPPUT, JobEntryGetPOP, JobEntryHTTP, JobEntryJob, JobEntryMail, JobEntryMailValidator, JobEntryMoveFiles, JobEntryMSAccessBulkLoad, JobEntryMsgBoxInfo, JobEntryMssqlBulkLoad, JobEntryMysqlBulkFile, JobEntryMysqlBulkLoad, JobEntryPing, JobEntrySetVariables, JobEntrySFTP, JobEntrySFTPPUT, JobEntryShell, JobEntrySimpleEval, JobEntrySNMPTrap, JobEntrySpecial, JobEntrySQL, JobEntrySSH2GET, JobEntrySSH2PUT, JobEntrySuccess, JobEntryTableExists, JobEntryTrans, JobEntryTruncateTables, JobEntryUnZip, JobEntryWaitForFile, JobEntryWaitForSQL, JobEntryWriteToLog, JobEntryXMLWellFormed, JobEntryXSDValidator, JobEntryXSLT, JobEntryZipFile

public class JobEntryBase
extends Object
implements Cloneable, org.pentaho.di.core.variables.VariableSpace, org.pentaho.di.core.CheckResultSourceInterface, ResourceHolderInterface

Base class for the different types of job-entries...

Author:
Matt Created on 18-jun-04

Field Summary
static String[] category_order
           
 
Constructor Summary
JobEntryBase()
           
JobEntryBase(JobEntryBase jeb)
           
JobEntryBase(String name, String description)
           
 
Method Summary
 void check(List<org.pentaho.di.core.CheckResultInterface> remarks, JobMeta jobMeta)
          Support for overrides not having to put in a check method
 void clear()
           
 Object clone()
           
 void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
           
 String environmentSubstitute(String aString)
           
 String[] environmentSubstitute(String[] aString)
           
 boolean evaluates()
          check whether or not this job entry evaluates.
 String exportResources(org.pentaho.di.core.variables.VariableSpace space, Map<String,ResourceDefinition> definitions, ResourceNamingInterface namingInterface, Repository repository)
           
 boolean getBooleanValueOfVariable(String variableName, boolean defaultValue)
           
 String getConfigId()
           
 String getDescription()
           
 String getDialogClassName()
          This returns the expected name for the dialog that edits a job entry.
 String getFilename()
           
 String getHolderType()
          Gets the high-level type of resource holder.
 long getID()
           
 JobEntryType getJobEntryType()
           
 String getName()
           
 org.pentaho.di.core.variables.VariableSpace getParentVariableSpace()
           
 String getPluginID()
           
 String getRealFilename()
           
 List<ResourceReference> getResourceDependencies(JobMeta jobMeta)
          Get a list of all the resource dependencies that the step is depending on.
 List<org.pentaho.di.core.SQLStatement> getSQLStatements(Repository repository)
           
 List<org.pentaho.di.core.SQLStatement> getSQLStatements(Repository repository, org.pentaho.di.core.variables.VariableSpace space)
           
 String getTypeCode()
           
static String getTypeCode(JobEntryType type)
           
 String getTypeDesc()
           
static String getTypeDesc(JobEntryType type)
           
 String getTypeId()
          Support for CheckResultSourceInterface
 org.pentaho.di.core.database.DatabaseMeta[] getUsedDatabaseConnections()
          This method returns all the database connections that are used by the job entry.
 String getVariable(String variableName)
           
 String getVariable(String variableName, String defaultValue)
           
 String getXML()
           
 boolean hasChanged()
           
 void initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)
           
 void injectVariables(Map<String,String> prop)
           
 boolean isDummy()
           
 boolean isEvaluation()
           
 boolean isFTP()
           
 boolean isHTTP()
           
 boolean isJob()
           
 boolean isMail()
           
 boolean isSFTP()
           
 boolean isShell()
           
 boolean isSpecial()
           
 boolean isStart()
           
 boolean isTransformation()
           
 boolean isUnconditional()
           
 String[] listVariables()
           
 void loadRep(Repository rep, long id_jobentry, List<org.pentaho.di.core.database.DatabaseMeta> databases, List<SlaveServer> slaveServers)
           
 void loadXML(Node entrynode, List<org.pentaho.di.core.database.DatabaseMeta> databases, List<SlaveServer> slaveServers)
           
 void parseRepositoryObjects(Repository rep)
           
 boolean resetErrorsBeforeExecution()
           
 void saveRep(Repository rep, long id_job)
           
 void setChanged()
           
 void setChanged(boolean ch)
           
 void setConfigId(String configId)
           
 void setDescription(String Description)
           
 void setID(long id)
           
 void setJobEntryType(JobEntryType type)
           
 void setName(String name)
           
 void setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent)
           
 void setPluginID(String pid)
           
 void setVariable(String variableName, String variableValue)
           
 void shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

category_order

public static final String[] category_order
Constructor Detail

JobEntryBase

public JobEntryBase()

JobEntryBase

public JobEntryBase(String name,
                    String description)

JobEntryBase

public JobEntryBase(JobEntryBase jeb)
Method Detail

clear

public void clear()

setID

public void setID(long id)

getID

public long getID()
Specified by:
getID in interface org.pentaho.di.core.CheckResultSourceInterface
Specified by:
getID in interface ResourceHolderInterface
Returns:
The ID of the holder of the resource

setJobEntryType

public void setJobEntryType(JobEntryType type)

getPluginID

public String getPluginID()

getTypeId

public String getTypeId()
Support for CheckResultSourceInterface

Specified by:
getTypeId in interface org.pentaho.di.core.CheckResultSourceInterface
Specified by:
getTypeId in interface ResourceHolderInterface
Returns:
The Type ID of the resource holder. The Type ID is the system-defined type identifier (like TRANS or SORT).

getJobEntryType

public JobEntryType getJobEntryType()

getTypeCode

public String getTypeCode()

getTypeCode

public static final String getTypeCode(JobEntryType type)

getTypeDesc

public String getTypeDesc()

getTypeDesc

public static final String getTypeDesc(JobEntryType type)

setName

public void setName(String name)

setPluginID

public void setPluginID(String pid)

getName

public String getName()
Specified by:
getName in interface org.pentaho.di.core.CheckResultSourceInterface
Specified by:
getName in interface ResourceHolderInterface
Returns:
The name of the holder of the resource

setDescription

public void setDescription(String Description)

getDescription

public String getDescription()
Specified by:
getDescription in interface org.pentaho.di.core.CheckResultSourceInterface
Specified by:
getDescription in interface ResourceHolderInterface
Returns:
The description of the holder of the resource

setChanged

public void setChanged()

setChanged

public void setChanged(boolean ch)

hasChanged

public boolean hasChanged()

isStart

public boolean isStart()

isDummy

public boolean isDummy()

isEvaluation

public boolean isEvaluation()

isJob

public boolean isJob()

isMail

public boolean isMail()

isShell

public boolean isShell()

isSpecial

public boolean isSpecial()

isTransformation

public boolean isTransformation()

isFTP

public boolean isFTP()

isSFTP

public boolean isSFTP()

isHTTP

public boolean isHTTP()

getXML

public String getXML()

loadXML

public void loadXML(Node entrynode,
                    List<org.pentaho.di.core.database.DatabaseMeta> databases,
                    List<SlaveServer> slaveServers)
             throws org.pentaho.di.core.exception.KettleXMLException
Throws:
org.pentaho.di.core.exception.KettleXMLException

parseRepositoryObjects

public void parseRepositoryObjects(Repository rep)
                            throws org.pentaho.di.core.exception.KettleException
Throws:
org.pentaho.di.core.exception.KettleException

saveRep

public void saveRep(Repository rep,
                    long id_job)
             throws org.pentaho.di.core.exception.KettleException
Throws:
org.pentaho.di.core.exception.KettleException

loadRep

public void loadRep(Repository rep,
                    long id_jobentry,
                    List<org.pentaho.di.core.database.DatabaseMeta> databases,
                    List<SlaveServer> slaveServers)
             throws org.pentaho.di.core.exception.KettleException
Throws:
org.pentaho.di.core.exception.KettleException

clone

public Object clone()
Overrides:
clone in class Object

toString

public String toString()
Overrides:
toString in class Object

resetErrorsBeforeExecution

public boolean resetErrorsBeforeExecution()
Returns:
true if a reset of the number of errors is required before execution.

evaluates

public boolean evaluates()
check whether or not this job entry evaluates.

Returns:
true if the job entry evaluates

isUnconditional

public boolean isUnconditional()

getSQLStatements

public List<org.pentaho.di.core.SQLStatement> getSQLStatements(Repository repository)
                                                        throws org.pentaho.di.core.exception.KettleException
Throws:
org.pentaho.di.core.exception.KettleException

getSQLStatements

public List<org.pentaho.di.core.SQLStatement> getSQLStatements(Repository repository,
                                                               org.pentaho.di.core.variables.VariableSpace space)
                                                        throws org.pentaho.di.core.exception.KettleException
Throws:
org.pentaho.di.core.exception.KettleException

getFilename

public String getFilename()

getRealFilename

public String getRealFilename()

getUsedDatabaseConnections

public org.pentaho.di.core.database.DatabaseMeta[] getUsedDatabaseConnections()
This method returns all the database connections that are used by the job entry.

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

copyVariablesFrom

public void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
Specified by:
copyVariablesFrom in interface org.pentaho.di.core.variables.VariableSpace

environmentSubstitute

public String environmentSubstitute(String aString)
Specified by:
environmentSubstitute in interface org.pentaho.di.core.variables.VariableSpace

environmentSubstitute

public String[] environmentSubstitute(String[] aString)
Specified by:
environmentSubstitute in interface org.pentaho.di.core.variables.VariableSpace

getParentVariableSpace

public org.pentaho.di.core.variables.VariableSpace getParentVariableSpace()
Specified by:
getParentVariableSpace in interface org.pentaho.di.core.variables.VariableSpace

setParentVariableSpace

public void setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent)
Specified by:
setParentVariableSpace in interface org.pentaho.di.core.variables.VariableSpace

getVariable

public String getVariable(String variableName,
                          String defaultValue)
Specified by:
getVariable in interface org.pentaho.di.core.variables.VariableSpace

getVariable

public String getVariable(String variableName)
Specified by:
getVariable in interface org.pentaho.di.core.variables.VariableSpace

getBooleanValueOfVariable

public boolean getBooleanValueOfVariable(String variableName,
                                         boolean defaultValue)
Specified by:
getBooleanValueOfVariable in interface org.pentaho.di.core.variables.VariableSpace

initializeVariablesFrom

public void initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)
Specified by:
initializeVariablesFrom in interface org.pentaho.di.core.variables.VariableSpace

listVariables

public String[] listVariables()
Specified by:
listVariables in interface org.pentaho.di.core.variables.VariableSpace

setVariable

public void setVariable(String variableName,
                        String variableValue)
Specified by:
setVariable in interface org.pentaho.di.core.variables.VariableSpace

shareVariablesWith

public void shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)
Specified by:
shareVariablesWith in interface org.pentaho.di.core.variables.VariableSpace

injectVariables

public void injectVariables(Map<String,String> prop)
Specified by:
injectVariables in interface org.pentaho.di.core.variables.VariableSpace

check

public void check(List<org.pentaho.di.core.CheckResultInterface> remarks,
                  JobMeta jobMeta)
Support for overrides not having to put in a check method

Parameters:
remarks - CheckResults from checking the job entry
jobMeta - JobMeta information letting threading back to the JobMeta possible

getResourceDependencies

public List<ResourceReference> getResourceDependencies(JobMeta jobMeta)
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(org.pentaho.di.core.variables.VariableSpace space,
                              Map<String,ResourceDefinition> definitions,
                              ResourceNamingInterface namingInterface,
                              Repository repository)
                       throws org.pentaho.di.core.exception.KettleException
Throws:
org.pentaho.di.core.exception.KettleException

getConfigId

public String getConfigId()

setConfigId

public void setConfigId(String configId)

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

getHolderType

public String getHolderType()
Description copied from interface: ResourceHolderInterface
Gets the high-level type of resource holder.

Specified by:
getHolderType in interface ResourceHolderInterface
Returns:
JOBENTRY, STEP, etc.