Class ProgressManagerService
java.lang.Object
fr.paris.lutece.portal.service.progressmanager.ProgressManagerService
Service for tracking progress of long-running operations (imports, bulk
processing, etc.) via an in-memory feed registry.
Multi-instance deployment note: Progress feeds are stored in JVM-local
memory and are not shared across application instances. In a clustered
deployment behind a load balancer, the polling requests (via
ProgressManagerServlet) must be routed to the same instance that
registered the feed. Configure sticky sessions (session affinity) on
the load balancer to ensure this. Without sticky sessions, progress polling
requests may land on an instance that has no knowledge of the feed, resulting
in "not found" responses and a broken progress bar in the UI.
- Author:
- sleridon
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd report lineintgetFailureNb(String strFeedToken) get the failure nbstatic ProgressManagerServiceDeprecated, for removal: This API element is subject to removal in a future version.ge progress feedsintgetProgressStatus(String strFeedToken) get the progress status in pourcentget the report listget the report listintgetSuccessNb(String strFeedToken) get the success nbvoidincrementFailure(String strFeedToken, int nFailureItems) increment nb of success itemsvoidincrementSuccess(String strFeedToken, int nSuccessItems) increment nb of success itemsbooleanupdate feed total item numberbooleanchek if feed is publicbooleanisRegistred(String strFeedToken) check if feed existsregisterFeed(String strProgressFeedName, int nTotalItems) register new progress feed returns a generated token to identify the feed for rest webserviceregisterFeed(String strProgressFeedName, int nTotalItems, boolean isPublic) register new progress feed returns a generated token to identify the feed for rest webservicevoidunRegisterFeed(String strFeedToken) unregister progress feed
-
Method Details
-
getInstance
Deprecated, for removal: This API element is subject to removal in a future version.Use@Injectto obtain theProgressManagerServiceinstance. This method will be removed in future versions.Returns the unique instance of theProgressManagerServiceservice.This method is deprecated and is provided for backward compatibility only. For new code, use dependency injection with
@Injectto obtain theProgressManagerServiceinstance instead.- Returns:
- The unique instance of
ProgressManagerService.
-
getProgressFeeds
ge progress feeds- Returns:
- the progress feeds
-
registerFeed
register new progress feed returns a generated token to identify the feed for rest webservice- Parameters:
strProgressFeedName-nTotalItems-- Returns:
- the generated token
-
registerFeed
register new progress feed returns a generated token to identify the feed for rest webservice- Parameters:
strProgressFeedName-nTotalItems-isPublic-- Returns:
- the generated token
-
unRegisterFeed
unregister progress feed- Parameters:
strFeedToken-
-
isRegistred
check if feed exists- Parameters:
strFeedToken-- Returns:
- true if exists
-
isPublic
chek if feed is public- Parameters:
strFeedToken-- Returns:
-
incrementSuccess
increment nb of success items- Parameters:
strFeedToken-nSuccessItems-
-
incrementFailure
increment nb of success items- Parameters:
strFeedToken-nFailureItems-
-
addReport
add report line- Parameters:
strFeedToken-strReportLine-
-
getProgressStatus
get the progress status in pourcent- Parameters:
strFeedToken-- Returns:
-
getSuccessNb
get the success nb- Parameters:
strFeedToken-- Returns:
- the success nb
-
getFailureNb
get the failure nb- Parameters:
strFeedToken-- Returns:
- the failure nb
-
getReport
get the report list- Parameters:
strFeedToken-- Returns:
- the failure nb
-
getReport
get the report list- Parameters:
strFeedToken-iFromLine-- Returns:
- the failure nb
-
initFeed
update feed total item number- Parameters:
strFeedToken-nTotalItems-- Returns:
- true if the feed exists
-
@Injectto obtain theProgressManagerServiceinstance.