org.camunda.bpm.engine.impl.migration.batch
Class MigrationBatchJobHandler

java.lang.Object
  extended by org.camunda.bpm.engine.impl.migration.batch.MigrationBatchJobHandler
All Implemented Interfaces:
BatchJobHandler<MigrationBatchConfiguration>, JobHandler<BatchJobConfiguration>

public class MigrationBatchJobHandler
extends Object
implements BatchJobHandler<MigrationBatchConfiguration>

Job handler for batch migration jobs. The batch migration job migrates a list of process instances.


Field Summary
static MigrationBatchJobDeclaration JOB_DECLARATION
           
 
Constructor Summary
MigrationBatchJobHandler()
           
 
Method Summary
protected  JobEntity createBatchJob(JobDefinitionEntity jobDefinition, ByteArrayEntity configurationEntity)
           
protected  MigrationBatchConfiguration createConfigurationForIds(MigrationPlan migrationPlan, List<String> idsForJob)
           
 boolean createJobs(BatchEntity batch)
          Creates batch jobs for a batch.
 void deleteJobs(BatchEntity batch)
          Delete all jobs for a batch.
 void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId)
           
 JobDeclaration<?,MessageEntity> getJobDeclaration()
          Get the job declaration for batch jobs.
 String getType()
           
 BatchJobConfiguration newConfiguration(String canonicalString)
           
 MigrationBatchConfiguration readConfiguration(byte[] serializedConfiguration)
          Read the serialized configuration of the batch.
protected  ByteArrayEntity saveConfiguration(ByteArrayManager byteArrayManager, MigrationBatchConfiguration jobConfiguration)
           
 byte[] writeConfiguration(MigrationBatchConfiguration configuration)
          Converts the configuration of the batch to a byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JOB_DECLARATION

public static final MigrationBatchJobDeclaration JOB_DECLARATION
Constructor Detail

MigrationBatchJobHandler

public MigrationBatchJobHandler()
Method Detail

getType

public String getType()
Specified by:
getType in interface JobHandler<BatchJobConfiguration>

getJobDeclaration

public JobDeclaration<?,MessageEntity> getJobDeclaration()
Description copied from interface: BatchJobHandler
Get the job declaration for batch jobs.

Specified by:
getJobDeclaration in interface BatchJobHandler<MigrationBatchConfiguration>
Returns:
the batch job declaration

writeConfiguration

public byte[] writeConfiguration(MigrationBatchConfiguration configuration)
Description copied from interface: BatchJobHandler
Converts the configuration of the batch to a byte array.

Specified by:
writeConfiguration in interface BatchJobHandler<MigrationBatchConfiguration>
Parameters:
configuration - the configuration object
Returns:
the serialized configuration

readConfiguration

public MigrationBatchConfiguration readConfiguration(byte[] serializedConfiguration)
Description copied from interface: BatchJobHandler
Read the serialized configuration of the batch.

Specified by:
readConfiguration in interface BatchJobHandler<MigrationBatchConfiguration>
Parameters:
serializedConfiguration - the serialized configuration
Returns:
the deserialized configuration object

createJobs

public boolean createJobs(BatchEntity batch)
Description copied from interface: BatchJobHandler
Creates batch jobs for a batch.

Specified by:
createJobs in interface BatchJobHandler<MigrationBatchConfiguration>
Parameters:
batch - the batch to create jobs for
Returns:
true of no more jobs have to be created for this batch, false otherwise

createConfigurationForIds

protected MigrationBatchConfiguration createConfigurationForIds(MigrationPlan migrationPlan,
                                                                List<String> idsForJob)

saveConfiguration

protected ByteArrayEntity saveConfiguration(ByteArrayManager byteArrayManager,
                                            MigrationBatchConfiguration jobConfiguration)

createBatchJob

protected JobEntity createBatchJob(JobDefinitionEntity jobDefinition,
                                   ByteArrayEntity configurationEntity)

deleteJobs

public void deleteJobs(BatchEntity batch)
Description copied from interface: BatchJobHandler
Delete all jobs for a batch.

Specified by:
deleteJobs in interface BatchJobHandler<MigrationBatchConfiguration>
Parameters:
batch - the batch to delete jobs for

execute

public void execute(BatchJobConfiguration configuration,
                    ExecutionEntity execution,
                    CommandContext commandContext,
                    String tenantId)
Specified by:
execute in interface JobHandler<BatchJobConfiguration>

newConfiguration

public BatchJobConfiguration newConfiguration(String canonicalString)
Specified by:
newConfiguration in interface JobHandler<BatchJobConfiguration>


Copyright © 2016 camunda services GmbH. All rights reserved.