Class Update

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    Check

    public class Update
    extends Purge
    An Ant task definition to execute dependency-check update. This will download the latest data from the National Vulnerability Database (NVD) and store a copy in the local database.
    Author:
    Jeremy Long
    • Field Summary

      • Fields inherited from class org.apache.tools.ant.Task

        target, taskName, taskType, wrapper
      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        description, location, project
    • Constructor Summary

      Constructors 
      Constructor Description
      Update()
      Construct a new UpdateTask.
    • Constructor Detail

      • Update

        public Update()
        Construct a new UpdateTask.
    • Method Detail

      • getNvdApiEndpoint

        public java.lang.String getNvdApiEndpoint()
        Get the value of nvdApiEndpoint.
        Returns:
        the value of nvdApiEndpoint
      • setNvdApiEndpoint

        public void setNvdApiEndpoint​(java.lang.String nvdApiEndpoint)
        Set the value of nvdApiEndpoint.
        Parameters:
        nvdApiEndpoint - new value of nvdApiEndpoint
      • getNvdApiKey

        public java.lang.String getNvdApiKey()
        Get the value of nvdApiKey.
        Returns:
        the value of nvdApiKey
      • setNvdApiKey

        public void setNvdApiKey​(java.lang.String nvdApiKey)
        Set the value of nvdApiKey.
        Parameters:
        nvdApiKey - new value of nvdApiKey
      • getNvdMaxRetryCounts

        public int getNvdMaxRetryCounts()
        Get the value of nvdMaxRetryCount.
        Returns:
        the value of nvdMaxRetryCount
      • setNvdMaxRetryCount

        public void setNvdMaxRetryCount​(int nvdMaxRetryCount)
        Set the value of nvdMaxRetryCount.
        Parameters:
        nvdMaxRetryCount - new value of nvdMaxRetryCount
      • getNvdValidForHours

        public int getNvdValidForHours()
        Get the value of nvdValidForHours.
        Returns:
        the value of nvdValidForHours
      • setNvdValidForHours

        public void setNvdValidForHours​(int nvdValidForHours)
        Set the value of nvdValidForHours.
        Parameters:
        nvdValidForHours - new value of nvdValidForHours
      • getNvdDatafeedUrl

        public java.lang.String getNvdDatafeedUrl()
        Get the value of nvdDatafeedUrl.
        Returns:
        the value of nvdDatafeedUrl
      • setNvdDatafeedUrl

        public void setNvdDatafeedUrl​(java.lang.String nvdDatafeedUrl)
        Set the value of nvdDatafeedUrl.
        Parameters:
        nvdDatafeedUrl - new value of nvdDatafeedUrl
      • getNvdUser

        public java.lang.String getNvdUser()
        Get the value of nvdUser.
        Returns:
        the value of nvdUser
      • setNvdUser

        public void setNvdUser​(java.lang.String nvdUser)
        Set the value of nvdUser.
        Parameters:
        nvdUser - new value of nvdUser
      • getNvdPassword

        public java.lang.String getNvdPassword()
        Get the value of nvdPassword.
        Returns:
        the value of nvdPassword
      • setNvdPassword

        public void setNvdPassword​(java.lang.String nvdPassword)
        Set the value of nvdPassword.
        Parameters:
        nvdPassword - new value of nvdPassword
      • getNvdApiDelay

        public int getNvdApiDelay()
        Get the value of nvdApiDelay.
        Returns:
        the value of nvdApiDelay
      • setNvdApiDelay

        public void setNvdApiDelay​(int nvdApiDelay)
        Set the value of nvdApiDelay.
        Parameters:
        nvdApiDelay - new value of nvdApiDelay
      • getNvdApiResultsPerPage

        public int getNvdApiResultsPerPage()
        Get the value of nvdApiResultsPerPage.
        Returns:
        the value of nvdApiResultsPerPage
      • setApiResultsPerPage

        public void setApiResultsPerPage​(int nvdApiResultsPerPage)
        Set the value of nvdApiResultsPerPage.
        Parameters:
        nvdApiResultsPerPage - new value of nvdApiResultsPerPage
      • getProxyServer

        public java.lang.String getProxyServer()
        Get the value of proxyServer.
        Returns:
        the value of proxyServer
      • setProxyServer

        public void setProxyServer​(java.lang.String server)
        Set the value of proxyServer.
        Parameters:
        server - new value of proxyServer
      • getProxyPort

        public java.lang.String getProxyPort()
        Get the value of proxyPort.
        Returns:
        the value of proxyPort
      • setProxyPort

        public void setProxyPort​(java.lang.String proxyPort)
        Set the value of proxyPort.
        Parameters:
        proxyPort - new value of proxyPort
      • getProxyUsername

        public java.lang.String getProxyUsername()
        Get the value of proxyUsername.
        Returns:
        the value of proxyUsername
      • setProxyUsername

        public void setProxyUsername​(java.lang.String proxyUsername)
        Set the value of proxyUsername.
        Parameters:
        proxyUsername - new value of proxyUsername
      • getProxyPassword

        public java.lang.String getProxyPassword()
        Get the value of proxyPassword.
        Returns:
        the value of proxyPassword
      • setProxyPassword

        public void setProxyPassword​(java.lang.String proxyPassword)
        Set the value of proxyPassword.
        Parameters:
        proxyPassword - new value of proxyPassword
      • getNonProxyHosts

        public java.lang.String getNonProxyHosts()
        Get the value of nonProxyHosts.
        Returns:
        the value of nonProxyHosts
      • setNonProxyHosts

        public void setNonProxyHosts​(java.lang.String nonProxyHosts)
        Set the value of nonProxyHosts.
        Parameters:
        nonProxyHosts - new value of nonProxyHosts
      • getConnectionTimeout

        public java.lang.String getConnectionTimeout()
        Get the value of connectionTimeout.
        Returns:
        the value of connectionTimeout
      • setConnectionTimeout

        public void setConnectionTimeout​(java.lang.String connectionTimeout)
        Set the value of connectionTimeout.
        Parameters:
        connectionTimeout - new value of connectionTimeout
      • getReadTimeout

        public java.lang.String getReadTimeout()
        Get the value of readTimeout.
        Returns:
        the value of readTimeout
      • setReadTimeout

        public void setReadTimeout​(java.lang.String readTimeout)
        Set the value of readTimeout.
        Parameters:
        readTimeout - new value of readTimeout
      • getDatabaseDriverName

        public java.lang.String getDatabaseDriverName()
        Get the value of databaseDriverName.
        Returns:
        the value of databaseDriverName
      • setDatabaseDriverName

        public void setDatabaseDriverName​(java.lang.String databaseDriverName)
        Set the value of databaseDriverName.
        Parameters:
        databaseDriverName - new value of databaseDriverName
      • getDatabaseDriverPath

        public java.lang.String getDatabaseDriverPath()
        Get the value of databaseDriverPath.
        Returns:
        the value of databaseDriverPath
      • setDatabaseDriverPath

        public void setDatabaseDriverPath​(java.lang.String databaseDriverPath)
        Set the value of databaseDriverPath.
        Parameters:
        databaseDriverPath - new value of databaseDriverPath
      • getConnectionString

        public java.lang.String getConnectionString()
        Get the value of connectionString.
        Returns:
        the value of connectionString
      • setConnectionString

        public void setConnectionString​(java.lang.String connectionString)
        Set the value of connectionString.
        Parameters:
        connectionString - new value of connectionString
      • getDatabaseUser

        public java.lang.String getDatabaseUser()
        Get the value of databaseUser.
        Returns:
        the value of databaseUser
      • setDatabaseUser

        public void setDatabaseUser​(java.lang.String databaseUser)
        Set the value of databaseUser.
        Parameters:
        databaseUser - new value of databaseUser
      • getDatabasePassword

        public java.lang.String getDatabasePassword()
        Get the value of databasePassword.
        Returns:
        the value of databasePassword
      • setDatabasePassword

        public void setDatabasePassword​(java.lang.String databasePassword)
        Set the value of databasePassword.
        Parameters:
        databasePassword - new value of databasePassword
      • getHostedSuppressionsValidForHours

        public java.lang.Integer getHostedSuppressionsValidForHours()
        Get the value of hostedSuppressionsValidForHours.
        Returns:
        the value of hostedSuppressionsValidForHours
      • setHostedSuppressionsValidForHours

        public void setHostedSuppressionsValidForHours​(java.lang.Integer hostedSuppressionsValidForHours)
        Set the value of hostedSuppressionsValidForHours.
        Parameters:
        hostedSuppressionsValidForHours - new value of hostedSuppressionsValidForHours
      • isHostedSuppressionsForceUpdate

        public java.lang.Boolean isHostedSuppressionsForceUpdate()
        Get the value of hostedSuppressionsForceUpdate.
        Returns:
        the value of hostedSuppressionsForceUpdate
      • setHostedSuppressionsForceUpdate

        public void setHostedSuppressionsForceUpdate​(java.lang.Boolean hostedSuppressionsForceUpdate)
        Set the value of hostedSuppressionsForceUpdate.
        Parameters:
        hostedSuppressionsForceUpdate - new value of hostedSuppressionsForceUpdate
      • isHostedSuppressionsEnabled

        public java.lang.Boolean isHostedSuppressionsEnabled()
        Get the value of hostedSuppressionsEnabled.
        Returns:
        the value of hostedSuppressionsEnabled
      • setHostedSuppressionsEnabled

        public void setHostedSuppressionsEnabled​(java.lang.Boolean hostedSuppressionsEnabled)
        Set the value of hostedSuppressionsEnabled.
        Parameters:
        hostedSuppressionsEnabled - new value of hostedSuppressionsEnabled
      • executeWithContextClassloader

        protected void executeWithContextClassloader()
                                              throws org.apache.tools.ant.BuildException
        Executes the update by initializing the settings, downloads the NVD XML data, and then processes the data storing it in the local database.
        Overrides:
        executeWithContextClassloader in class Purge
        Throws:
        org.apache.tools.ant.BuildException - thrown if a connection to the local database cannot be made.
      • populateSettings

        protected void populateSettings()
                                 throws org.apache.tools.ant.BuildException
        Takes the properties supplied and updates the dependency-check settings. Additionally, this sets the system properties required to change the proxy server, port, and connection timeout.
        Overrides:
        populateSettings in class Purge
        Throws:
        org.apache.tools.ant.BuildException - thrown when an invalid setting is configured.