Class BTResourceUpdate
java.lang.Object
overit.geocall.bl.BusinessTask<ResourceUpdateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<ResourceUpdateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<ResourceUpdateEvent>
overit.geocallapp.wfm.resources.bl.resource.task.BTResourceUpdate
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(ResourceUpdateEvent.class)
public class BTResourceUpdate
extends ValidPermissionBusinessTask<ResourceUpdateEvent>
Business task in order to update a
BOResource.
When the ResourceUpdateEvent is launched the BT notices the call and
updates the BOResource basing on the event's input.
Required fields:
- resource id
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 voidcompleteResourceData(BOResource resource) Complete the resource's data with the required properties.protected voidexecute(ResourceUpdateEvent event, PoolKit pk) Updates aBOResourcewith all its needed components.Returns the list containing the names of the fields that cannot be updated.booleanDetermines whether the current state is valid for execution.protected List<BOResource> loadConflictingResources(BOResource resource, PoolKit pk) Loads the list of other resources with the same identification number.protected voidnotifyUpdate(BOResource resource, PoolKit poolKit) Notifies the update of the given resource.protected voidvalidate(BOResource resource, PoolKit pk) Validates the data before the update.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
-
BTResourceUpdate
public BTResourceUpdate()
-
-
Method Details
-
execute
protected void execute(ResourceUpdateEvent event, PoolKit pk) throws DAException, DAValidateException Updates aBOResourcewith all its needed components.- Specified by:
executein classValidExecutionBusinessTask<ResourceUpdateEvent>- Parameters:
event- theResourceUpdateEventpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
completeResourceData
Complete the resource's data with the required properties.- Parameters:
resource- the current resource
-
validate
Validates the data before the update.- Parameters:
resource- the current resourcepk- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadConflictingResources
protected List<BOResource> loadConflictingResources(BOResource resource, PoolKit pk) throws DAValidateException, DAException Loads the list of other resources with the same identification number. Only non-loan resources are searched because loan resources legitimately share the same identification number with their source resource.- Parameters:
resource- the current resourcepk- thePoolKit- Returns:
- the list of conflicting resources
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA 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
-
getNotUpdatableFields
Returns the list containing the names of the fields that cannot be updated.- Returns:
- the list of fields that cannot be updated
-
notifyUpdate
protected void notifyUpdate(BOResource resource, PoolKit poolKit) throws DAValidateException, DAException Notifies the update of the given resource.- Parameters:
resource- the updatedBOResourcepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-