Package tenapull.data.entity.scan
Class ScanRemediation
java.lang.Object
tenapull.data.entity.scan.ScanRemediation
- All Implemented Interfaces:
NessusResponse.ResponseChild<ScanRemediation,ScanResponse>
,ScanResponse.ScanResponseChild<ScanRemediation>
,DbPojo
,MapLookupPojo<ScanRemediation>
@Entity(name="ScanRemediation") public class ScanRemediation extends java.lang.Object implements MapLookupPojo<ScanRemediation>, ScanResponse.ScanResponseChild<ScanRemediation>
Represents an object from the remediations array returned by the Nessus API in /scans/<scan-id>
-
Field Summary
Fields Modifier and Type Field Description static MapLookupDao<ScanRemediation>
dao
The dao for ScanRemediation -
Constructor Summary
Constructors Constructor Description ScanRemediation()
-
Method Summary
Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
_getSearchMap()
Return a map to be used by the POJO type's dao, to find the database record matching the same record that this pojo representsboolean
_match(ScanRemediation o)
Determine if this pojo represents the same DB record as another POJO of the same type.void
_prepare()
Perform any operations necessary to prepare this pojo for insertion or updating in the databasevoid
_set(ScanRemediation o)
Set the values in this POJO to be identical to another POJO representing the same DB recordboolean
equals(java.lang.Object o)
RemediationDetails
getDetails()
Gets details.java.lang.Integer
getHosts()
Gets hosts.int
getId()
Get the surrogate or natural primary key id for the lookupScanResponse
getResponse()
Gets parent response.java.lang.Integer
getVulns()
Gets vulns.int
hashCode()
Because this entity cannot have any extraJson (it will all be contained in the RemediationDetails object lookup entity) it must implement hashCode and equals on its own, so its works properly in a HashMap or HashSet.void
setDetails(RemediationDetails details)
Sets details.void
setHosts(java.lang.Integer hosts)
Sets hosts.void
setId(int id)
Set the surrogate or natural primary key id for the lookupvoid
setResponse(ScanResponse response)
Sets parent response.void
setVulns(java.lang.Integer vulns)
Sets vulns.com.fasterxml.jackson.databind.node.ObjectNode
toJsonNode()
Convert the pojo into a JsonNodejava.lang.String
toJsonString()
Convert the pojo into a Json stringjava.lang.String
toString()
-
Field Details
-
dao
The dao for ScanRemediation
-
-
Constructor Details
-
ScanRemediation
public ScanRemediation()
-
-
Method Details
-
toJsonNode
public com.fasterxml.jackson.databind.node.ObjectNode toJsonNode()Description copied from interface:DbPojo
Convert the pojo into a JsonNode- Specified by:
toJsonNode
in interfaceDbPojo
- Returns:
- a JsonNode representing the serialization of this pojo
-
toJsonString
public java.lang.String toJsonString()Description copied from interface:DbPojo
Convert the pojo into a Json string- Specified by:
toJsonString
in interfaceDbPojo
- Returns:
- a string representing the Json serialization of this pojo
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
_prepare
public void _prepare()Description copied from interface:DbPojo
Perform any operations necessary to prepare this pojo for insertion or updating in the database -
_match
Description copied from interface:MapLookupPojo
Determine if this pojo represents the same DB record as another POJO of the same type. Note that this is NOT the same as the equals() method (though it may be in certain cases). Equals may be used to determine if two pojos of the same type contain all of the same values, regardless of whether they represent the same DB record (depending on implementation) while _match determines only if they represent the same DB record even if some of the values may not be equivalent. In many cases the two methods may be the same, but their purpose is different.- Specified by:
_match
in interfaceMapLookupPojo<ScanRemediation>
- Parameters:
o
- the other pojo to match- Returns:
- true if the two pojos represent the same DB record, false if not
-
_getSearchMap
public java.util.Map<java.lang.String,java.lang.Object> _getSearchMap()Description copied from interface:MapLookupPojo
Return a map to be used by the POJO type's dao, to find the database record matching the same record that this pojo represents- Specified by:
_getSearchMap
in interfaceMapLookupPojo<ScanRemediation>
- Returns:
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
_set
Description copied from interface:MapLookupPojo
Set the values in this POJO to be identical to another POJO representing the same DB record- Specified by:
_set
in interfaceMapLookupPojo<ScanRemediation>
-
getId
public int getId()Description copied from interface:DbPojo
Get the surrogate or natural primary key id for the lookup -
setId
public void setId(int id)Description copied from interface:DbPojo
Set the surrogate or natural primary key id for the lookup -
getResponse
Description copied from interface:NessusResponse.ResponseChild
Gets parent response.- Specified by:
getResponse
in interfaceNessusResponse.ResponseChild<ScanRemediation,ScanResponse>
- Returns:
- the response
-
setResponse
Description copied from interface:NessusResponse.ResponseChild
Sets parent response.- Specified by:
setResponse
in interfaceNessusResponse.ResponseChild<ScanRemediation,ScanResponse>
- Parameters:
response
- the response
-
getDetails
Gets details.- Returns:
- the details
-
setDetails
Sets details.- Parameters:
details
- the details
-
getHosts
public java.lang.Integer getHosts()Gets hosts.- Returns:
- the hosts
-
setHosts
public void setHosts(java.lang.Integer hosts)Sets hosts.- Parameters:
hosts
- the hosts
-
getVulns
public java.lang.Integer getVulns()Gets vulns.- Returns:
- the vulns
-
setVulns
public void setVulns(java.lang.Integer vulns)Sets vulns.- Parameters:
vulns
- the vulns
-
hashCode
public int hashCode()Because this entity cannot have any extraJson (it will all be contained in the RemediationDetails object lookup entity) it must implement hashCode and equals on its own, so its works properly in a HashMap or HashSet. The strategy used here is to bitwise XOR the id with the hashcode of ScanRemediation.class- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a hashcode to uniquely identify each ScanRemediation record
-