Package io.bdeploy.common
Class ActivityReporter.Stream
java.lang.Object
io.bdeploy.common.ActivityReporter.Stream
- All Implemented Interfaces:
ActivityReporter
- Enclosing interface:
- ActivityReporter
An
ActivityReporter implementation which reports progress to a given
PrintStream.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.bdeploy.common.ActivityReporter
ActivityReporter.Activity, ActivityReporter.ActivityCancelledException, ActivityReporter.Delegating, ActivityReporter.Null, ActivityReporter.Stream -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidBegins the reporting process.proxyActivities(RemoteService service) Proxy remote activities to thisActivityReporterimplementation if possible.voidsetProxyConnector(BiFunction<RemoteService, Consumer<List<ActivitySnapshot>>, NoThrowAutoCloseable> proxyConnector) voidsetVerboseSummary(boolean verbose) A verbose summary will include more details about single activity duration(s).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.voidStops (and cleans up resources associated with) progress reporting.
-
Constructor Details
-
Stream
-
-
Method Details
-
setVerboseSummary
public void setVerboseSummary(boolean verbose) A verbose summary will include more details about single activity duration(s). -
beginReporting
public void beginReporting()Begins the reporting process. Reporting runs asynchronously (periodically) to avoid stalling of running actions while catching up with dynamic updates to progress values. -
stopReporting
public void stopReporting()Stops (and cleans up resources associated with) progress reporting. No furtherActivityReporter.Activityprocessing will be done after this method finishes. All remainingActivityReporter.Activityinstances are cleared (but not finished). -
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
-
setProxyConnector
public void setProxyConnector(BiFunction<RemoteService, Consumer<List<ActivitySnapshot>>, NoThrowAutoCloseable> proxyConnector) -
proxyActivities
Description copied from interface:ActivityReporterProxy remote activities to thisActivityReporterimplementation if possible.- Specified by:
proxyActivitiesin interfaceActivityReporter
-