@ThreadSafe public class ProcessTask extends java.lang.Object implements java.util.concurrent.Callable<ProcessTask>
| Constructor and Description |
|---|
ProcessTask(CveDB cveDB,
DownloadTask downloadTask,
Settings settings)
Constructs a new ProcessTask used to process an NVD CVE update.
|
| Modifier and Type | Method and Description |
|---|---|
ProcessTask |
call()
Implements the callable interface.
|
UpdateException |
getException()
Get the value of exception.
|
protected void |
importJSON(java.io.File file)
Imports the NVD CVE JSON File into the database.
|
void |
setException(UpdateException exception)
Set the value of exception.
|
public ProcessTask(CveDB cveDB, DownloadTask downloadTask, Settings settings)
cveDB - the data store objectdownloadTask - the download task that contains the URL references to
downloadsettings - 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.public UpdateException getException()
public void setException(UpdateException exception)
exception - new value of exceptionpublic ProcessTask call() throws java.lang.Exception
call in interface java.util.concurrent.Callable<ProcessTask>java.lang.Exception - thrown if there is an exception; note that any
UpdateExceptions are simply added to the tasks exception collectionprotected void importJSON(java.io.File file)
throws javax.xml.parsers.ParserConfigurationException,
java.io.IOException,
java.sql.SQLException,
DatabaseException,
java.lang.ClassNotFoundException,
UpdateException,
CorruptedDatastreamException
file - the file containing the NVD CVE JSONjavax.xml.parsers.ParserConfigurationException - is thrown if there is a parser
configuration exceptionjava.io.IOException - is thrown if there is a IO Exceptionjava.sql.SQLException - is thrown if there is a SQL exceptionDatabaseException - is thrown if there is a database exceptionjava.lang.ClassNotFoundException - thrown if the h2 database driver cannot be
loadedUpdateException - thrown if the file could not be foundCorruptedDatastreamException - thrown if the file was found to be a corrupted downloadCopyright© 2012-21 Jeremy Long. All Rights Reserved.