Class ScanHostResponse

All Implemented Interfaces:
NessusResponse, DbPojo

@Entity(name="ScanHostResponse")
public class ScanHostResponse
extends NessusResponseGenerateTimestamp
Represents a response from the Nessus API at the url path /scans/<scan-id>/hosts/<host-id>, with details about a specific host that was scanned
  • Field Details

    • logger

      public static final org.apache.logging.log4j.Logger logger
      The logger for ScanHostResponse
    • dao

      public static final Dao<ScanHostResponse> dao
      The dao for ScanHostResponse
  • Constructor Details

  • Method Details

    • getUrlPath

      public static java.lang.String getUrlPath​(int scanId, int hostId) throws java.lang.IllegalArgumentException
      Gets url path for the response
      Parameters:
      scanId - the scan id
      hostId - the host id
      Returns:
      the url path
      Throws:
      java.lang.IllegalArgumentException - if the scanId or hostId are invalid
    • getUrlPath

      public static java.lang.String getUrlPath​(ScanHost host) throws java.lang.NullPointerException
      Gets url path for a provided ScanHost
      Parameters:
      host - the scan host which we want to obtain more information about
      Returns:
      the url path
      Throws:
      java.lang.NullPointerException - if host is null
    • getUrlPath

      public java.lang.String getUrlPath() throws java.lang.IllegalStateException
      Description copied from interface: NessusResponse
      Gets url path for the Nessus API
      Specified by:
      getUrlPath in interface NessusResponse
      Specified by:
      getUrlPath in class NessusResponseGenerateTimestamp
      Returns:
      the url path
      Throws:
      java.lang.IllegalStateException
    • _prepare

      public void _prepare()
      Description copied from interface: DbPojo
      Perform any operations necessary to prepare this pojo for insertion or updating in the database
    • getOrFetchScanResponse

      public ScanResponse getOrFetchScanResponse()
      Gets the scan response corresponding the scanHost this ScanHostResponse is related to. If the scanResponse is not already set, this method will attempt to track it down through the ScanHost or by using the ScanResponse dao
      Returns:
      the scanResponse related to this scanHostResponse
    • setScanResponse

      public void setScanResponse​(ScanResponse scanResponse)
      Sets scan response.
      Parameters:
      scanResponse - the scan response
    • getHost

      public ScanHost getHost()
      Gets host.
      Returns:
      the host
    • setHost

      public void setHost​(ScanHost host)
      Sets host.
      Parameters:
      host - the host
    • getVulnerabilities

      public java.util.List<Vulnerability> getVulnerabilities()
      Gets vulnerabilities.
      Returns:
      the vulnerabilities
    • setVulnerabilities

      public void setVulnerabilities​(java.util.List<Vulnerability> vulnerabilities)
      Sets vulnerabilities.
      Parameters:
      vulnerabilities - the vulnerabilities
    • getInfo

      public ScanHostInfo getInfo()
      Gets info.
      Returns:
      the info
    • setInfo

      public void setInfo​(ScanHostInfo info)
      Sets info.
      Parameters:
      info - the info