public class FoDAPI extends Object
| Constructor and Description |
|---|
FoDAPI() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
authorize()
Authenticates against FoD API and caches session token.
|
boolean |
authorize(String clientId,
String clientSecret)
Authenticates against FoD API and caches session token.
|
protected StringBuffer |
collectInputStream(InputStream is) |
String |
encodeURLParamUTF8(String param) |
Map<String,String> |
getApplicationList() |
Map<String,String> |
getAssessmentTypeListWithRetry() |
String |
getBaseUrl() |
protected com.google.gson.JsonArray |
getDataJsonArray(StringBuffer response) |
protected com.google.gson.JsonElement |
getDataJsonElement(String responseString) |
protected com.google.gson.Gson |
getGson() |
protected HttpURLConnection |
getHttpUrlConnection(String requestMethod,
URL url) |
Proxy |
getProxy() |
Release |
getRelease(Long releaseId) |
Release |
getRelease(String applicationName,
String releaseName)
Retrieves release info base on application name and release name.
|
Long |
getReleaseId(String applicationName,
String releaseName) |
List<Release> |
getReleaseList()
Retrieves all releases for the tenant, with a limited number of fields populated.
|
List<Release> |
getReleaseList(Long applicationId)
Retrieves all releases for a given application name, with a limited number of fields populated.
|
List<Release> |
getReleaseList(String applicationName)
Retrieves all releases for a given application name, with a limited number of fields populated.
|
Scan |
getScan(Long releaseId,
Long scanId)
Retrieves information on a single scan, given a release and scan ID.
|
List<ScanSnapshot> |
getScanSnapshotList()
Scan snapshot refers to a particular point in history when statistics are
reevaluated, such as when a scan is completed.
|
List<ScanSnapshot> |
getScanSnapshotList(Long releaseId)
Scan snapshot refers to a particular point in history when statistics are
reevaluated, such as when a scan is completed.
|
boolean |
isLoggedIn() |
String |
sendData(String endpointData,
byte[] data,
long len,
long frag,
long offset) |
void |
setBaseUrl(String baseUrl) |
void |
setPrincipal(String clientId,
String clientSecret) |
void |
setProxy(Proxy proxy) |
void |
setProxy(String hostname,
int port) |
UploadStatus |
uploadFile(UploadRequest req)
If relaseId not on request object, looks up release ID based on application and
release names, then tries to upload.
|
public String encodeURLParamUTF8(String param) throws UnsupportedEncodingException
param - UnsupportedEncodingExceptionpublic boolean authorize(String clientId, String clientSecret) throws IOException
clientId - clientSecret - IOExceptionpublic boolean authorize()
throws IOException
IOExceptionpublic boolean isLoggedIn()
public Map<String,String> getApplicationList() throws IOException
IOExceptionpublic Long getReleaseId(String applicationName, String releaseName) throws IOException
IOExceptionpublic Release getRelease(Long releaseId) throws IOException
IOExceptionpublic Release getRelease(String applicationName, String releaseName) throws IOException
applicationName - releaseName - IOExceptionpublic List<Release> getReleaseList() throws IOException
IOExceptionpublic List<Release> getReleaseList(String applicationName) throws IOException
applicationName - IOExceptionpublic List<Release> getReleaseList(Long applicationId) throws IOException
applicationId - IOExceptionpublic Map<String,String> getAssessmentTypeListWithRetry() throws IOException
IOExceptionpublic List<ScanSnapshot> getScanSnapshotList() throws IOException
IOExceptionpublic List<ScanSnapshot> getScanSnapshotList(Long releaseId) throws IOException
IOExceptionpublic Scan getScan(Long releaseId, Long scanId) throws IOException
releaseId - scanId - IOExceptionpublic UploadStatus uploadFile(UploadRequest req) throws IOException
req - IOExceptionpublic String getBaseUrl()
public void setBaseUrl(String baseUrl)
public Proxy getProxy()
public void setProxy(Proxy proxy)
public void setProxy(String hostname, int port)
protected HttpURLConnection getHttpUrlConnection(String requestMethod, URL url) throws IOException
IOExceptionprotected StringBuffer collectInputStream(InputStream is) throws IOException
IOExceptionprotected com.google.gson.JsonArray getDataJsonArray(StringBuffer response)
protected com.google.gson.JsonElement getDataJsonElement(String responseString)
protected com.google.gson.Gson getGson()
Copyright © 2004-2016. All Rights Reserved.