Class BTResourceLastGPSPositionBatchUpsert
java.lang.Object
overit.geocall.bl.BusinessTask<ResourceLastGPSPositionBatchUpsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<ResourceLastGPSPositionBatchUpsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<ResourceLastGPSPositionBatchUpsertEvent>
overit.geocallapp.wfm.gpstracking.bl.resource.position.last.task.BTResourceLastGPSPositionBatchUpsert
- All Implemented Interfaces:
Serializable,Interruptable,Tool,ValidExecution
@Event(ResourceLastGPSPositionBatchUpsertEvent.class)
public class BTResourceLastGPSPositionBatchUpsert
extends ValidPermissionBusinessTask<ResourceLastGPSPositionBatchUpsertEvent>
implements Interruptable
Business task to perform batch upsert of
BOResourceLastGPSPosition.
The task listens to the ResourceLastGPSPositionBatchUpsertEvent and performs the following operations:
- Retrieves the set of resource IDs for the existing positions
- Splits the input into new and existing records
- Executes batch insert for new records
- Executes batch update for existing records
- Since:
- 22.0
- See Also:
- GCApi:
- task
-
Field Summary
FieldsFields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbatchInsert(List<BOResourceLastGPSPosition> positions, PoolKit poolKit) Performs batch insert of new positions.protected voidbatchUpdate(List<BOResourceLastGPSPosition> positions, PoolKit poolKit) Performs batch update of existing positions.protected voidexecute(ResourceLastGPSPositionBatchUpsertEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.booleanDetermines whether the current state is valid for execution.voidsearchExistingResourcePositionResources(List<BOResourceLastGPSPosition> positions, PoolKit poolKit) Retrieves the set of resource IDs for the existing positions.Methods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
checkValidExecution, getException, throwExceptionIfInvalidMethods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask
body, getEventMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Field Details
-
interrupt
protected boolean interrupt
-
-
Constructor Details
-
BTResourceLastGPSPositionBatchUpsert
public BTResourceLastGPSPositionBatchUpsert()
-
-
Method Details
-
execute
protected void execute(ResourceLastGPSPositionBatchUpsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<ResourceLastGPSPositionBatchUpsertEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
searchExistingResourcePositionResources
protected Set<Long> searchExistingResourcePositionResources(List<BOResourceLastGPSPosition> positions, PoolKit poolKit) throws DAException, DAValidateException Retrieves the set of resource IDs for the existing positions.- Parameters:
positions- the list ofBOResourceLastGPSPositionpoolKit- thePoolKit- Returns:
- the set of resource IDs of the existing positions
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
batchInsert
protected void batchInsert(List<BOResourceLastGPSPosition> positions, PoolKit poolKit) throws DAException, DAValidateException Performs batch insert of new positions.- Parameters:
positions- the list ofBOResourceLastGPSPositionto insertpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
batchUpdate
protected void batchUpdate(List<BOResourceLastGPSPosition> positions, PoolKit poolKit) throws DAException, DAValidateException Performs batch update of existing positions.- Parameters:
positions- the list ofBOResourceLastGPSPositionto updatepoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
isValidExecution
public boolean isValidExecution()Description copied from interface:ValidExecutionDetermines whether the current state is valid for execution.- Specified by:
isValidExecutionin interfaceValidExecution- Returns:
- true if execution is valid, false otherwise
-
pleaseInterrupt
public void pleaseInterrupt()- Specified by:
pleaseInterruptin interfaceInterruptable
-