Class BTMeterInsert
java.lang.Object
overit.geocall.bl.BusinessTask<MeterInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<MeterInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<MeterInsertEvent>
overit.geocallapp.wfm.accounts.bl.meter.task.BTMeterInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(MeterInsertEvent.class)
public class BTMeterInsert
extends ValidPermissionBusinessTask<MeterInsertEvent>
Business task in order to insert a
When the
Permission: Error Code:
BOMeter. When the
MeterInsertEvent is launched
the BT notices the call and inserts the BOMeter basing on the event's input. Permission: Error Code:
- Since:
- 16.0
- See Also:
- GCApi:
- task
-
Field Summary
Fields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexecute(MeterInsertEvent event, PoolKit poolKit) Inserts the givenBOMeterand writes the newly generated id into the event journal..protected LonggetNextMeterIndex(Long address, PoolKit poolKit) Calculates the next available meter index for a given address.booleanDetermines whether the current state is valid for execution.protected voidValidates the input before the insertion.protected voidvalidateModel(BOMeter meter) 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
-
Constructor Details
-
BTMeterInsert
public BTMeterInsert()
-
-
Method Details
-
execute
protected void execute(MeterInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Inserts the givenBOMeterand writes the newly generated id into the event journal..- Specified by:
executein classValidExecutionBusinessTask<MeterInsertEvent>- Parameters:
event- theMeterInsertEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validate
Validates the input before the insertion.- Parameters:
meter- the currentBOMeterpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getNextMeterIndex
protected Long getNextMeterIndex(Long address, PoolKit poolKit) throws DAException, DAValidateException Calculates the next available meter index for a given address. This method searches for all meters associated with the specified address, finds the maximum index value among them, and returns the next available index (maximum + 1). If no meters exist or none have an index, returns 1.- Parameters:
address- the address ID to search meters forpoolKit- the PoolKit for database operations- Returns:
- the next available meter index (max existing index + 1)
- Throws:
DAException- if a data access error occursDAValidateException- if validation fails
-
validateModel
- Throws:
DAValidateException
-
isValidExecution
public boolean isValidExecution()Description copied from interface:ValidExecutionDetermines whether the current state is valid for execution.- Returns:
- true if execution is valid, false otherwise
-