Class JPAPersistenceManagerService
- java.lang.Object
-
- org.apache.batchee.container.services.persistence.JPAPersistenceManagerService
-
- All Implemented Interfaces:
BatchService
,PersistenceManagerService
public class JPAPersistenceManagerService extends Object implements PersistenceManagerService
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.batchee.spi.PersistenceManagerService
PersistenceManagerService.TimestampType
-
-
Constructor Summary
Constructors Constructor Description JPAPersistenceManagerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp(long instanceId)
void
cleanUp(Date until)
RuntimeFlowInSplitExecution
createFlowInSplitExecution(javax.batch.runtime.JobInstance jobInstance, javax.batch.runtime.BatchStatus batchStatus)
RuntimeJobExecution
createJobExecution(javax.batch.runtime.JobInstance jobInstance, Properties jobParameters, javax.batch.runtime.BatchStatus batchStatus)
Create a JobExecutionjavax.batch.runtime.JobInstance
createJobInstance(String name, String jobXml)
Creates a JobIntanceJobStatus
createJobStatus(long jobInstanceId)
Create a JobStatusStepExecutionImpl
createStepExecution(long jobExecId, StepContextImpl stepContext)
Create a StepExecutionStepStatus
createStepStatus(long stepExecId)
Create a StepStatusjavax.batch.runtime.JobInstance
createSubJobInstance(String name)
CheckpointData
getCheckpointData(CheckpointDataKey key)
long
getJobInstanceIdByExecutionId(long executionId)
Set<String>
getJobNames()
JobStatus
getJobStatus(long instanceId)
Get a JobStatusJobStatus
getJobStatusFromExecution(long executionId)
long
getMostRecentExecutionId(long jobInstanceId)
Properties
getParameters(long executionId)
javax.batch.runtime.StepExecution
getStepExecutionByStepExecutionId(long stepExecId)
List<javax.batch.runtime.StepExecution>
getStepExecutionsForJobExecution(long execid)
StepStatus
getStepStatus(long instanceId, String stepName)
Get a StepStatusvoid
init(Properties batchConfig)
InternalJobExecution
jobOperatorGetJobExecution(long jobExecutionId)
List<InternalJobExecution>
jobOperatorGetJobExecutions(long jobInstanceId)
int
jobOperatorGetJobInstanceCount(String jobName)
JOB OPERATOR ONLY METHODSList<Long>
jobOperatorGetJobInstanceIds(String jobName, int start, int count)
Set<Long>
jobOperatorGetRunningExecutions(String jobName)
String
jobOperatorQueryJobExecutionBatchStatus(long key)
String
jobOperatorQueryJobExecutionExitStatus(long key)
Timestamp
jobOperatorQueryJobExecutionTimestamp(long key, PersistenceManagerService.TimestampType timetype)
void
markJobStarted(long key, Timestamp startTS)
void
setCheckpointData(CheckpointDataKey key, CheckpointData value)
void
updateBatchStatusOnly(long executionId, javax.batch.runtime.BatchStatus batchStatus, Timestamp timestamp)
void
updateJobStatus(long instanceId, JobStatus jobStatus)
Update a JobStatusvoid
updateStepExecution(long jobExecId, StepContextImpl stepContext)
Update a StepExecutionvoid
updateStepStatus(long stepExecutionId, StepStatus stepStatus)
Update a StepStatusvoid
updateWithFinalExecutionStatusesAndTimestamps(long key, javax.batch.runtime.BatchStatus batchStatus, String exitStatus, Timestamp updatets)
-
-
-
Method Detail
-
cleanUp
public void cleanUp(long instanceId)
- Specified by:
cleanUp
in interfacePersistenceManagerService
-
cleanUp
public void cleanUp(Date until)
- Specified by:
cleanUp
in interfacePersistenceManagerService
-
getStepStatus
public StepStatus getStepStatus(long instanceId, String stepName)
Description copied from interface:PersistenceManagerService
Get a StepStatusThe parent job instance id and this step name from the job xml are used to determine if the current step execution have previously run.
- Specified by:
getStepStatus
in interfacePersistenceManagerService
- Parameters:
instanceId
- the parent job instance idstepName
- the step name- Returns:
- the StepStatus
-
getJobNames
public Set<String> getJobNames()
- Specified by:
getJobNames
in interfacePersistenceManagerService
-
getJobStatusFromExecution
public JobStatus getJobStatusFromExecution(long executionId)
- Specified by:
getJobStatusFromExecution
in interfacePersistenceManagerService
-
getStepExecutionByStepExecutionId
public javax.batch.runtime.StepExecution getStepExecutionByStepExecutionId(long stepExecId)
- Specified by:
getStepExecutionByStepExecutionId
in interfacePersistenceManagerService
-
getStepExecutionsForJobExecution
public List<javax.batch.runtime.StepExecution> getStepExecutionsForJobExecution(long execid)
- Specified by:
getStepExecutionsForJobExecution
in interfacePersistenceManagerService
-
updateStepExecution
public void updateStepExecution(long jobExecId, StepContextImpl stepContext)
Description copied from interface:PersistenceManagerService
Update a StepExecution- Specified by:
updateStepExecution
in interfacePersistenceManagerService
- Parameters:
jobExecId
- the parent JobExecution idstepContext
- the step context for this step execution
-
createStepExecution
public StepExecutionImpl createStepExecution(long jobExecId, StepContextImpl stepContext)
Description copied from interface:PersistenceManagerService
Create a StepExecution- Specified by:
createStepExecution
in interfacePersistenceManagerService
- Parameters:
jobExecId
- the parent JobExecution idstepContext
- the step context for this step execution- Returns:
- the StepExecution
-
getJobInstanceIdByExecutionId
public long getJobInstanceIdByExecutionId(long executionId) throws javax.batch.operations.NoSuchJobExecutionException
- Specified by:
getJobInstanceIdByExecutionId
in interfacePersistenceManagerService
- Throws:
javax.batch.operations.NoSuchJobExecutionException
-
jobOperatorGetRunningExecutions
public Set<Long> jobOperatorGetRunningExecutions(String jobName)
- Specified by:
jobOperatorGetRunningExecutions
in interfacePersistenceManagerService
-
jobOperatorGetJobExecutions
public List<InternalJobExecution> jobOperatorGetJobExecutions(long jobInstanceId)
- Specified by:
jobOperatorGetJobExecutions
in interfacePersistenceManagerService
-
updateWithFinalExecutionStatusesAndTimestamps
public void updateWithFinalExecutionStatusesAndTimestamps(long key, javax.batch.runtime.BatchStatus batchStatus, String exitStatus, Timestamp updatets)
- Specified by:
updateWithFinalExecutionStatusesAndTimestamps
in interfacePersistenceManagerService
-
jobOperatorGetJobExecution
public InternalJobExecution jobOperatorGetJobExecution(long jobExecutionId)
- Specified by:
jobOperatorGetJobExecution
in interfacePersistenceManagerService
-
markJobStarted
public void markJobStarted(long key, Timestamp startTS)
- Specified by:
markJobStarted
in interfacePersistenceManagerService
-
getParameters
public Properties getParameters(long executionId) throws javax.batch.operations.NoSuchJobExecutionException
- Specified by:
getParameters
in interfacePersistenceManagerService
- Throws:
javax.batch.operations.NoSuchJobExecutionException
-
jobOperatorQueryJobExecutionExitStatus
public String jobOperatorQueryJobExecutionExitStatus(long key)
- Specified by:
jobOperatorQueryJobExecutionExitStatus
in interfacePersistenceManagerService
-
jobOperatorQueryJobExecutionBatchStatus
public String jobOperatorQueryJobExecutionBatchStatus(long key)
- Specified by:
jobOperatorQueryJobExecutionBatchStatus
in interfacePersistenceManagerService
-
jobOperatorQueryJobExecutionTimestamp
public Timestamp jobOperatorQueryJobExecutionTimestamp(long key, PersistenceManagerService.TimestampType timetype)
- Specified by:
jobOperatorQueryJobExecutionTimestamp
in interfacePersistenceManagerService
-
createFlowInSplitExecution
public RuntimeFlowInSplitExecution createFlowInSplitExecution(javax.batch.runtime.JobInstance jobInstance, javax.batch.runtime.BatchStatus batchStatus)
- Specified by:
createFlowInSplitExecution
in interfacePersistenceManagerService
-
getMostRecentExecutionId
public long getMostRecentExecutionId(long jobInstanceId)
- Specified by:
getMostRecentExecutionId
in interfacePersistenceManagerService
-
updateBatchStatusOnly
public void updateBatchStatusOnly(long executionId, javax.batch.runtime.BatchStatus batchStatus, Timestamp timestamp)
- Specified by:
updateBatchStatusOnly
in interfacePersistenceManagerService
-
createJobExecution
public RuntimeJobExecution createJobExecution(javax.batch.runtime.JobInstance jobInstance, Properties jobParameters, javax.batch.runtime.BatchStatus batchStatus)
Description copied from interface:PersistenceManagerService
Create a JobExecution- Specified by:
createJobExecution
in interfacePersistenceManagerService
- Parameters:
jobInstance
- the parent job instancejobParameters
- the parent job instance parametersbatchStatus
- the current BatchStatus- Returns:
- the RuntimeJobExecution class for this JobExecution
-
createSubJobInstance
public javax.batch.runtime.JobInstance createSubJobInstance(String name)
- Specified by:
createSubJobInstance
in interfacePersistenceManagerService
-
jobOperatorGetJobInstanceIds
public List<Long> jobOperatorGetJobInstanceIds(String jobName, int start, int count)
- Specified by:
jobOperatorGetJobInstanceIds
in interfacePersistenceManagerService
-
createJobInstance
public javax.batch.runtime.JobInstance createJobInstance(String name, String jobXml)
Description copied from interface:PersistenceManagerService
Creates a JobIntance- Specified by:
createJobInstance
in interfacePersistenceManagerService
- Parameters:
name
- the job id from job.xmljobXml
- the resolved job xml- Returns:
- the job instance
-
jobOperatorGetJobInstanceCount
public int jobOperatorGetJobInstanceCount(String jobName)
Description copied from interface:PersistenceManagerService
JOB OPERATOR ONLY METHODS- Specified by:
jobOperatorGetJobInstanceCount
in interfacePersistenceManagerService
-
updateStepStatus
public void updateStepStatus(long stepExecutionId, StepStatus stepStatus)
Description copied from interface:PersistenceManagerService
Update a StepStatus- Specified by:
updateStepStatus
in interfacePersistenceManagerService
- Parameters:
stepExecutionId
- the parent step execution idstepStatus
- the step status to be updated
-
createStepStatus
public StepStatus createStepStatus(long stepExecId)
Description copied from interface:PersistenceManagerService
Create a StepStatus- Specified by:
createStepStatus
in interfacePersistenceManagerService
- Parameters:
stepExecId
- the parent step execution id- Returns:
- the StepStatus
-
updateJobStatus
public void updateJobStatus(long instanceId, JobStatus jobStatus)
Description copied from interface:PersistenceManagerService
Update a JobStatus- Specified by:
updateJobStatus
in interfacePersistenceManagerService
- Parameters:
instanceId
- the parent job instance idjobStatus
- the job status to be updated
-
getJobStatus
public JobStatus getJobStatus(long instanceId)
Description copied from interface:PersistenceManagerService
Get a JobStatus- Specified by:
getJobStatus
in interfacePersistenceManagerService
- Parameters:
instanceId
- the parent job instance id- Returns:
- the JobStatus
-
createJobStatus
public JobStatus createJobStatus(long jobInstanceId)
Description copied from interface:PersistenceManagerService
Create a JobStatus- Specified by:
createJobStatus
in interfacePersistenceManagerService
- Parameters:
jobInstanceId
- the parent job instance id- Returns:
- the JobStatus
-
setCheckpointData
public void setCheckpointData(CheckpointDataKey key, CheckpointData value)
- Specified by:
setCheckpointData
in interfacePersistenceManagerService
-
getCheckpointData
public CheckpointData getCheckpointData(CheckpointDataKey key)
- Specified by:
getCheckpointData
in interfacePersistenceManagerService
-
init
public void init(Properties batchConfig)
- Specified by:
init
in interfaceBatchService
-
-