Package org.pentaho.di.job.entry
Class JobEntryBase
- java.lang.Object
-
- org.pentaho.di.job.entry.JobEntryBase
-
- All Implemented Interfaces:
Cloneable
,org.pentaho.di.core.AttributesInterface
,org.pentaho.di.core.CheckResultSourceInterface
,org.pentaho.di.core.ExtensionDataInterface
,org.pentaho.di.core.logging.LoggingObjectInterface
,org.pentaho.di.core.logging.LoggingObjectLifecycleInterface
,org.pentaho.di.core.variables.VariableSpace
,ResourceHolderInterface
- Direct Known Subclasses:
JobEntryCheckFilesLocked
,JobEntryColumnsExist
,JobEntryConnectedToRepository
,JobEntryCopyFiles
,JobEntryCopyMoveResultFilenames
,JobEntryCreateFile
,JobEntryCreateFolder
,JobEntryDelay
,JobEntryDeleteFile
,JobEntryDeleteFiles
,JobEntryDeleteFolders
,JobEntryDeleteResultFilenames
,JobEntryDosToUnix
,JobEntryEmpty
,JobEntryEval
,JobEntryEvalFilesMetrics
,JobEntryEvalTableContent
,JobEntryExportRepository
,JobEntryFileCompare
,JobEntryFileExists
,JobEntryFilesExist
,JobEntryFolderIsEmpty
,JobEntryFoldersCompare
,JobEntryFTP
,JobEntryFTPDelete
,JobEntryFTPPUT
,JobEntryFTPSGet
,JobEntryFTPSPUT
,JobEntryGetPOP
,JobEntryHTTP
,JobEntryJob
,JobEntryMail
,JobEntryMailValidator
,JobEntryMoveFiles
,JobEntryMsgBoxInfo
,JobEntryMssqlBulkLoad
,JobEntryMysqlBulkFile
,JobEntryMysqlBulkLoad
,JobEntryPGPDecryptFiles
,JobEntryPGPEncryptFiles
,JobEntryPGPVerify
,JobEntryPing
,JobEntrySendNagiosPassiveCheck
,JobEntrySetVariables
,JobEntrySFTP
,JobEntrySFTPPUT
,JobEntryShell
,JobEntrySimpleEval
,JobEntrySNMPTrap
,JobEntrySpecial
,JobEntrySQL
,JobEntrySuccess
,JobEntrySyslog
,JobEntryTableExists
,JobEntryTalendJobExec
,JobEntryTelnet
,JobEntryTrans
,JobEntryTruncateTables
,JobEntryUnZip
,JobEntryWaitForFile
,JobEntryWaitForSQL
,JobEntryWebServiceAvailable
,JobEntryWriteToFile
,JobEntryWriteToLog
,JobEntryZipFile
public class JobEntryBase extends Object implements Cloneable, org.pentaho.di.core.variables.VariableSpace, org.pentaho.di.core.CheckResultSourceInterface, ResourceHolderInterface, org.pentaho.di.core.logging.LoggingObjectInterface, org.pentaho.di.core.AttributesInterface, org.pentaho.di.core.ExtensionDataInterface
Base class for the different types of job-entries. Job entries can extend this base class to get access to common member variables and default method behavior. However, JobEntryBase does not implement JobEntryInterface (although it implements most of the same methods), so individual job entry classes must implement JobEntryInterface and specifically theexecute()
method.- Author:
- Matt Created on 18-jun-04
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Map<String,String>>
attributesMap
protected String
containerObjectId
The container object idprotected Map<String,String>
entryStepSetVariablesMap
The map for setVariablesStep bindings for the job entryprotected Map<String,Object>
extensionDataMap
protected org.pentaho.di.core.logging.LogChannelInterface
log
The log channel interface object, used for loggingprotected org.pentaho.metastore.api.IMetaStore
metaStore
protected Job
parentJob
The parent jobprotected JobMeta
parentJobMeta
protected Repository
rep
The repositoryprotected org.pentaho.di.core.variables.VariableSpace
variables
The variable bindings for the job entry
-
Constructor Summary
Constructors Constructor Description JobEntryBase()
Instantiates a new job entry base object.JobEntryBase(String name, String description)
Instantiates a new job entry base object with the given name and description.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected String
addDatetimeToFilename(String filename, boolean addDate, String datePattern, boolean addTime, String timePattern, boolean specifyFormat, String datetimeFormat)
Appends the date, time and/or datetime to the given filename (before the extension if it exists), using the provided patterns.void
check(List<org.pentaho.di.core.CheckResultInterface> remarks, JobMeta jobMeta)
Deprecated.void
check(List<org.pentaho.di.core.CheckResultInterface> remarks, JobMeta jobMeta, org.pentaho.di.core.variables.VariableSpace space, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore)
Allows JobEntry objects to check themselves for consistencyvoid
clear()
Clears all variable valuesObject
clone()
This method is called when a job entry is duplicated in Spoon.void
copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
Copies variables from a given variable space to this job entryString
environmentSubstitute(String aString)
Substitutes any variable values into the given string, and returns the resolved stringString[]
environmentSubstitute(String[] aString)
Substitutes any variable values into each of the given strings, and returns an array containing the resolved string(s)boolean
equals(Object obj)
Checks if the JobEntry object is equal to the specified objectboolean
evaluates()
This method must return true if the job entry supports the true/false outgoing hops.String
exportResources(org.pentaho.di.core.variables.VariableSpace space, Map<String,ResourceDefinition> definitions, ResourceNamingInterface namingInterface, Repository repository)
String
exportResources(org.pentaho.di.core.variables.VariableSpace space, Map<String,ResourceDefinition> definitions, ResourceNamingInterface namingInterface, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore)
Exports the object to a flat-file system, adding content with filename keys to a set of definitions.String
fieldSubstitute(String aString, org.pentaho.di.core.row.RowMetaInterface rowMeta, Object[] rowData)
String
getAttribute(String groupName, String key)
Map<String,String>
getAttributes(String groupName)
Map<String,Map<String,String>>
getAttributesMap()
boolean
getBooleanValueOfVariable(String variableName, boolean defaultValue)
Returns a boolean representation of the specified variable after performing any necessary substitution.String
getContainerObjectId()
Gets the container object idString
getDescription()
Gets the description of the job entryString
getDialogClassName()
Deprecated.As of release 8.1, use annotated-based dialog instead {@see org.pentaho.di.core.annotations.PluginDialog}String
getEntryStepSetVariable(String variableName)
Gets the value of the specified EntryStepSetVariableprotected Map<String,String>
getEntryStepSetVariablesMap()
Gets a Map of variables set in EntryStepSetVariablesMap<String,Object>
getExtensionDataMap()
String
getFilename()
Gets the filename of the job entry.String
getHolderType()
Returns the holder type for the job entryorg.pentaho.di.core.logging.LogChannelInterface
getLogChannel()
Gets the log channel.String
getLogChannelId()
Gets the logging channel idorg.pentaho.di.core.logging.LogLevel
getLogLevel()
Gets the logging level for the job entryorg.pentaho.metastore.api.IMetaStore
getMetaStore()
String
getName()
Gets the name of the job entryString
getObjectCopy()
Gets a string identifying a copy in a series of stepsorg.pentaho.di.repository.ObjectId
getObjectId()
Gets the object idString
getObjectName()
Gets the object nameorg.pentaho.di.repository.ObjectRevision
getObjectRevision()
Gets the revision of the object with respect to a repositoryorg.pentaho.di.core.logging.LoggingObjectType
getObjectType()
Gets the logging object typeorg.pentaho.di.core.logging.LoggingObjectInterface
getParent()
Gets the logging object interface's parentJob
getParentJob()
Gets the parent job.JobMeta
getParentJobMeta()
org.pentaho.di.core.variables.VariableSpace
getParentVariableSpace()
Gets the parent variable spaceString
getPluginId()
Gets the plugin id.String
getRealFilename()
Gets the real filename of the job entry, by substituting any environment variables present in the filename.String[]
getReferencedObjectDescriptions()
Date
getRegistrationDate()
Returns the registration date for the job entry.Repository
getRepository()
Gets the repository for the job entry.org.pentaho.di.repository.RepositoryDirectory
getRepositoryDirectory()
Gets the directory of the job entry in the repository.List<ResourceReference>
getResourceDependencies(JobMeta jobMeta)
Gets a list of all the resource dependencies that the step is depending on.List<org.pentaho.di.core.SQLStatement>
getSQLStatements(Repository repository)
Deprecated.List<org.pentaho.di.core.SQLStatement>
getSQLStatements(Repository repository, org.pentaho.di.core.variables.VariableSpace space)
Deprecated.List<org.pentaho.di.core.SQLStatement>
getSQLStatements(Repository repository, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.core.variables.VariableSpace space)
Gets the SQL statements needed by this job entry to execute successfully, given a set of variables.String
getTypeDesc()
Gets the plug-in type descriptionString
getTypeId()
Deprecated.usegetPluginId()
org.pentaho.di.core.database.DatabaseMeta[]
getUsedDatabaseConnections()
Gets all the database connections that are used by the job entry.String
getVariable(String variableName)
Gets the value of the specified variable, or returns a default value if no such variable existsString
getVariable(String variableName, String defaultValue)
Gets the value of the specified variable, or returns a default value if no such variable existsprotected org.pentaho.di.core.variables.VariableSpace
getVariables()
Gets the variable bindings for the job entry.String
getXML()
This method is called by PDI whenever a job entry needs to serialize its settings to XML.boolean
hasChanged()
Checks whether the job entry has changedint
hashCode()
boolean
hasRepositoryReferences()
Checks whether the job entry has repository references.void
initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)
Sets the values of the job entry's variables to the values from the parent variablesvoid
injectVariables(Map<String,String> prop)
Injects variables using the given Map.boolean
isBasic()
Checks if the logging level is basic.boolean
isDebug()
Checks if the logging level is debug.boolean
isDetailed()
Checks if the logging level is detailed.boolean
isDummy()
Checks if the job entry is a dummy entryboolean
isEvaluation()
Checks if the job entry is an evaluation.boolean
isForcingSeparateLogging()
boolean
isFTP()
Checks if this job entry performs an FTP operationboolean
isGatheringMetrics()
boolean
isHTTP()
Checks if this job entry performs an HTTP operationboolean
isJob()
Checks if the job entry executes a jobboolean
isMail()
Checks if the job entry sends emailboolean[]
isReferencedObjectEnabled()
boolean
isRowlevel()
Checks if the logging level is rowlevel.boolean
isSFTP()
Checks if this job entry performs an SFTP operationboolean
isShell()
Checks if the job entry executes a shell programboolean
isSpecial()
Checks if the job entry is of a special type (Start, Dummy, etc.)boolean
isStart()
Checks if the job entry has startedboolean
isTransformation()
Checks if this job entry executes a transformationboolean
isUnconditional()
This method must return true if the job entry supports the unconditional outgoing hop.String[]
listVariables()
Gets a list of variable names for the job entryObject
loadReferencedObject(int index, Repository rep, org.pentaho.di.core.variables.VariableSpace space)
Deprecated.Object
loadReferencedObject(int index, Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.core.variables.VariableSpace space)
Load the referenced objectvoid
loadRep(Repository rep, org.pentaho.di.repository.ObjectId id_jobentry, List<org.pentaho.di.core.database.DatabaseMeta> databases, List<SlaveServer> slaveServers)
Deprecated.void
loadRep(Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.repository.ObjectId 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)
This method is called by PDI whenever a job entry needs to read its settings from XML.void
loadXML(Node entrynode, List<org.pentaho.di.core.database.DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository repository)
Deprecated.void
loadXML(Node entrynode, List<org.pentaho.di.core.database.DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep, org.pentaho.metastore.api.IMetaStore metaStore)
void
logBasic(String message)
Logs the specified string at the basic level.void
logBasic(String message, Object... arguments)
Logs the specified string and arguments at the basic level.void
logDebug(String message)
Logs the specified string at the debug level.void
logDebug(String message, Object... arguments)
Logs the specified string and arguments at the debug level.void
logDetailed(String message)
Logs the specified string at the detailed level.void
logDetailed(String message, Object... arguments)
Logs the specified string and arguments at the detailed level.void
logError(String message)
Logs the specified string at the error level.void
logError(String message, Object... arguments)
Logs the specified string and arguments at the error level.void
logError(String message, Throwable e)
Logs the specified string and Throwable object at the error level.void
logMinimal(String message)
Logs the specified string at the minimal level.void
logMinimal(String message, Object... arguments)
Logs the specified string and arguments at the minimal level.void
logRowlevel(String message)
Logs the specified string at the row level.void
logRowlevel(String message, Object... arguments)
Logs the specified string and arguments at the row level.void
lookupRepositoryReferences(Repository repository)
Looks up the references after importvoid
parseRepositoryObjects(Repository rep)
Parses the repository objects.boolean
resetErrorsBeforeExecution()
Checks whether a reset of the number of errors is required before execution.void
saveRep(Repository rep, org.pentaho.di.repository.ObjectId id_job)
Deprecated.void
saveRep(Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.repository.ObjectId id_job)
void
setAttribute(String groupName, String key, String value)
void
setAttributes(String groupName, Map<String,String> attributes)
void
setAttributesMap(Map<String,Map<String,String>> attributesMap)
void
setChanged()
Sets that the job entry has changed (i.e.void
setChanged(boolean ch)
Sets whether the job entry has changedvoid
setContainerObjectId(String containerObjectId)
Sets the container object idvoid
setDescription(String Description)
Sets the description for the job entry.void
setEntryStepSetVariable(String variableName, String variableValue)
Sets the value of the specified EntryStepSetVariablevoid
setForcingSeparateLogging(boolean forcingSeparateLogging)
void
setGatheringMetrics(boolean gatheringMetrics)
void
setID(long id)
Sets the id for the job entryvoid
setLogLevel(org.pentaho.di.core.logging.LogLevel logLevel)
Sets the logging level for the job entryvoid
setMetaStore(org.pentaho.metastore.api.IMetaStore metaStore)
void
setName(String name)
Sets the name of the job entryvoid
setObjectId(org.pentaho.di.repository.ObjectId id)
Sets the object id.void
setParentJob(Job parentJob)
Sets the parent job.void
setParentJobMeta(JobMeta parentJobMeta)
At save and run time, the system will attempt to set the jobMeta so that it can be accessed by the jobEntries if necessary.void
setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent)
Sets the parent variable spacevoid
setPluginId(String configId)
Sets the plugin id.void
setRepository(Repository repository)
Sets the repository for the job entry.void
setTypeId(String typeId)
Deprecated.void
setVariable(String variableName, String variableValue)
Sets the value of the specified variable to the specified valuevoid
shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)
Shares a variable space from another variable space.String
toString()
Returns a string representation of the object.-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
variables
protected org.pentaho.di.core.variables.VariableSpace variables
The variable bindings for the job entry
-
entryStepSetVariablesMap
protected Map<String,String> entryStepSetVariablesMap
The map for setVariablesStep bindings for the job entry
-
rep
protected Repository rep
The repository
-
parentJob
protected Job parentJob
The parent job
-
log
protected org.pentaho.di.core.logging.LogChannelInterface log
The log channel interface object, used for logging
-
containerObjectId
protected String containerObjectId
The container object id
-
metaStore
protected org.pentaho.metastore.api.IMetaStore metaStore
-
parentJobMeta
protected JobMeta parentJobMeta
-
-
Method Detail
-
equals
public boolean equals(Object obj)
Checks if the JobEntry object is equal to the specified object- Overrides:
equals
in classObject
- Returns:
- true if the two objects are equal, false otherwise
- See Also:
Object.equals(java.lang.Object)
-
clear
public void clear()
Clears all variable values
-
setObjectId
public void setObjectId(org.pentaho.di.repository.ObjectId id)
Sets the object id.- Parameters:
id
- the new object id
-
setID
public void setID(long id)
Sets the id for the job entry- Parameters:
id
- the new id
-
getObjectId
public org.pentaho.di.repository.ObjectId getObjectId()
Gets the object id- Specified by:
getObjectId
in interfaceorg.pentaho.di.core.CheckResultSourceInterface
- Specified by:
getObjectId
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Specified by:
getObjectId
in interfaceResourceHolderInterface
- Returns:
- the object id
- See Also:
CheckResultSourceInterface.getObjectId()
-
getTypeDesc
public String getTypeDesc()
Gets the plug-in type description- Returns:
- the plug-in type description
-
setName
public void setName(String name)
Sets the name of the job entry- Parameters:
name
- the new name
-
getName
public String getName()
Gets the name of the job entry- Specified by:
getName
in interfaceorg.pentaho.di.core.CheckResultSourceInterface
- Specified by:
getName
in interfaceResourceHolderInterface
- Returns:
- the name of the job entry
- See Also:
CheckResultSourceInterface.getName()
-
setDescription
public void setDescription(String Description)
Sets the description for the job entry.- Parameters:
Description
- the new description
-
getDescription
public String getDescription()
Gets the description of the job entry- Specified by:
getDescription
in interfaceorg.pentaho.di.core.CheckResultSourceInterface
- Specified by:
getDescription
in interfaceResourceHolderInterface
- Returns:
- the description of the job entry
- See Also:
CheckResultSourceInterface.getDescription()
-
setChanged
public void setChanged()
Sets that the job entry has changed (i.e. a call to setChanged(true))- See Also:
setChanged(boolean)
-
setChanged
public void setChanged(boolean ch)
Sets whether the job entry has changed- Parameters:
ch
- true if the job entry has changed, false otherwise
-
hasChanged
public boolean hasChanged()
Checks whether the job entry has changed- Returns:
- true if the job entry has changed, false otherwise
-
isStart
public boolean isStart()
Checks if the job entry has started- Returns:
- true if the job entry has started, false otherwise
-
isDummy
public boolean isDummy()
Checks if the job entry is a dummy entry- Returns:
- true if the job entry is a dummy entry, false otherwise
-
isEvaluation
public boolean isEvaluation()
Checks if the job entry is an evaluation.- Returns:
- true if the job entry is an evaluation, false otherwise
-
isJob
public boolean isJob()
Checks if the job entry executes a job- Returns:
- true if the job entry executes a job, false otherwise
-
isMail
public boolean isMail()
Checks if the job entry sends email- Returns:
- true if the job entry sends email, false otherwise
-
isShell
public boolean isShell()
Checks if the job entry executes a shell program- Returns:
- true if the job entry executes a shell program, false otherwise
-
isSpecial
public boolean isSpecial()
Checks if the job entry is of a special type (Start, Dummy, etc.)- Returns:
- true if the job entry is of a special type, false otherwise
-
isTransformation
public boolean isTransformation()
Checks if this job entry executes a transformation- Returns:
- true if this job entry executes a transformation, false otherwise
-
isFTP
public boolean isFTP()
Checks if this job entry performs an FTP operation- Returns:
- true if this job entry performs an FTP operation, false otherwise
-
isSFTP
public boolean isSFTP()
Checks if this job entry performs an SFTP operation- Returns:
- true if this job entry performs an SFTP operation, false otherwise
-
isHTTP
public boolean isHTTP()
Checks if this job entry performs an HTTP operation- Returns:
- true if this job entry performs an HTTP operation, false otherwise
-
getXML
public String getXML()
This method is called by PDI whenever a job entry needs to serialize its settings to XML. It is called when saving a job in Spoon. The method returns an XML string, containing the serialized settings. The string contains a series of XML tags, typically one tag per setting. The helper class org.pentaho.di.core.xml.XMLHandler is typically used to construct the XML string.- Returns:
- the xml representation of the job entry
-
loadXML
public void loadXML(Node entrynode, List<org.pentaho.di.core.database.DatabaseMeta> databases, List<SlaveServer> slaveServers) throws org.pentaho.di.core.exception.KettleXMLException
This method is called by PDI whenever a job entry needs to read its settings from XML. The XML node containing the job entry's settings is passed in as an argument. Again, the helper class org.pentaho.di.core.xml.XMLHandler is typically used to conveniently read the settings from the XML node.- Parameters:
entrynode
- the top-level XML nodedatabases
- the list of databasesslaveServers
- the list of slave servers- Throws:
org.pentaho.di.core.exception.KettleXMLException
- if any errors occur during the loading of the XML
-
loadXML
@Deprecated public void loadXML(Node entrynode, List<org.pentaho.di.core.database.DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository repository) throws org.pentaho.di.core.exception.KettleXMLException
Deprecated.- Parameters:
entrynode
-databases
-slaveServers
-repository
-- Throws:
org.pentaho.di.core.exception.KettleXMLException
-
loadXML
public void loadXML(Node entrynode, List<org.pentaho.di.core.database.DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep, org.pentaho.metastore.api.IMetaStore metaStore) 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
Parses the repository objects. For JobEntryBase, this is a stub (empty) method- Parameters:
rep
- the repository- Throws:
org.pentaho.di.core.exception.KettleException
- if any errors occur during parsing
-
loadRep
@Deprecated public void loadRep(Repository rep, org.pentaho.di.repository.ObjectId id_jobentry, List<org.pentaho.di.core.database.DatabaseMeta> databases, List<SlaveServer> slaveServers) throws org.pentaho.di.core.exception.KettleException
Deprecated.This method is called by PDI whenever a job entry needs to read its configuration from a PDI repository. For JobEntryBase, this method performs no operations.- Parameters:
rep
- the repository objectid_jobentry
- the id of the job entrydatabases
- the list of databasesslaveServers
- the list of slave servers- Throws:
org.pentaho.di.core.exception.KettleException
- if any errors occur during the load
-
loadRep
public void loadRep(Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.repository.ObjectId 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
-
saveRep
@Deprecated public void saveRep(Repository rep, org.pentaho.di.repository.ObjectId id_job) throws org.pentaho.di.core.exception.KettleException
Deprecated.This method is called by PDI whenever a job entry needs to save its settings to a PDI repository. For JobEntryBase, this method performs no operations.- Parameters:
rep
- the repository objectid_job
- the id_job- Throws:
org.pentaho.di.core.exception.KettleException
- if any errors occur during the save
-
saveRep
public void saveRep(Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.repository.ObjectId id_job) throws org.pentaho.di.core.exception.KettleException
- Parameters:
rep
-metaStore
-id_job
-- Throws:
org.pentaho.di.core.exception.KettleException
-
clone
public Object clone()
This method is called when a job entry is duplicated in Spoon. It needs to return a deep copy of this job entry object. It is essential that the implementing class creates proper deep copies if the job entry configuration is stored in modifiable objects, such as lists or custom helper objects.
-
toString
public String toString()
Returns a string representation of the object. For JobEntryBase, this method returns the name- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
resetErrorsBeforeExecution
public boolean resetErrorsBeforeExecution()
Checks whether a reset of the number of errors is required before execution.- Returns:
- true if a reset of the number of errors is required before execution, false otherwise
-
evaluates
public boolean evaluates()
This method must return true if the job entry supports the true/false outgoing hops. For JobEntryBase, this method always returns false- Returns:
- false
-
isUnconditional
public boolean isUnconditional()
This method must return true if the job entry supports the unconditional outgoing hop. For JobEntryBase, this method always returns true- Returns:
- true
-
getSQLStatements
@Deprecated public List<org.pentaho.di.core.SQLStatement> getSQLStatements(Repository repository) throws org.pentaho.di.core.exception.KettleException
Deprecated.Gets the SQL statements needed by this job entry to execute successfully.- Parameters:
repository
- the repository- Returns:
- a list of SQL statements
- Throws:
org.pentaho.di.core.exception.KettleException
- if any errors occur during the generation of SQL statements
-
getSQLStatements
@Deprecated public List<org.pentaho.di.core.SQLStatement> getSQLStatements(Repository repository, org.pentaho.di.core.variables.VariableSpace space) throws org.pentaho.di.core.exception.KettleException
Deprecated.Gets the SQL statements needed by this job entry to execute successfully, given a set of variables. For JobEntryBase, this method returns an empty list.- Parameters:
repository
- the repository objectspace
- a variable space object containing variable bindings- Returns:
- an empty list
- Throws:
org.pentaho.di.core.exception.KettleException
- if any errors occur during the generation of SQL statements
-
getSQLStatements
public List<org.pentaho.di.core.SQLStatement> getSQLStatements(Repository repository, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.core.variables.VariableSpace space) throws org.pentaho.di.core.exception.KettleException
Gets the SQL statements needed by this job entry to execute successfully, given a set of variables. For JobEntryBase, this method returns an empty list.- Parameters:
repository
- the repository objectspace
- a variable space object containing variable bindings- Returns:
- an empty list
- Throws:
org.pentaho.di.core.exception.KettleException
- if any errors occur during the generation of SQL statements
-
getFilename
public String getFilename()
Gets the filename of the job entry. For JobEntryBase, this method always returns null- Specified by:
getFilename
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- null
- See Also:
LoggingObjectInterface.getFilename()
-
getRealFilename
public String getRealFilename()
Gets the real filename of the job entry, by substituting any environment variables present in the filename. For JobEntryBase, this method always returns null- Returns:
- null
-
getUsedDatabaseConnections
public org.pentaho.di.core.database.DatabaseMeta[] getUsedDatabaseConnections()
Gets all the database connections that are used by the job entry. For JobEntryBase, this method returns an empty (non-null) array- Returns:
- an empty (non-null) array
-
copyVariablesFrom
public void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
Copies variables from a given variable space to this job entry- Specified by:
copyVariablesFrom
in interfaceorg.pentaho.di.core.variables.VariableSpace
- See Also:
VariableSpace.copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace)
-
environmentSubstitute
public String environmentSubstitute(String aString)
Substitutes any variable values into the given string, and returns the resolved string- Specified by:
environmentSubstitute
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Returns:
- the string with any environment variables resolved and substituted
- See Also:
VariableSpace.environmentSubstitute(java.lang.String)
-
environmentSubstitute
public String[] environmentSubstitute(String[] aString)
Substitutes any variable values into each of the given strings, and returns an array containing the resolved string(s)- Specified by:
environmentSubstitute
in interfaceorg.pentaho.di.core.variables.VariableSpace
- See Also:
VariableSpace.environmentSubstitute(java.lang.String[])
-
fieldSubstitute
public String fieldSubstitute(String aString, org.pentaho.di.core.row.RowMetaInterface rowMeta, Object[] rowData) throws org.pentaho.di.core.exception.KettleValueException
- Specified by:
fieldSubstitute
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Throws:
org.pentaho.di.core.exception.KettleValueException
-
getParentVariableSpace
public org.pentaho.di.core.variables.VariableSpace getParentVariableSpace()
Gets the parent variable space- Specified by:
getParentVariableSpace
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Returns:
- the parent variable space
- See Also:
VariableSpace.getParentVariableSpace()
-
setParentVariableSpace
public void setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent)
Sets the parent variable space- Specified by:
setParentVariableSpace
in interfaceorg.pentaho.di.core.variables.VariableSpace
- See Also:
VariableSpace.setParentVariableSpace( org.pentaho.di.core.variables.VariableSpace)
-
getVariable
public String getVariable(String variableName, String defaultValue)
Gets the value of the specified variable, or returns a default value if no such variable exists- Specified by:
getVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Returns:
- the value of the specified variable, or returns a default value if no such variable exists
- See Also:
VariableSpace.getVariable(java.lang.String, java.lang.String)
-
getVariable
public String getVariable(String variableName)
Gets the value of the specified variable, or returns a default value if no such variable exists- Specified by:
getVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Returns:
- the value of the specified variable, or returns a default value if no such variable exists
- See Also:
VariableSpace.getVariable(java.lang.String)
-
getBooleanValueOfVariable
public boolean getBooleanValueOfVariable(String variableName, boolean defaultValue)
Returns a boolean representation of the specified variable after performing any necessary substitution. Truth values include case-insensitive versions of "Y", "YES", "TRUE" or "1".- Specified by:
getBooleanValueOfVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Parameters:
variableName
- the name of the variable to interrogate- Returns:
- a boolean representation of the specified variable after performing any necessary substitution
- See Also:
VariableSpace.getBooleanValueOfVariable(java.lang.String, boolean)
-
initializeVariablesFrom
public void initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)
Sets the values of the job entry's variables to the values from the parent variables- Specified by:
initializeVariablesFrom
in interfaceorg.pentaho.di.core.variables.VariableSpace
- See Also:
VariableSpace.initializeVariablesFrom( org.pentaho.di.core.variables.VariableSpace)
-
listVariables
public String[] listVariables()
Gets a list of variable names for the job entry- Specified by:
listVariables
in interfaceorg.pentaho.di.core.variables.VariableSpace
- Returns:
- a list of variable names
- See Also:
VariableSpace.listVariables()
-
setVariable
public void setVariable(String variableName, String variableValue)
Sets the value of the specified variable to the specified value- Specified by:
setVariable
in interfaceorg.pentaho.di.core.variables.VariableSpace
- See Also:
VariableSpace.setVariable(java.lang.String, java.lang.String)
-
shareVariablesWith
public void shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)
Shares a variable space from another variable space. This means that the object should take over the space used as argument.- Specified by:
shareVariablesWith
in interfaceorg.pentaho.di.core.variables.VariableSpace
- See Also:
VariableSpace.shareVariablesWith(org.pentaho.di.core.variables.VariableSpace)
-
injectVariables
public void injectVariables(Map<String,String> prop)
Injects variables using the given Map. The behavior should be that the properties object will be stored and at the time the VariableSpace is initialized (or upon calling this method if the space is already initialized). After injecting the link of the properties object should be removed.- Specified by:
injectVariables
in interfaceorg.pentaho.di.core.variables.VariableSpace
- See Also:
VariableSpace.injectVariables(java.util.Map)
-
check
@Deprecated public void check(List<org.pentaho.di.core.CheckResultInterface> remarks, JobMeta jobMeta)
Deprecated.Support for overrides not having to put in a check method. For JobEntryBase, this method performs no operations.- Parameters:
remarks
- CheckResults from checking the job entryjobMeta
- JobMeta information letting threading back to the JobMeta possible
-
check
public void check(List<org.pentaho.di.core.CheckResultInterface> remarks, JobMeta jobMeta, org.pentaho.di.core.variables.VariableSpace space, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore)
Allows JobEntry objects to check themselves for consistency- Parameters:
remarks
- List of CheckResult objects indicating consistency statusjobMeta
- the metadata object for the job entryspace
- the variable space to resolve string expressions with variables withrepository
- the repository to load Kettle objects frommetaStore
- the MetaStore to load common elements from
-
getResourceDependencies
public List<ResourceReference> getResourceDependencies(JobMeta jobMeta)
Gets a list of all the resource dependencies that the step is depending on. In JobEntryBase, this method returns an empty resource dependency list.- Returns:
- an empty list of ResourceReferences
- See Also:
ResourceReference
-
exportResources
@Deprecated 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
Deprecated.Exports the object to a flat-file system, adding content with filename keys to a set of definitions. For JobEntryBase, this method simply returns null- Parameters:
space
- The variable space to resolve (environment) variables with.definitions
- The map containing the filenames and contentnamingInterface
- The resource naming interface allows the object to be named appropriatelyrepository
- The repository to load resources from- Returns:
- The filename for this object. (also contained in the definitions map)
- Throws:
org.pentaho.di.core.exception.KettleException
- in case something goes wrong during the export
-
exportResources
public String exportResources(org.pentaho.di.core.variables.VariableSpace space, Map<String,ResourceDefinition> definitions, ResourceNamingInterface namingInterface, Repository repository, org.pentaho.metastore.api.IMetaStore metaStore) throws org.pentaho.di.core.exception.KettleException
Exports the object to a flat-file system, adding content with filename keys to a set of definitions. The supplied resource naming interface allows the object to name appropriately without worrying about those parts of the implementation specific details.- Parameters:
space
- The variable space to resolve (environment) variables with.definitions
- The map containing the filenames and contentnamingInterface
- The resource naming interface allows the object to be named appropriatelyrepository
- The repository to load resources frommetaStore
- the metaStore to load external metadata from- Returns:
- The filename for this object. (also contained in the definitions map)
- Throws:
org.pentaho.di.core.exception.KettleException
- in case something goes wrong during the export
-
getPluginId
public String getPluginId()
Gets the plugin id.- Returns:
- the plugin id
-
setPluginId
public void setPluginId(String configId)
Sets the plugin id.- Parameters:
configId
- the new plugin id
-
getTypeId
@Deprecated public String getTypeId()
Deprecated.usegetPluginId()
Gets the plugin id.- Specified by:
getTypeId
in interfaceorg.pentaho.di.core.CheckResultSourceInterface
- Specified by:
getTypeId
in interfaceResourceHolderInterface
- Returns:
- The Type ID of the resource holder. The Type ID is the system-defined type identifier (like TRANS or SORT).
-
setTypeId
@Deprecated public void setTypeId(String typeId)
Deprecated.Sets the plugin id.
-
getDialogClassName
@Deprecated public String getDialogClassName()
Deprecated.As of release 8.1, use annotated-based dialog instead {@see org.pentaho.di.core.annotations.PluginDialog}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()
Returns the holder type for the job entry- Specified by:
getHolderType
in interfaceResourceHolderInterface
- Returns:
- the holder type for the job entry
- See Also:
ResourceHolderInterface.getHolderType()
-
getVariables
protected org.pentaho.di.core.variables.VariableSpace getVariables()
Gets the variable bindings for the job entry.- Returns:
- the variable bindings for the job entry.
-
setRepository
public void setRepository(Repository repository)
Sets the repository for the job entry.- Parameters:
repository
- the repository
-
getRepository
public Repository getRepository()
Gets the repository for the job entry.- Returns:
- the repository
-
setParentJob
public void setParentJob(Job parentJob)
Sets the parent job.- Parameters:
parentJob
- the new parent job
-
getParentJob
public Job getParentJob()
Gets the parent job.- Returns:
- the parent job
-
isBasic
public boolean isBasic()
Checks if the logging level is basic.- Returns:
- true if the logging level is basic, false otherwise
-
isDetailed
public boolean isDetailed()
Checks if the logging level is detailed.- Returns:
- true if the logging level is detailed, false otherwise
-
isDebug
public boolean isDebug()
Checks if the logging level is debug.- Returns:
- true if the logging level is debug, false otherwise
-
isRowlevel
public boolean isRowlevel()
Checks if the logging level is rowlevel.- Returns:
- true if the logging level is rowlevel, false otherwise
-
logMinimal
public void logMinimal(String message)
Logs the specified string at the minimal level.- Parameters:
message
- the message
-
logMinimal
public void logMinimal(String message, Object... arguments)
Logs the specified string and arguments at the minimal level.- Parameters:
message
- the messagearguments
- the arguments
-
logBasic
public void logBasic(String message)
Logs the specified string at the basic level.- Parameters:
message
- the message
-
logBasic
public void logBasic(String message, Object... arguments)
Logs the specified string and arguments at the basic level.- Parameters:
message
- the messagearguments
- the arguments
-
logDetailed
public void logDetailed(String message)
Logs the specified string at the detailed level.- Parameters:
message
- the message
-
logDetailed
public void logDetailed(String message, Object... arguments)
Logs the specified string and arguments at the detailed level.- Parameters:
message
- the messagearguments
- the arguments
-
logDebug
public void logDebug(String message)
Logs the specified string at the debug level.- Parameters:
message
- the message
-
logDebug
public void logDebug(String message, Object... arguments)
Logs the specified string and arguments at the debug level.- Parameters:
message
- the messagearguments
- the arguments
-
logRowlevel
public void logRowlevel(String message)
Logs the specified string at the row level.- Parameters:
message
- the message
-
logRowlevel
public void logRowlevel(String message, Object... arguments)
Logs the specified string and arguments at the row level.- Parameters:
message
- the messagearguments
- the arguments
-
logError
public void logError(String message)
Logs the specified string at the error level.- Parameters:
message
- the message
-
logError
public void logError(String message, Throwable e)
Logs the specified string and Throwable object at the error level.- Parameters:
message
- the messagee
- the e
-
logError
public void logError(String message, Object... arguments)
Logs the specified string and arguments at the error level.- Parameters:
message
- the messagearguments
- the arguments
-
getLogChannel
public org.pentaho.di.core.logging.LogChannelInterface getLogChannel()
Gets the log channel.- Returns:
- the log channel
-
getLogChannelId
public String getLogChannelId()
Gets the logging channel id- Specified by:
getLogChannelId
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the log channel id
- See Also:
LoggingObjectInterface.getLogChannelId()
-
getObjectName
public String getObjectName()
Gets the object name- Specified by:
getObjectName
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the object name
- See Also:
LoggingObjectInterface.getObjectName()
-
getObjectCopy
public String getObjectCopy()
Gets a string identifying a copy in a series of steps- Specified by:
getObjectCopy
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- a string identifying a copy in a series of steps
- See Also:
LoggingObjectInterface.getObjectCopy()
-
getObjectRevision
public org.pentaho.di.repository.ObjectRevision getObjectRevision()
Gets the revision of the object with respect to a repository- Specified by:
getObjectRevision
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- See Also:
LoggingObjectInterface.getObjectRevision()
-
getObjectType
public org.pentaho.di.core.logging.LoggingObjectType getObjectType()
Gets the logging object type- Specified by:
getObjectType
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the logging object type
- See Also:
LoggingObjectInterface.getObjectType()
-
getParent
public org.pentaho.di.core.logging.LoggingObjectInterface getParent()
Gets the logging object interface's parent- Specified by:
getParent
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the logging object interface's parent
- See Also:
LoggingObjectInterface.getParent()
-
getRepositoryDirectory
public org.pentaho.di.repository.RepositoryDirectory getRepositoryDirectory()
Gets the directory of the job entry in the repository. For JobEntryBase, this returns null- Specified by:
getRepositoryDirectory
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- null
- See Also:
LoggingObjectInterface.getRepositoryDirectory()
-
getLogLevel
public org.pentaho.di.core.logging.LogLevel getLogLevel()
Gets the logging level for the job entry- Specified by:
getLogLevel
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- See Also:
LoggingObjectInterface.getLogLevel()
-
setLogLevel
public void setLogLevel(org.pentaho.di.core.logging.LogLevel logLevel)
Sets the logging level for the job entry- Parameters:
logLevel
- the new log level
-
getContainerObjectId
public String getContainerObjectId()
Gets the container object id- Specified by:
getContainerObjectId
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- the container object id
-
setContainerObjectId
public void setContainerObjectId(String containerObjectId)
Sets the container object id- Parameters:
containerObjectId
- the container object id to set
-
getRegistrationDate
public Date getRegistrationDate()
Returns the registration date for the job entry. For JobEntryBase, this method always returns null- Specified by:
getRegistrationDate
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
- Returns:
- null
-
hasRepositoryReferences
public boolean hasRepositoryReferences()
Checks whether the job entry has repository references. For JobEntryBase, this method always returns false- Returns:
- false
-
lookupRepositoryReferences
public void lookupRepositoryReferences(Repository repository) throws org.pentaho.di.core.exception.KettleException
Looks up the references after import- Parameters:
repository
- the repository to reference.- Throws:
org.pentaho.di.core.exception.KettleException
- if any errors occur during the lookup
-
getReferencedObjectDescriptions
public String[] getReferencedObjectDescriptions()
- Returns:
- The objects referenced in the step, like a a transformation, a job, a mapper, a reducer, a combiner, ...
-
isReferencedObjectEnabled
public boolean[] isReferencedObjectEnabled()
- Returns:
- true for each referenced object that is enabled or has a valid reference definition.
-
loadReferencedObject
@Deprecated public Object loadReferencedObject(int index, Repository rep, org.pentaho.di.core.variables.VariableSpace space) throws org.pentaho.di.core.exception.KettleException
Deprecated.Load the referenced object- Parameters:
index
- the referenced object index to load (in case there are multiple references)rep
- the repositoryspace
- the variable space to use- Returns:
- the referenced object once loaded
- Throws:
org.pentaho.di.core.exception.KettleException
-
loadReferencedObject
public Object loadReferencedObject(int index, Repository rep, org.pentaho.metastore.api.IMetaStore metaStore, org.pentaho.di.core.variables.VariableSpace space) throws org.pentaho.di.core.exception.KettleException
Load the referenced object- Parameters:
index
- the referenced object index to load (in case there are multiple references)rep
- the repositorymetaStore
- the metaStore to load fromspace
- the variable space to use- Returns:
- the referenced object once loaded
- Throws:
org.pentaho.di.core.exception.KettleException
-
isGatheringMetrics
public boolean isGatheringMetrics()
- Specified by:
isGatheringMetrics
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
-
setGatheringMetrics
public void setGatheringMetrics(boolean gatheringMetrics)
- Specified by:
setGatheringMetrics
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
-
isForcingSeparateLogging
public boolean isForcingSeparateLogging()
- Specified by:
isForcingSeparateLogging
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
-
setForcingSeparateLogging
public void setForcingSeparateLogging(boolean forcingSeparateLogging)
- Specified by:
setForcingSeparateLogging
in interfaceorg.pentaho.di.core.logging.LoggingObjectInterface
-
getMetaStore
public org.pentaho.metastore.api.IMetaStore getMetaStore()
-
setMetaStore
public void setMetaStore(org.pentaho.metastore.api.IMetaStore metaStore)
-
setAttributesMap
public void setAttributesMap(Map<String,Map<String,String>> attributesMap)
- Specified by:
setAttributesMap
in interfaceorg.pentaho.di.core.AttributesInterface
-
getAttributesMap
public Map<String,Map<String,String>> getAttributesMap()
- Specified by:
getAttributesMap
in interfaceorg.pentaho.di.core.AttributesInterface
-
setAttribute
public void setAttribute(String groupName, String key, String value)
- Specified by:
setAttribute
in interfaceorg.pentaho.di.core.AttributesInterface
-
setAttributes
public void setAttributes(String groupName, Map<String,String> attributes)
- Specified by:
setAttributes
in interfaceorg.pentaho.di.core.AttributesInterface
-
getAttributes
public Map<String,String> getAttributes(String groupName)
- Specified by:
getAttributes
in interfaceorg.pentaho.di.core.AttributesInterface
-
getAttribute
public String getAttribute(String groupName, String key)
- Specified by:
getAttribute
in interfaceorg.pentaho.di.core.AttributesInterface
-
getExtensionDataMap
public Map<String,Object> getExtensionDataMap()
- Specified by:
getExtensionDataMap
in interfaceorg.pentaho.di.core.ExtensionDataInterface
-
getParentJobMeta
public JobMeta getParentJobMeta()
- Returns:
- The parent jobMeta at save and during execution.
-
setParentJobMeta
public void setParentJobMeta(JobMeta parentJobMeta)
At save and run time, the system will attempt to set the jobMeta so that it can be accessed by the jobEntries if necessary.- Parameters:
parentJobMeta
- the JobMeta to which this JobEntryInterface belongs
-
getEntryStepSetVariablesMap
protected Map<String,String> getEntryStepSetVariablesMap()
Gets a Map of variables set in EntryStepSetVariables- Returns:
- a map of variable names and values
-
setEntryStepSetVariable
public void setEntryStepSetVariable(String variableName, String variableValue)
Sets the value of the specified EntryStepSetVariable
-
getEntryStepSetVariable
public String getEntryStepSetVariable(String variableName)
Gets the value of the specified EntryStepSetVariable
-
addDatetimeToFilename
protected String addDatetimeToFilename(String filename, boolean addDate, String datePattern, boolean addTime, String timePattern, boolean specifyFormat, String datetimeFormat)
Appends the date, time and/or datetime to the given filename (before the extension if it exists), using the provided patterns.
- Parameters:
filename
- the original filename (can have path and variables)addDate
- if the date is to be addeddatePattern
- the pattern to be used for the dateaddTime
- if the time is to be addedtimePattern
- the pattern to be used for the timespecifyFormat
- if the datetime is to be addeddatetimeFormat
- the pattern to be used for the datetime- Returns:
- the resulting filename after adding the specified suffixes to the given filename
-
-