Class QualysCSClient
- java.lang.Object
-
- com.qualys.plugins.containerSecurity.common.QualysClient.QualysCSClient
-
public class QualysCSClient extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected PrintStreamstreamprotected inttimeout
-
Constructor Summary
Constructors Constructor Description QualysCSClient(QualysAuth auth)QualysCSClient(QualysAuth auth, PrintStream stream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URLgetAbsoluteUrl(String path)protected StringgetAuthEndpoint(Map<String,String> apiMap)protected byte[]getAuthEntity()protected Map<String,String>getAuthHeaders()protected byte[]getBasicAuthJWTEncodedEntity()protected org.apache.http.impl.client.CloseableHttpClientgetHttpClient()QualysCSResponsegetImageDetails(String imageSha)QualysCSResponsegetImages(String imageSha, long nowMinusSeconds)voidsetTimeout(int timeout)This method use to set connection timeout for http client.QualysCSTestConnectionResponsetestConnection()
-
-
-
Field Detail
-
stream
protected PrintStream stream
-
timeout
protected int timeout
-
-
Constructor Detail
-
QualysCSClient
public QualysCSClient(QualysAuth auth)
-
QualysCSClient
public QualysCSClient(QualysAuth auth, PrintStream stream)
-
-
Method Detail
-
getImageDetails
public QualysCSResponse getImageDetails(String imageSha)
-
getImages
public QualysCSResponse getImages(String imageSha, long nowMinusSeconds) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
testConnection
public QualysCSTestConnectionResponse testConnection()
-
getAbsoluteUrl
public URL getAbsoluteUrl(String path) throws MalformedURLException
- Throws:
MalformedURLException
-
getAuthHeaders
protected Map<String,String> getAuthHeaders() throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
getAuthEntity
protected byte[] getAuthEntity() throws UnsupportedEncodingException- Throws:
UnsupportedEncodingException
-
getBasicAuthJWTEncodedEntity
protected byte[] getBasicAuthJWTEncodedEntity() throws UnsupportedEncodingException- Throws:
UnsupportedEncodingException
-
getHttpClient
protected org.apache.http.impl.client.CloseableHttpClient getHttpClient()
-
setTimeout
public void setTimeout(int timeout)
This method use to set connection timeout for http client.- Parameters:
timeout- - int - in secs
-
-