Package com.qualys.plugins.pc.client
Class QualysPCClient
- java.lang.Object
-
- com.qualys.plugins.pc.client.QualysPCClient
-
public class QualysPCClient extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected PrintStream
stream
protected int
timeout
-
Constructor Summary
Constructors Constructor Description QualysPCClient(QualysAuth auth)
QualysPCClient(QualysAuth auth, PrintStream stream)
QualysPCClient(QualysAuth auth, PrintStream stream, int pollingInterval, int vulTimeout, TaskListener listener)
-
Method Summary
-
-
-
Field Detail
-
stream
protected PrintStream stream
-
timeout
protected int timeout
-
-
Constructor Detail
-
QualysPCClient
public QualysPCClient(QualysAuth auth)
-
QualysPCClient
public QualysPCClient(QualysAuth auth, PrintStream stream)
-
QualysPCClient
public QualysPCClient(QualysAuth auth, PrintStream stream, int pollingInterval, int vulTimeout, TaskListener listener)
-
-
Method Detail
-
scannerName
public com.google.gson.JsonObject scannerName(boolean useHost) throws Exception
- Throws:
Exception
-
optionProfiles
public QualysPCResponse optionProfiles() throws Exception
- Throws:
Exception
-
updatePolicies
public QualysPCResponse updatePolicies(String apiParams) throws Exception
- Throws:
Exception
-
updateAssetGroup
public QualysPCResponse updateAssetGroup(String assetGroupId, String ipAddress) throws Exception
- Throws:
Exception
-
listAssetGroup
public QualysPCResponse listAssetGroup(String apiParams) throws Exception
- Throws:
Exception
-
createAssetGroup
public QualysPCResponse createAssetGroup(String job_name, String ipAddress) throws Exception
- Throws:
Exception
-
updateWindowsAuthRecord
public QualysPCResponse updateWindowsAuthRecord(String apiParams, String recordId) throws Exception
- Throws:
Exception
-
updateUnixAuthRecord
public QualysPCResponse updateUnixAuthRecord(String apiParams, String recordId) throws Exception
- Throws:
Exception
-
createUnixAuthRecord
public QualysPCResponse createUnixAuthRecord(String apiParams, String job_name) throws Exception
- Throws:
Exception
-
createWindowsAuthRecord
public QualysPCResponse createWindowsAuthRecord(String apiParams, String job_name) throws Exception
- Throws:
Exception
-
listUnixAuthRecord
public QualysPCResponse listUnixAuthRecord(String title) throws Exception
- Throws:
Exception
-
listWindowsAuthRecord
public QualysPCResponse listWindowsAuthRecord(String title) throws Exception
- Throws:
Exception
-
addHost
public QualysPCResponse addHost(String ip) throws Exception
- Throws:
Exception
-
launchPcScan
public QualysPCResponse launchPcScan(String requestData) throws Exception
- Throws:
Exception
-
cancelPcScan
public QualysPCResponse cancelPcScan(String scanRef) throws Exception
- Throws:
Exception
-
pCScansList
public QualysPCResponse pCScansList(String statusId) throws Exception
- Throws:
Exception
-
getReportResult
public QualysPCResponse getReportResult(String apiParams) throws Exception
- Throws:
Exception
-
getPCScanResult
public QualysPCResponse getPCScanResult(String scanRef) throws Exception
- Throws:
Exception
-
aboutDotPhp
public QualysPCResponse aboutDotPhp() throws Exception
- Throws:
Exception
-
testConnectionUsingGatewayAPI
public void testConnectionUsingGatewayAPI() throws Exception
- Throws:
Exception
-
runConnector
public com.google.gson.JsonObject runConnector(String connId) throws Exception
- Throws:
Exception
-
getConnectorStatus
public com.google.gson.JsonObject getConnectorStatus(String connId2) throws Exception
- Throws:
Exception
-
getInstanceState
public com.google.gson.JsonObject getInstanceState(String ec2Id, String accountId) throws Exception
- Throws:
Exception
-
optionProfilesSet
public Set<String> optionProfilesSet(Document resp, int respCode, String apiTypeName) throws Exception
- Throws:
Exception
-
getTextValueOfXml
public String getTextValueOfXml(Document doc, String topNode, String topPath, String innerNode, String innerPath, String message) throws Exception
- Throws:
Exception
-
getAbsoluteUrl
public URL getAbsoluteUrl(String path) throws MalformedURLException
- Throws:
MalformedURLException
-
getAbsoluteUrlForTestConnection
public URL getAbsoluteUrlForTestConnection(String path) throws MalformedURLException
- Throws:
MalformedURLException
-
getJWTAuthHeader
protected byte[] getJWTAuthHeader() throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
getBasicAuthHeader
protected String getBasicAuthHeader()
-
getHttpClient
protected org.apache.http.impl.client.CloseableHttpClient getHttpClient() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException
-
setTimeout
public void setTimeout(int timeout)
This method use to set connection timeout for http client.- Parameters:
timeout
- - int - in secs
-
-