Class BTGisOfflinePackagePushNotificationsCreate
java.lang.Object
overit.geocall.bl.BusinessTask<GisOfflinePackagePushNotificationsCreateEvent>
overit.geocallapp.wfm.core.bl.gis.offline.notification.task.BTGisOfflinePackagePushNotificationsCreate
- All Implemented Interfaces:
Serializable,Tool
@Event(GisOfflinePackagePushNotificationsCreateEvent.class)
public class BTGisOfflinePackagePushNotificationsCreate
extends BusinessTask<GisOfflinePackagePushNotificationsCreateEvent>
Business task in order to create the
When the
PushNotifications
used to notify that a BOGisOfflinePackage has been modified. When the
GisOfflinePackagePushNotificationsCreateEvent is launched
the BT notices the call and creates the PushNotification basing on the event's input. - Since:
- 12.0
- See Also:
- GCApi:
- task
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected overit.geocallapp.docshare.docsharing.services.ResourceService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbody(GisOfflinePackagePushNotificationsCreateEvent event, PoolKit poolKit) ThePushNotifications for the Gis offline packages update, are created through various steps: we identify all theBOGisOfflinePackages that were updated since the last notification to the mobile we search for all the mobile users that match the gis visibility rule related to the resulting packages for every mobile user we create a singlePushNotificationcontaining the external id of allBOGisOfflinePackageneeded to be notifiedprotected List<overit.geocallapp.replicator.basic.base.pushnotifications.PushNotification> createPushNotifications(Map<BONotifiableUser, List<BOGisOfflinePackage>> offlinePackagesByMobileUser, PoolKit poolKit) Creates the push notifications starting from a map containing all the needed mobile users and the related list ofBOGisOfflinePackagethat were updated.protected List<BOGisOfflinePackage> getModifiedOfflinePackages(PoolKit poolKit) Returns the list ofBOGisOfflinePackagethat were updated since the last notification to the mobile.overit.geocallapp.docshare.docsharing.services.ResourceServiceReturns an instance of theResourceService.protected List<BONotifiableUser> loadNotifiableUsers(PoolKit poolKit) Loads all the notifiable users.protected List<overit.geocallapp.docshare.docsharing.model.Resource> loadNotNotificatedResources(List<String> uuids, PoolKit poolKit) Loads all theResourcerelated to the given uuid that are currently active and not yet notified.protected List<BOGisOfflinePackage> matchGisOfflinePackages(Long userId, List<BOGisOfflinePackage> offlinePackages, PoolKit poolKit) protected List<BOGisOfflinePackage> searchModifiedOfflinePackages(PoolKit poolKit) Searches for all theBOGisOfflinePackagethat are currently active.protected voidupdateResourcesNotificationDate(List<overit.geocallapp.docshare.docsharing.model.Resource> resources, PoolKit poolKit) Updates the givenResources by updating their notification date.Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Field Details
-
resourceService
protected overit.geocallapp.docshare.docsharing.services.ResourceService resourceService
-
-
Constructor Details
-
BTGisOfflinePackagePushNotificationsCreate
public BTGisOfflinePackagePushNotificationsCreate()
-
-
Method Details
-
body
protected void body(GisOfflinePackagePushNotificationsCreateEvent event, PoolKit poolKit) throws DAException, DAValidateException ThePushNotifications for the Gis offline packages update, are created through various steps:- we identify all the
BOGisOfflinePackages that were updated since the last notification to the mobile - we search for all the mobile users that match the gis visibility rule related to the resulting packages
- for every mobile user we create a single
PushNotificationcontaining the external id of allBOGisOfflinePackageneeded to be notified
- Specified by:
bodyin classBusinessTask<GisOfflinePackagePushNotificationsCreateEvent>- Parameters:
event- theGisOfflinePackagePushNotificationsCreateEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
- we identify all the
-
getModifiedOfflinePackages
protected List<BOGisOfflinePackage> getModifiedOfflinePackages(PoolKit poolKit) throws DAException, DAValidateException Returns the list ofBOGisOfflinePackagethat were updated since the last notification to the mobile.- Parameters:
poolKit- thePoolKit- Returns:
- a list of
BOGisOfflinePackagethat were modified - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
searchModifiedOfflinePackages
protected List<BOGisOfflinePackage> searchModifiedOfflinePackages(PoolKit poolKit) throws DAValidateException, DAException Searches for all theBOGisOfflinePackagethat are currently active.- Parameters:
poolKit- thePoolKit- Returns:
- a list of active
BOGisOfflinePackage - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadNotifiableUsers
protected List<BONotifiableUser> loadNotifiableUsers(PoolKit poolKit) throws DAValidateException, DAException Loads all the notifiable users.- Parameters:
poolKit- thePoolKit- Returns:
- the list of
BONotifiableUser - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
matchGisOfflinePackages
protected List<BOGisOfflinePackage> matchGisOfflinePackages(Long userId, List<BOGisOfflinePackage> offlinePackages, PoolKit poolKit) throws DAValidateException, DAException - Parameters:
userId- theBOUseridofflinePackages- list of consideredBOGisOfflinePackagespoolKit- thePoolKit- Returns:
- a list of
BOGisOfflinePackages that match with the givenBOUser - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadNotNotificatedResources
protected List<overit.geocallapp.docshare.docsharing.model.Resource> loadNotNotificatedResources(List<String> uuids, PoolKit poolKit) throws DAException, DAValidateException Loads all theResourcerelated to the given uuid that are currently active and not yet notified.- Parameters:
uuids- list of uuid used as filterpoolKit- thePoolKit- Returns:
- a list of active and not yet notified
Resources - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
updateResourcesNotificationDate
protected void updateResourcesNotificationDate(List<overit.geocallapp.docshare.docsharing.model.Resource> resources, PoolKit poolKit) throws DAValidateException, DAException Updates the givenResources by updating their notification date.- Parameters:
resources- list ofResources to updatepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
createPushNotifications
protected List<overit.geocallapp.replicator.basic.base.pushnotifications.PushNotification> createPushNotifications(Map<BONotifiableUser, List<BOGisOfflinePackage>> offlinePackagesByMobileUser, PoolKit poolKit) throws DAException, DAValidateExceptionCreates the push notifications starting from a map containing all the needed mobile users and the related list ofBOGisOfflinePackagethat were updated.- Parameters:
offlinePackagesByMobileUser- the map of the gis offline packages not yet notified with the correspondingBOUserpoolKit- thePoolKit- Returns:
- the list of push notification that need to be sent
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception- See Also:
-
getResourceService
public overit.geocallapp.docshare.docsharing.services.ResourceService getResourceService() throws DAException, DAValidateExceptionReturns an instance of theResourceService.- Returns:
- the instantiated
ResourceService - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-