public class WssServiceClientImpl extends Object implements WssServiceClient
| Modifier and Type | Field and Description |
|---|---|
protected int |
connectionTimeout |
protected com.google.gson.Gson |
gson |
protected org.apache.http.impl.client.CloseableHttpClient |
httpClient |
protected String |
serviceUrl |
static String |
SOME_PASSWORD |
| Constructor and Description |
|---|
WssServiceClientImpl()
Default constructor
|
WssServiceClientImpl(String serviceUrl)
Constructor
|
WssServiceClientImpl(String serviceUrl,
boolean setProxy)
Constructor
|
WssServiceClientImpl(String serviceUrl,
boolean setProxy,
int connectionTimeoutMinutes) |
WssServiceClientImpl(String serviceUrl,
boolean setProxy,
int connectionTimeoutMinutes,
boolean ignoreCertificateCheck)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
CheckPoliciesResult |
checkPolicies(CheckPoliciesRequest request)
The method call the White Source service for checking policies application.
|
CheckPolicyComplianceResult |
checkPolicyCompliance(CheckPolicyComplianceRequest request)
The method call the White Source service for checking policies application.
|
CheckVulnerabilitiesResult |
checkVulnerabilities(CheckVulnerabilitiesRequest request)
The method calls the White Source service for check vulnerabilities.
|
protected <R> org.apache.http.client.methods.HttpRequestBase |
createHttpRequest(ServiceRequest<R> request)
The method create the HTTP post request to be sent to the remote service.
|
protected String |
extractResultData(String response)
The method extract the data from the given
ResultEnvelope. |
int |
getConnectionTimeout() |
GetDependencyDataResult |
getDependencyData(GetDependencyDataRequest request)
The method call the White Source service for getting additional dependency data.
|
org.apache.http.client.HttpClient |
getHttpClient() |
String |
getServiceUrl() |
protected <R> R |
service(ServiceRequest<R> request)
The method service the given request.
|
void |
setConnectionTimeout(int timeout)
The method adjust the connection timeout limit to White Source servers.
|
void |
setProxy(String host,
int port,
String username,
String password)
The method configure the client to use a proxy specified by the given parameters.
|
void |
shutdown() |
SummaryScanResult |
summaryScan(SummaryScanRequest request)
The method calls the White Source service for inventory update.
|
UpdateInventoryResult |
updateInventory(UpdateInventoryRequest request)
The method calls the White Source service for inventory update.
|
public static final String SOME_PASSWORD
protected String serviceUrl
protected org.apache.http.impl.client.CloseableHttpClient httpClient
protected com.google.gson.Gson gson
protected int connectionTimeout
public WssServiceClientImpl()
public WssServiceClientImpl(String serviceUrl)
serviceUrl - WhiteSource service URL to use.public WssServiceClientImpl(String serviceUrl, boolean setProxy)
serviceUrl - WhiteSource service URL to use.setProxy - WhiteSource set proxy, whether the proxy settings defined or not.public WssServiceClientImpl(String serviceUrl, boolean setProxy, int connectionTimeoutMinutes)
public WssServiceClientImpl(String serviceUrl, boolean setProxy, int connectionTimeoutMinutes, boolean ignoreCertificateCheck)
serviceUrl - WhiteSource service URL to use.setProxy - WhiteSource set proxy, whether the proxy settings is defined or not.connectionTimeoutMinutes - WhiteSource connection timeout, whether the connection timeout is defined or not (default to 60 minutes).public UpdateInventoryResult updateInventory(UpdateInventoryRequest request) throws WssServiceException
WssServiceClientupdateInventory in interface WssServiceClientrequest - Inventory update request.WssServiceException - In case an error occurred during the call to White Source server.public CheckPoliciesResult checkPolicies(CheckPoliciesRequest request) throws WssServiceException
WssServiceClientcheckPolicies in interface WssServiceClientrequest - Check Policies request.WssServiceException - In case an error occurred during the call to White Source server.public CheckPolicyComplianceResult checkPolicyCompliance(CheckPolicyComplianceRequest request) throws WssServiceException
WssServiceClientcheckPolicyCompliance in interface WssServiceClientrequest - Check Policies request.WssServiceException - In case an error occurred during the call to White Source server.public GetDependencyDataResult getDependencyData(GetDependencyDataRequest request) throws WssServiceException
WssServiceClientgetDependencyData in interface WssServiceClientrequest - Get Dependency Data request.WssServiceException - In case an error occurred during the call to White Source server.public SummaryScanResult summaryScan(SummaryScanRequest request) throws WssServiceException
WssServiceClientsummaryScan in interface WssServiceClientrequest - Inventory update request.WssServiceException - In case an error occurred during the call to White Source server.public CheckVulnerabilitiesResult checkVulnerabilities(CheckVulnerabilitiesRequest request) throws WssServiceException
WssServiceClientcheckVulnerabilities in interface WssServiceClientrequest - Check vulnerabilities request.WssServiceException - In case an error occurred during the call to White Source server.public void shutdown()
shutdown in interface WssServiceClientpublic void setProxy(String host, int port, String username, String password)
WssServiceClientsetProxy in interface WssServiceClienthost - Proxy host address.port - Proxy port.username - Optional. Proxy username.password - Optional. Proxy password.public void setConnectionTimeout(int timeout)
WssServiceClientsetConnectionTimeout in interface WssServiceClienttimeout - In milliseconds.protected <R> R service(ServiceRequest<R> request) throws WssServiceException
request - Request to serve.WssServiceException - In case of errors while serving the request.protected <R> org.apache.http.client.methods.HttpRequestBase createHttpRequest(ServiceRequest<R> request) throws IOException
request - Request to service.IOException - In case of error creating the request.protected String extractResultData(String response) throws IOException, WssServiceException
ResultEnvelope.response - HTTP response as string.IOExceptionWssServiceExceptionpublic String getServiceUrl()
public org.apache.http.client.HttpClient getHttpClient()
public int getConnectionTimeout()
Copyright © 2011-2018 White Source. All Rights Reserved.