Package tenapull.client
Class NessusClient
java.lang.Object
tenapull.client.GenericClient
tenapull.client.NessusClient
public class NessusClient extends GenericClient
The NessusClient for fetching response from a specific Nessus installation provided in the configurations
first parsed by Main
-
Field Summary
Fields Modifier and Type Field Description static boolean
ACCEPT_ANY_SSL
Whether to accept any SSL certificatestatic java.lang.String
API_URL
Url of the Nessus installation's API which will be queried -
Constructor Summary
Constructors Constructor Description NessusClient()
Instantiates a new Nessus client using the ACCEPT_ANY_SSL parameter as provided in the configuration file -
Method Summary
Modifier and Type Method Description <R> R
fetchJson(java.lang.String pathOnly, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.Class<R> mapToType, com.fasterxml.jackson.databind.ObjectMapper mapper)
A convenience method which automatically includes the API access keys in the HTTP header, and adds the full protocol, domain name, and port (if applicable) to the URL.Methods inherited from class tenapull.client.GenericClient
fetch, fetch, fetch, fetch, fetchJson, fetchJson, fetchJson, fetchJson, getResponse
-
Field Details
-
API_URL
public static final java.lang.String API_URLUrl of the Nessus installation's API which will be queried -
ACCEPT_ANY_SSL
public static final boolean ACCEPT_ANY_SSLWhether to accept any SSL certificate
-
-
Constructor Details
-
NessusClient
public NessusClient()Instantiates a new Nessus client using the ACCEPT_ANY_SSL parameter as provided in the configuration file
-
-
Method Details
-
fetchJson
public <R> R fetchJson(java.lang.String pathOnly, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.Class<R> mapToType, com.fasterxml.jackson.databind.ObjectMapper mapper) throws com.fasterxml.jackson.core.JsonProcessingExceptionA convenience method which automatically includes the API access keys in the HTTP header, and adds the full protocol, domain name, and port (if applicable) to the URL. NOTE: DO NOT INCLUDE THE PROTOCOL, DOMAIN NAME, AND PORT IN THE URL PASSED TO THIS METHOD.
Also note that due to the way overloaded fetchJson methods are invoked in the GenericClient, this method is the end-point method for all the fetchJson methods inherited from GenericClient.- Overrides:
fetchJson
in classGenericClient
- Type Parameters:
R
-- Parameters:
pathOnly
- the path of the resource to be fetched. Do not include protocol, domain, or portheaders
- Additional HTTP headers to includemapToType
- the type to convert the returned JSON intomapper
- the Jackson ObjectMapper to use- Returns:
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-