Class BTTransferRequestPushNotificationsDispatch
java.lang.Object
overit.geocall.bl.BusinessTask<TransferRequestHeaderStateChangeEvent>
overit.geocallapp.wfm.inventory.bl.warehouse.transfer.request.notification.task.BTTransferRequestPushNotificationsDispatch
- All Implemented Interfaces:
Serializable,Tool
@Event(TransferRequestHeaderStateChangeEvent.class)
public class BTTransferRequestPushNotificationsDispatch
extends BusinessTask<TransferRequestHeaderStateChangeEvent>
Business task in order create and dispatch all the
When the
PushNotifications
related to the TransferRequests that recently changed their state. When the
TransferRequestHeaderStateChangeEvent is launched the BT notices the call and proceeds creating and dispatching
the PushNotifications basing on the event's input. - Since:
- 14.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbody(TransferRequestHeaderStateChangeEvent event, PoolKit poolKit) Creates thePushNotifications to notify that someTransferRequests were updated and dispatched the notifications to the right users.protected overit.geocallapp.replicator.basic.base.pushnotifications.PushNotificationcreateNotification(BOTransferRequestHeader transferRequest, BONotifiableUser notifiableUser, PoolKit poolKit) Creates thePushNotificationstarting from the givenBOTransferRequestHeader.protected LonggetMobileWarehouseUser(Long warehouseId, PoolKit poolKit) Returns the mobile user related to the givenBOMobileWarehouse.protected StringgetNotificationMessage(BOTransferRequestHeader transferRequest, PoolKit poolKit) Returns the notification message basing on theBOTransferRequestStateandBOTransferRequestType.protected LonggetWarehouseReceiverFromTransferRequest(BOTransferRequestHeader transferRequest, PoolKit poolKit) Returns the mobile warehouse that will receive the notification.protected booleanisMobileResource(Long userId, PoolKit poolKit) Checks if the given user is a mobile resource.protected BONotifiableUserloadNotifiableUser(Long user, PoolKit poolKit) Loads theBONotifiableUserrelated to the given id.protected BOTransferRequestHeaderloadTransferRequestHeader(Long id, PoolKit poolKit) Loads theBOTransferRequestHeader.protected BOTransferRequestStateloadTransferRequestState(Long id, PoolKit poolKit) Loads theBOTransferRequestState.protected BOTransferRequestTypeloadTransferRequestType(Long id, PoolKit poolKit) Loads theBOTransferRequestType.Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTTransferRequestPushNotificationsDispatch
public BTTransferRequestPushNotificationsDispatch()
-
-
Method Details
-
body
protected void body(TransferRequestHeaderStateChangeEvent event, PoolKit poolKit) throws DAException, DAValidateException Creates thePushNotifications to notify that someTransferRequests were updated and dispatched the notifications to the right users.- Specified by:
bodyin classBusinessTask<TransferRequestHeaderStateChangeEvent>- Parameters:
event- theTransferRequestHeaderStateChangeEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
loadNotifiableUser
protected BONotifiableUser loadNotifiableUser(Long user, PoolKit poolKit) throws DAValidateException, DAException Loads theBONotifiableUserrelated to the given id.- Parameters:
user- theBOUseridpoolKit- thePoolKit- Returns:
- the loaded
BONotifiableUser - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getWarehouseReceiverFromTransferRequest
protected Long getWarehouseReceiverFromTransferRequest(BOTransferRequestHeader transferRequest, PoolKit poolKit) throws DAValidateException, DAException Returns the mobile warehouse that will receive the notification.- Parameters:
transferRequest- theBOTransferRequestHeaderpoolKit- thePoolKit- Returns:
- the mobile warehouse receiver
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
createNotification
protected overit.geocallapp.replicator.basic.base.pushnotifications.PushNotification createNotification(BOTransferRequestHeader transferRequest, BONotifiableUser notifiableUser, PoolKit poolKit) throws DAException, DAValidateException Creates thePushNotificationstarting from the givenBOTransferRequestHeader.- Parameters:
transferRequest- theBOTransferRequestHeadernotifiableUser- theBONotifiableUserthat will receive the notificationpoolKit- thePoolKit- Returns:
- the created
PushNotification - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
getNotificationMessage
protected String getNotificationMessage(BOTransferRequestHeader transferRequest, PoolKit poolKit) throws DAValidateException, DAException Returns the notification message basing on theBOTransferRequestStateandBOTransferRequestType.- Parameters:
transferRequest- theBOTransferRequestHeaderpoolKit- thePoolKit- Returns:
- the notification message
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadTransferRequestHeader
protected BOTransferRequestHeader loadTransferRequestHeader(Long id, PoolKit poolKit) throws DAValidateException, DAException Loads theBOTransferRequestHeader.- Parameters:
id- theBOTransferRequestHeaderidpoolKit- thePoolKit- Returns:
- the loaded
BOTransferRequestHeader - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadTransferRequestState
protected BOTransferRequestState loadTransferRequestState(Long id, PoolKit poolKit) throws DAValidateException, DAException Loads theBOTransferRequestState.- Parameters:
id- theBOTransferRequestStateidpoolKit- thePoolKit- Returns:
- the loaded
BOTransferRequestState - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadTransferRequestType
protected BOTransferRequestType loadTransferRequestType(Long id, PoolKit poolKit) throws DAValidateException, DAException Loads theBOTransferRequestType.- Parameters:
id- theBOTransferRequestTypeidpoolKit- thePoolKit- Returns:
- the loaded
BOTransferRequestType - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
isMobileResource
protected boolean isMobileResource(Long userId, PoolKit poolKit) throws DAValidateException, DAException Checks if the given user is a mobile resource.- Parameters:
userId- theBOUseridpoolKit- thePoolKit- Returns:
- true if the given user is a mobile resource, false otherwise
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getMobileWarehouseUser
protected Long getMobileWarehouseUser(Long warehouseId, PoolKit poolKit) throws DAValidateException, DAException Returns the mobile user related to the givenBOMobileWarehouse.- Parameters:
warehouseId- theBOWarehouseidpoolKit- thePoolKit- Returns:
- the mobile warehouse user
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-