Interface ProgressCallback
@NonNullByDefault
public interface ProgressCallback
The 
ProgressCallback is injected into the
 FirmwareUpdateHandler.updateFirmware(Firmware, ProgressCallback) operation in order to post progress
 information about the firmware update process.
 The progress of a firmware update can be defined by a sequence of ProgressSteps, a percentage progress or
 both.
 In order to use a sequence of ProgressSteps to indicate the update progress, it is necessary to first define
 a sequence using the method defineSequence(ProgressStep...). To indicate that the next
 progress step is going to be executed the method next() has to be used.
 For updates which are based on a percentage progress it is optional to define a sequence of ProgressSteps and
 to use the next() method. In order to indicate that the percentage progress has changed, the
 method update(int) has to be used. It allows to update the percentage progress to a
 value between 0 and 100.- Author:
- Thomas Höfer - Initial contribution, Christop Knauf - Added canceled, pending and update
- 
Method SummaryModifier and TypeMethodDescriptionvoidcanceled()Callback operation to indicate that the firmware update was canceled.voiddefineSequence(ProgressStep... sequence) Callback operation to define theProgressSteps for the sequence of the firmware update.voidCallback operation to indicate that the firmware update has failed.voidnext()Callback operation to indicate that the next progress step is going to be executed.voidpending()Callback operation to indicate that the firmware update is pending.voidsuccess()Callback operation to indicate that the firmware update was successful.voidupdate(int progress) Callback operation to update the percentage progress of the firmware update.
- 
Method Details- 
defineSequenceCallback operation to define theProgressSteps for the sequence of the firmware update. So if the operation is invoked with the following progress steps then this will mean that the firmware update implementation will initially download the firmware, then it will transfer the firmware to the actual device and in a final step it will trigger the update.- Parameters:
- sequence- the progress steps describing the sequence of the firmware update process (must not be null or empty)
- Throws:
- IllegalArgumentException- if given sequence is null or empty
 
- 
nextvoid next()Callback operation to indicate that the next progress step is going to be executed. Following the example of thedefineSequence(ProgressStep...)operation then the first invocation of this operation will indicate that firmware update handler is going to download the firmware, the second invocation will indicate that the handler is going to transfer the firmware to the device and consequently the third invocation will indicate that the handler is going to trigger the update. If the update is pending calling next indicates that the update is continued.- Throws:
- IllegalStateException- if- update is not pending and there is no further step to be executed
- if no sequence was defined
 
 
- 
failedCallback operation to indicate that the firmware update has failed.- Parameters:
- errorMessageKey- the key of the error message to be internationalized (must not be null or empty)
- arguments- the arguments to be injected into the internationalized error message (can be null)
- Throws:
- IllegalArgumentException- if given error message key is null or empty
- IllegalStateException- if update is already finished
 
- 
successvoid success()Callback operation to indicate that the firmware update was successful.- Throws:
- IllegalStateException- if update is finished
 
- 
pendingvoid pending()Callback operation to indicate that the firmware update is pending.- Throws:
- IllegalStateException- if update is finished
 
- 
canceledvoid canceled()Callback operation to indicate that the firmware update was canceled.- Throws:
- IllegalStateException- if update is finished
 
- 
updatevoid update(int progress) Callback operation to update the percentage progress of the firmware update. This method can be used to provide detailed progress information additional to the sequence or even without a previous defined sequence.- Parameters:
- progress- the progress between 0 and 100
- Throws:
- IllegalArgumentException- if given progress is- < 0or- > 100or if given progress is smaller than old progress
- IllegalStateException- if update is finished
 
 
-