Package tenapull.data.entity.response
Class ScanHostResponse
java.lang.Object
tenapull.data.entity.template.ExtensibleJsonPojo
tenapull.data.entity.template.NaturalIdPojo
tenapull.data.entity.response.NessusResponseGenerateTimestamp
tenapull.data.entity.response.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
-
Nested Class Summary
Nested classes/interfaces inherited from interface tenapull.data.entity.response.NessusResponse
NessusResponse.MultiChildTemplate<POJO extends NessusResponse.MultiChildTemplate<POJO,R>,R extends NessusResponse>, NessusResponse.ResponseChild<POJO extends NessusResponse.ResponseChild<POJO,R>,R extends NessusResponse>, NessusResponse.SingleChildTemplate<POJO extends NessusResponse.SingleChildTemplate<POJO,R>,R extends NessusResponse>
-
Field Summary
Fields Modifier and Type Field Description static Dao<ScanHostResponse>
dao
The dao for ScanHostResponsestatic org.apache.logging.log4j.Logger
logger
The logger for ScanHostResponse -
Constructor Summary
Constructors Constructor Description ScanHostResponse()
-
Method Summary
Modifier and Type Method Description void
_prepare()
Perform any operations necessary to prepare this pojo for insertion or updating in the databaseScanHost
getHost()
Gets host.ScanHostInfo
getInfo()
Gets info.ScanResponse
getOrFetchScanResponse()
Gets the scan response corresponding the scanHost this ScanHostResponse is related to.java.lang.String
getUrlPath()
Gets url path for the Nessus APIstatic java.lang.String
getUrlPath(int scanId, int hostId)
Gets url path for the responsestatic java.lang.String
getUrlPath(ScanHost host)
Gets url path for a provided ScanHostjava.util.List<Vulnerability>
getVulnerabilities()
Gets vulnerabilities.void
setHost(ScanHost host)
Sets host.void
setInfo(ScanHostInfo info)
Sets info.void
setScanResponse(ScanResponse scanResponse)
Sets scan response.void
setVulnerabilities(java.util.List<Vulnerability> vulnerabilities)
Sets vulnerabilities.Methods inherited from class tenapull.data.entity.response.NessusResponseGenerateTimestamp
getTimestamp, setTimestamp
Methods inherited from class tenapull.data.entity.template.NaturalIdPojo
__set, equals, getId, hashCode, setId
Methods inherited from class tenapull.data.entity.template.ExtensibleJsonPojo
__prepare, getExtraJson, getExtraJson, getExtraJsonMap, putExtraJson, setExtraJson, toJsonNode, toJsonString, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface tenapull.data.entity.template.DbPojo
getId, setId, toJsonNode, toJsonString
-
Field Details
-
Constructor Details
-
ScanHostResponse
public ScanHostResponse()
-
-
Method Details
-
getUrlPath
public static java.lang.String getUrlPath(int scanId, int hostId) throws java.lang.IllegalArgumentExceptionGets url path for the response- Parameters:
scanId
- the scan idhostId
- the host id- Returns:
- the url path
- Throws:
java.lang.IllegalArgumentException
- if the scanId or hostId are invalid
-
getUrlPath
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.IllegalStateExceptionDescription copied from interface:NessusResponse
Gets url path for the Nessus API- Specified by:
getUrlPath
in interfaceNessusResponse
- Specified by:
getUrlPath
in classNessusResponseGenerateTimestamp
- 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
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
Sets scan response.- Parameters:
scanResponse
- the scan response
-
getHost
Gets host.- Returns:
- the host
-
setHost
Sets host.- Parameters:
host
- the host
-
getVulnerabilities
Gets vulnerabilities.- Returns:
- the vulnerabilities
-
setVulnerabilities
Sets vulnerabilities.- Parameters:
vulnerabilities
- the vulnerabilities
-
getInfo
Gets info.- Returns:
- the info
-
setInfo
Sets info.- Parameters:
info
- the info
-