Class OTADownloadRequest
java.lang.Object
com.tccc.kos.core.primary.service.ota.OTADownloadRequest
State around a given kab that needs to be downloaded as part of the OTA
process. This is passed to
OTADownloader
as part of a download
attempt. If the downloader can find the kab, it should update the progress
information in the request during the download.- Version:
- 2024-04-22
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
downloadFailed
(String reason) Record a download error.void
Record that the requested kab was not found.int
Return the current number of bytes that have been downloaded so far.Return the name of the associated downloaderint
Return how many times the download has failed.int
Return the number of times the file was requested but not found.getKabId()
Return the id of the kab to download.Return the reason code for the last download error.long
Return the last time this record was updated.boolean
Return true if the downloader is active.void
setCurrentSize
(int size) Set the number of bytes currently downloaded for this kab.
-
Constructor Details
-
OTADownloadRequest
-
-
Method Details
-
getKabId
Return the id of the kab to download. -
getDownloaderName
Return the name of the associated downloader -
isDownloaderActive
public boolean isDownloaderActive()Return true if the downloader is active. -
getCurrentSize
public int getCurrentSize()Return the current number of bytes that have been downloaded so far. The downloader should set this as part of the download process and is used to display progress to the user. -
setCurrentSize
public void setCurrentSize(int size) Set the number of bytes currently downloaded for this kab. The downlaoder should set this as part of the download process and is used to display progress to the user. -
getErrorCount
public int getErrorCount()Return how many times the download has failed. When a downloader experiences an error during download, it should increment this count. -
getLastErrorReason
Return the reason code for the last download error. This should be a reason code that can be turned into a localization key for display to the user. -
getFileNotFoundCount
public int getFileNotFoundCount()Return the number of times the file was requested but not found. -
downloadFailed
Record a download error. Called by the downloader when the download fails for any reason other than file not found as a missing file simply indicates that another downloader in the chain may be tried. The download error should be a reason code that can be turned into a localization key for display to the user. This will increment theerrorCount
property. -
fileNotFound
public void fileNotFound()Record that the requested kab was not found. This is a distinct failure mode which indicates that the kab was never published properly, vs an agent / connectivity issue with the download itself. -
getLastUpdateTime
public long getLastUpdateTime()Return the last time this record was updated.
-