Class OTADownloadRequest

java.lang.Object
com.tccc.kos.core.primary.service.ota.OTADownloadRequest

public class OTADownloadRequest extends Object
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 Details

  • Method Details

    • getKabId

      public String getKabId()
      Return the id of the kab to download.
    • getDownloaderName

      public String 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

      public String 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

      public void downloadFailed(String reason)
      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 the errorCount 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.