public class TotalProgressPullListener extends Object implements UpdateListener<PullImageUpdateEvent>
UpdateListener
that calculates the total progress of the entire pull operation
and publishes TotalProgressEvent
.NONE
Constructor and Description |
---|
TotalProgressPullListener(Consumer<TotalProgressEvent> consumer)
Create a new
TotalProgressPullListener that sends events to the given consumer. |
TotalProgressPullListener(String prefix)
Create a new
TotalProgressPullListener that prints a progress bar to
System.out . |
Modifier and Type | Method and Description |
---|---|
void |
onFinish()
Called when the operation finishes (with or without error).
|
void |
onStart()
Called when the operation starts.
|
void |
onUpdate(PullImageUpdateEvent event)
Called when an update event is available.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
none
public TotalProgressPullListener(String prefix)
TotalProgressPullListener
that prints a progress bar to
System.out
.prefix
- the prefix to outputpublic TotalProgressPullListener(Consumer<TotalProgressEvent> consumer)
TotalProgressPullListener
that sends events
to the given consumer.consumer
- the consumer that receives progress
events
public void onStart()
UpdateListener
onStart
in interface UpdateListener<PullImageUpdateEvent>
public void onUpdate(PullImageUpdateEvent event)
UpdateListener
onUpdate
in interface UpdateListener<PullImageUpdateEvent>
event
- the update eventpublic void onFinish()
UpdateListener
onFinish
in interface UpdateListener<PullImageUpdateEvent>