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>daoThe dao for ScanHostResponsestatic org.apache.logging.log4j.LoggerloggerThe 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 databaseScanHostgetHost()Gets host.ScanHostInfogetInfo()Gets info.ScanResponsegetOrFetchScanResponse()Gets the scan response corresponding the scanHost this ScanHostResponse is related to.java.lang.StringgetUrlPath()Gets url path for the Nessus APIstatic java.lang.StringgetUrlPath(int scanId, int hostId)Gets url path for the responsestatic java.lang.StringgetUrlPath(ScanHost host)Gets url path for a provided ScanHostjava.util.List<Vulnerability>getVulnerabilities()Gets vulnerabilities.voidsetHost(ScanHost host)Sets host.voidsetInfo(ScanHostInfo info)Sets info.voidsetScanResponse(ScanResponse scanResponse)Sets scan response.voidsetVulnerabilities(java.util.List<Vulnerability> vulnerabilities)Sets vulnerabilities.Methods inherited from class tenapull.data.entity.response.NessusResponseGenerateTimestamp
getTimestamp, setTimestampMethods inherited from class tenapull.data.entity.template.NaturalIdPojo
__set, equals, getId, hashCode, setIdMethods inherited from class tenapull.data.entity.template.ExtensibleJsonPojo
__prepare, getExtraJson, getExtraJson, getExtraJsonMap, putExtraJson, setExtraJson, toJsonNode, toJsonString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:NessusResponseGets url path for the Nessus API- Specified by:
getUrlPathin interfaceNessusResponse- Specified by:
getUrlPathin classNessusResponseGenerateTimestamp- Returns:
- the url path
- Throws:
java.lang.IllegalStateException
-
_prepare
public void _prepare()Description copied from interface:DbPojoPerform 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
-