Class DownloadTask

  • All Implemented Interfaces:
    java.util.concurrent.Callable<java.util.concurrent.Future<NvdApiProcessor>>

    @ThreadSafe
    public class DownloadTask
    extends java.lang.Object
    implements java.util.concurrent.Callable<java.util.concurrent.Future<NvdApiProcessor>>
    A callable object to download the NVD API cache files and start the NvdApiProcessor.
    Author:
    Jeremy Long
    • Constructor Summary

      Constructors 
      Constructor Description
      DownloadTask​(java.lang.String url, java.util.concurrent.ExecutorService processor, CveDB cveDB, Settings settings)
      Simple constructor for the callable download task.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.Future<NvdApiProcessor> call()  
      boolean isModified()
      Returns true if the process task is for the modified json file from the NVD API Cache.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DownloadTask

        public DownloadTask​(java.lang.String url,
                            java.util.concurrent.ExecutorService processor,
                            CveDB cveDB,
                            Settings settings)
        Simple constructor for the callable download task.
        Parameters:
        url - the file to download
        processor - the processor service to submit the downloaded files to
        cveDB - the CVE DB to use to store the vulnerability data
        settings - a reference to the global settings object; this is necessary so that when the thread is started the dependencies have a correct reference to the global settings.
    • Method Detail

      • call

        public java.util.concurrent.Future<NvdApiProcessor> call()
                                                          throws java.lang.Exception
        Specified by:
        call in interface java.util.concurrent.Callable<java.util.concurrent.Future<NvdApiProcessor>>
        Throws:
        java.lang.Exception
      • isModified

        public boolean isModified()
        Returns true if the process task is for the modified json file from the NVD API Cache.
        Returns:
        true if the process task is for the modified data; otherwise false