Package io.bdeploy.jersey.activity
Class JerseyBroadcastingActivityReporter
java.lang.Object
io.bdeploy.jersey.activity.JerseyBroadcastingActivityReporter
- All Implemented Interfaces:
ActivityReporter
An activity reporter which exposes currently running activities to be broadcasted via SSE
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.bdeploy.common.ActivityReporter
ActivityReporter.Activity, ActivityReporter.ActivityCancelledException, ActivityReporter.Delegating, ActivityReporter.Null, ActivityReporter.Stream -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringNeeds to be in line with ObjectChangeType for the Web UI -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionproxyActivities(RemoteService service) Proxy remote activities to thisActivityReporterimplementation if possible.Start anActivityReporter.Activitywithout any associated work amount.Start anActivityReporter.Activitywith a static work amount.start(String activity, LongSupplier maxValue, LongSupplier currentValue) Start anActivityReporter.Activitywith a dynamic maximum and current work amount.
-
Field Details
-
OCT_ACTIVIES
Needs to be in line with ObjectChangeType for the Web UI- See Also:
-
-
Constructor Details
-
JerseyBroadcastingActivityReporter
@Inject public JerseyBroadcastingActivityReporter(@Named("BcExecutor") ScheduledExecutorService scheduler)
-
-
Method Details
-
start
Description copied from interface:ActivityReporterStart anActivityReporter.Activitywithout any associated work amount.- Specified by:
startin interfaceActivityReporter
-
start
Description copied from interface:ActivityReporterStart anActivityReporter.Activitywith a static work amount. UseActivityReporter.Activity.worked(long)to updated the already consumed work amount.Special maxWork values:
- -1: don't report work at all. only time will be reported
- 0: don't report any maximum, just report current amount if possible.
- Specified by:
startin interfaceActivityReporter
-
start
public ActivityReporter.Activity start(String activity, LongSupplier maxValue, LongSupplier currentValue) Description copied from interface:ActivityReporterStart anActivityReporter.Activitywith a dynamic maximum and current work amount. TheSuppliers are queried periodically when reporting progress, to catch updates on the values.- Specified by:
startin interfaceActivityReporter
-
proxyActivities
Description copied from interface:ActivityReporterProxy remote activities to thisActivityReporterimplementation if possible.- Specified by:
proxyActivitiesin interfaceActivityReporter
-