Package org.seed.core.api
Interface JobContext
- All Superinterfaces:
CallbackFunctionContext
,FunctionContext
A
JobContext
is the context in which a Job
is executed.- Author:
- seed-master
-
Method Summary
Modifier and TypeMethodDescriptiongetJobParameter
(String name) Returns the job parameter with the given namegetJobParameter
(String name, String defaultValue) Returns the job parameter with the given name or a default value if the parameter doesn't existgetJobParameterAsInt
(String name) Returns the job parameter with the given name asInteger
getJobParameterAsInt
(String name, Integer defaultValue) Returns the job parameter with the given name asInteger
or a default value if the parameter doesn't existboolean
hasJobParameter
(String name) Checks if there is a job parameter with the given namevoid
Writes a message (info) to the job run logvoid
Writes an error message to the job run logvoid
Writes an info message to the job run logvoid
Writes an warning message to the job run logMethods inherited from interface org.seed.core.api.CallbackFunctionContext
getClientProvider, getDataSourceProvider, getEventType, getMailProvider, getObjectProvider, getParameterProvider, getRestProvider, getSourceStatus, getStoredProcedureProvider, getTargetStatus
Methods inherited from interface org.seed.core.api.FunctionContext
getProperty, getSuccessMessage, hasProperty, setProperty, setSuccessMessage
-
Method Details
-
hasJobParameter
Checks if there is a job parameter with the given name- Parameters:
name
- the name of the job parameter- Returns:
true
if there is a parameter with the given name
-
getJobParameter
Returns the job parameter with the given name- Parameters:
name
- the name of the job parameter- Returns:
- the value of the parameter or
null
if the parameter doesn't exist
-
getJobParameterAsInt
Returns the job parameter with the given name asInteger
- Parameters:
name
- the name of the job parameter- Returns:
- the value of the parameter as
Integer
ornull
if the parameter doesn't exist - Throws:
IllegalStateException
- if the parameter is not an integer value
-
getJobParameter
Returns the job parameter with the given name or a default value if the parameter doesn't exist- Parameters:
name
- the name of the job parameterdefaultValue
- the default value that is used if the parameter doesn't exist- Returns:
- the value of the parameter or the default value if the parameter doesn't exist
-
getJobParameterAsInt
Returns the job parameter with the given name asInteger
or a default value if the parameter doesn't exist- Parameters:
name
- the name of the job parameterdefaultValue
- the default value that is used if the parameter doesn't exist- Returns:
- the value of the parameter as
Integer
or the default value if the parameter doesn't exist - Throws:
IllegalStateException
- if the parameter is not an integer value
-
log
Writes a message (info) to the job run log- Parameters:
message
- the message to write to the job run log
-
logInfo
Writes an info message to the job run log- Parameters:
message
- the message to write to the job run log
-
logWarn
Writes an warning message to the job run log- Parameters:
message
- the message to write to the job run log
-
logError
Writes an error message to the job run log- Parameters:
message
- the message to write to the job run log
-