Class BTGisFileOutcomeUpdate
java.lang.Object
overit.geocall.bl.BusinessTask<GisFileOutcomeUpdateEvent>
overit.geocallapp.wfm.core.bl.gis.offline.task.BTGisFileOutcomeUpdate
- All Implemented Interfaces:
Serializable,Tool
@Event(GisFileOutcomeUpdateEvent.class)
public class BTGisFileOutcomeUpdate
extends BusinessTask<GisFileOutcomeUpdateEvent>
Business task in order to update a
When the
BOGisOfflinePackage. When the
GisFileOutcomeUpdateEvent is launched the BT notices the
call and updates the Resource of the corresponding
BOGisOfflinePackage basing on the event's input. Error Code:
Codes.C270_1555: An newer version of the resource is currenlty active.Codes.C270_1532: WebResource {0} does not exist on server.Codes.C270_1576: File extension not found.
- 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(GisFileOutcomeUpdateEvent event, PoolKit poolKit) Updates the last version of theResourcerelated to the givenBOGisOfflinePackagebasing on the update outcome.protected overit.geocallapp.docshare.docsharing.model.ResourceReturns the activeResourceversion.protected overit.geocallapp.docshare.docsharing.model.ResourcegetLastResourceVersion(String uuid) Returns the lastResourceversion.overit.geocallapp.docshare.docsharing.services.ResourceServiceReturns an instance of theResourceService.protected List<overit.geocallapp.docshare.docsharing.model.Resource> getSortedVersions(String uuid) Returns all the versions of theResourcewith the given uuid, sorted from the last version on.protected BOGisOfflinePackageloadGisOfflinePackage(Long externalId, PoolKit poolKit) Loads the neededBOGisOfflinePackage.protected overit.geocallapp.docshare.docsharing.model.ResourcesetResourceData(overit.geocallapp.docshare.docsharing.model.Resource resource) Sets theResourcemissing data which could not be previously calculated.protected voidupdateGisOfflinePackageData(String uuid, PoolKit poolKit) Updates theBOGisOfflinePackagedata, related to the given uuid.protected voidupdateResourceByOutcome(Boolean updateOutcome, String uuid, PoolKit poolKit) Updates theResourcebasing on the update outcome.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
-
BTGisFileOutcomeUpdate
public BTGisFileOutcomeUpdate()
-
-
Method Details
-
body
protected void body(GisFileOutcomeUpdateEvent event, PoolKit poolKit) throws DAException, DAValidateException Updates the last version of theResourcerelated to the givenBOGisOfflinePackagebasing on the update outcome.- Specified by:
bodyin classBusinessTask<GisFileOutcomeUpdateEvent>- Parameters:
event- theGisFileOutcomeUpdateEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
updateResourceByOutcome
protected void updateResourceByOutcome(Boolean updateOutcome, String uuid, PoolKit poolKit) throws DAValidateException, DAException Updates theResourcebasing on the update outcome. If the outcome is successful, the last version of theResourceis activated. Whereas if the outcome was not successful, the last not active version is deleted.- Parameters:
updateOutcome- the update outcomeuuid- the uuid of the currentResourcepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadGisOfflinePackage
protected BOGisOfflinePackage loadGisOfflinePackage(Long externalId, PoolKit poolKit) throws DAValidateException, DAException Loads the neededBOGisOfflinePackage.- Parameters:
externalId- the external id of the gis offline packagepoolKit- thePoolKit- Returns:
- the BO gis offline package
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getLastResourceVersion
protected overit.geocallapp.docshare.docsharing.model.Resource getLastResourceVersion(String uuid) throws DAValidateException, DAException Returns the lastResourceversion.- Parameters:
uuid- the uuid of theResource- Returns:
- the last
Resourceversion - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getActiveResourceVersion
protected overit.geocallapp.docshare.docsharing.model.Resource getActiveResourceVersion(String uuid) throws DAValidateException, DAException Returns the activeResourceversion.- Parameters:
uuid- the uuid of theResource- Returns:
- the active
Resourceversion - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getSortedVersions
protected List<overit.geocallapp.docshare.docsharing.model.Resource> getSortedVersions(String uuid) throws DAValidateException, DAException Returns all the versions of theResourcewith the given uuid, sorted from the last version on.- Parameters:
uuid- the uuid of theResource- Returns:
- a sorted list of
Resourceversions - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
updateGisOfflinePackageData
protected void updateGisOfflinePackageData(String uuid, PoolKit poolKit) throws DAValidateException, DAException Updates theBOGisOfflinePackagedata, related to the given uuid.- Parameters:
uuid- the current uuidpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
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
-