public abstract class AbstractBatchJobHandler<T extends BatchConfiguration> extends Object implements BatchJobHandler<T>
Constructor and Description |
---|
AbstractBatchJobHandler() |
Modifier and Type | Method and Description |
---|---|
protected JobEntity |
createBatchJob(BatchEntity batch,
ByteArrayEntity configuration) |
protected abstract T |
createJobConfiguration(T configuration,
List<String> processIdsForJob) |
boolean |
createJobs(BatchEntity batch)
Creates batch jobs for a batch.
|
void |
deleteJobs(BatchEntity batch)
Delete all jobs for a batch.
|
abstract JobDeclaration<BatchJobContext,MessageEntity> |
getJobDeclaration()
Get the job declaration for batch jobs.
|
protected abstract JsonObjectConverter<T> |
getJsonConverterInstance() |
BatchJobConfiguration |
newConfiguration(String canonicalString) |
void |
onDelete(BatchJobConfiguration configuration,
JobEntity jobEntity)
Clean up before job is deleted.
|
protected void |
postProcessJob(T configuration,
JobEntity job) |
T |
readConfiguration(byte[] serializedConfiguration)
Read the serialized configuration of the batch.
|
protected ByteArrayEntity |
saveConfiguration(ByteArrayManager byteArrayManager,
T jobConfiguration) |
byte[] |
writeConfiguration(T configuration)
Converts the configuration of the batch to a byte array.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute, getType
public abstract JobDeclaration<BatchJobContext,MessageEntity> getJobDeclaration()
BatchJobHandler
getJobDeclaration
in interface BatchJobHandler<T extends BatchConfiguration>
public boolean createJobs(BatchEntity batch)
BatchJobHandler
createJobs
in interface BatchJobHandler<T extends BatchConfiguration>
batch
- the batch to create jobs forprotected abstract T createJobConfiguration(T configuration, List<String> processIdsForJob)
protected JobEntity createBatchJob(BatchEntity batch, ByteArrayEntity configuration)
public void deleteJobs(BatchEntity batch)
BatchJobHandler
deleteJobs
in interface BatchJobHandler<T extends BatchConfiguration>
batch
- the batch to delete jobs forpublic BatchJobConfiguration newConfiguration(String canonicalString)
newConfiguration
in interface JobHandler<BatchJobConfiguration>
public void onDelete(BatchJobConfiguration configuration, JobEntity jobEntity)
JobHandler
onDelete
in interface JobHandler<BatchJobConfiguration>
configuration
- the job handler configurationjobEntity
- the job entity to be deletedprotected ByteArrayEntity saveConfiguration(ByteArrayManager byteArrayManager, T jobConfiguration)
public byte[] writeConfiguration(T configuration)
BatchJobHandler
writeConfiguration
in interface BatchJobHandler<T extends BatchConfiguration>
configuration
- the configuration objectpublic T readConfiguration(byte[] serializedConfiguration)
BatchJobHandler
readConfiguration
in interface BatchJobHandler<T extends BatchConfiguration>
serializedConfiguration
- the serialized configurationprotected abstract JsonObjectConverter<T> getJsonConverterInstance()
Copyright © 2020. All rights reserved.