Class BTAssetContactInsert
java.lang.Object
overit.geocall.bl.BusinessTask<AssetContactInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<AssetContactInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<AssetContactInsertEvent>
overit.geocallapp.wfm.assets.bl.contact.task.BTAssetContactInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(AssetContactInsertEvent.class)
public class BTAssetContactInsert
extends ValidPermissionBusinessTask<AssetContactInsertEvent>
Business task in order to insert a
BOAssetContact. Required fields:
- address
- type
Permission:
Error code:
- Since:
- 17.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 LongPerforms the needed operation by calling theBTAssetContactHistory.protected voidexecute(AssetContactInsertEvent event, PoolKit poolKit) Inserts the givenBOAssetContactand writes the newly generated id into the event journal.protected Longinsert(BOAssetContact contact, PoolKit poolKit) Performs the insertion of the givenBOAssetContact.booleanDetermines whether the current state is valid for execution.protected BOAssetContactloadExistingContact(BOAssetContact contact, PoolKit poolKit) Loads the existing contact with the not valid contact values.protected Longupdate(BOAssetContact contact, BOAssetContact existingContact, PoolKit poolKit) Performs the update of the givenBOAssetContact.protected voidvalidate(BOAssetContact contact, PoolKit poolKit) Validates the data before the insertion.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
-
BTAssetContactInsert
public BTAssetContactInsert()
-
-
Method Details
-
execute
protected void execute(AssetContactInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Inserts the givenBOAssetContactand writes the newly generated id into the event journal. If theBOAssetContactwas already inserted without a proper contact value, it updates theBOAssetContactwith the input values.- Specified by:
executein classValidExecutionBusinessTask<AssetContactInsertEvent>- Parameters:
event- theAssetContactInsertEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validate
protected void validate(BOAssetContact contact, PoolKit poolKit) throws DAValidateException, DAException Validates the data before the insertion.- Parameters:
contact- theBOAssetContactcontaining the new valuespoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadExistingContact
protected BOAssetContact loadExistingContact(BOAssetContact contact, PoolKit poolKit) throws DAValidateException, DAException Loads the existing contact with the not valid contact values. If there is already a contact of this type and with this address, that has a valid contact value, an error is thrown.- Parameters:
contact- theBOAssetContactcontaining the update datapoolKit- thePoolKit- Returns:
- the already existing
BOAssetContact - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insert
protected Long insert(BOAssetContact contact, PoolKit poolKit) throws DAException, DAValidateException Performs the insertion of the givenBOAssetContact.- Parameters:
contact- theBOAssetContactto insertpoolKit- thePoolKit- Returns:
- the
BOAssetContactid - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
update
protected Long update(BOAssetContact contact, BOAssetContact existingContact, PoolKit poolKit) throws DAException, DAValidateException Performs the update of the givenBOAssetContact.- Parameters:
contact- theBOAssetContactcontaining the update valuespoolKit- thePoolKit- Returns:
- the
BOAssetContactid - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
doOperation
protected Long doOperation(Command command, Map<String, Object> data, PoolKit poolKit) throws DAException, DAValidateExceptionPerforms the needed operation by calling theBTAssetContactHistory.- Parameters:
command- the commanddata- the datapoolKit- thePoolKit- Returns:
- the
BOAssetContactid - 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.- Returns:
- true if execution is valid, false otherwise
-