Package com.veeva.vault.sdk.api.job
Interface JobContext
- All Known Subinterfaces:
JobCompletionContext,JobInitContext,JobProcessContext
public interface JobContext
Contains contextual information about the current job.
Parent of JobInitContext, JobProcessContext and JobCompleteContext that can be passed to a
Job.
-
Method Summary
Modifier and TypeMethodDescriptiongetJobId()Retrieves the ID tracking this job.<T> TgetJobInitParameter(String name, JobValueType<T> valueType) Retrieves job parameters set byJobInitContext.setJobInitParameter(String, Object).<T extends JobValue>
TgetJobInitParameter(String name, Class<T> returnType) Retrieves job parameters that are set onJob.init(JobInitContext).Retrieves the job logger, used to log messages into the job log file.Retrieves the name of the job.Retrieves theJobOwnerof the job.<T> TgetJobParameter(String name, JobParamValueType<T> valueType) Retrieves job parameters set onJobParameterswhen invoking a job throughJobService.<T extends JobParamValue>
TgetJobParameter(String name, Class<T> returnType) Retrieves job parameters set onJobParameterswhen invoking a job throughJobService.
-
Method Details
-
getJobId
String getJobId()Retrieves the ID tracking this job.- Returns:
- the job ID, as a String
-
getJobLogger
JobLogger getJobLogger()Retrieves the job logger, used to log messages into the job log file.- Returns:
- JobLogger object
-
getJobParameter
Retrieves job parameters set onJobParameterswhen invoking a job throughJobService.- Type Parameters:
T- type of object requested. Cannot be null.- Parameters:
name- the parameter name used when setting a job parameter. Cannot be null.valueType- The type of value returned from the job parameters. Cannot be null.- Returns:
- the parameter value
-
getJobParameter
Retrieves job parameters set onJobParameterswhen invoking a job throughJobService.- Type Parameters:
T- type of object requested. Cannot be null.- Parameters:
name- the parameter name used when setting a job parameter. Cannot be null.returnType- type of object requested. Cannot be null.- Returns:
- the parameter value
-
getJobInitParameter
Retrieves job parameters set byJobInitContext.setJobInitParameter(String, Object).- Type Parameters:
T- type of object requested. Cannot be null.- Parameters:
name- the parameter name used when setting the param in Job#init. Cannot be null.valueType- the type of value returned from the job parameters. Cannot be null.- Returns:
- the object identified by the given name, or null if there was no value for the given name
-
getJobInitParameter
Retrieves job parameters that are set onJob.init(JobInitContext).- Type Parameters:
T- type of object requested. Cannot be null.- Parameters:
name- the parameter name used when setting the param in Job#init. Cannot be null.returnType- type of object requested. Cannot be null.- Returns:
- the object identified by the given name, or null if there was no value for the given name
-
getJobName
String getJobName()Retrieves the name of the job. If the job is an async job, this will return null.- Returns:
- Job name
-
getJobOwner
JobOwner getJobOwner()Retrieves theJobOwnerof the job.- Returns:
- JobOwner instance containing the owner's ID and type
-