Class FodApiConnection
- java.lang.Object
-
- org.jenkinsci.plugins.fodupload.FodApi.FodApiConnection
-
public class FodApiConnection extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_SIZE
-
Constructor Summary
Constructors Constructor Description FodApiConnection(String id, String secret, String baseUrl, String apiUrl, FodEnums.GrantType grantType, String scope, boolean executeOnRemoteAgent, Launcher launcher, PrintStream logger)Constructor that encapsulates the apiConnection
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetApiUrl()StringgetBaseUrl()DastScanPayloadUploadgetDastScanPayloadUploadInstance(FilePath uploadFile, String releaseId, String apiUri, String correlationId, PrintStream logger)StringgetId()ScanPayloadUploadgetScanPayloadUploadInstance(SastJobModel uploadRequest, String correlationId, String fragUrl, PrintStream logger)StringgetSecret()<T> TparseResponse(ResponseContent response, Type t)ResponseContentrequest(okhttp3.Request request)ResponseContentrequest(HttpRequest request)<T> TrequestTyped(okhttp3.Request request, Type t)<T> TrequestTyped(HttpRequest request, Type t)voidretireToken()Retire the current token.StringtestConnection()okhttp3.HttpUrl.BuilderurlBuilder()
-
-
-
Field Detail
-
MAX_SIZE
public static final int MAX_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FodApiConnection
public FodApiConnection(String id, String secret, String baseUrl, String apiUrl, FodEnums.GrantType grantType, String scope, boolean executeOnRemoteAgent, Launcher launcher, PrintStream logger)
Constructor that encapsulates the apiConnection- Parameters:
id- apiConnection idsecret- apiConnection secretbaseUrl- apiConnection baseUrl
-
-
Method Detail
-
retireToken
public void retireToken() throws IOExceptionRetire the current token. Unclear if this actually does anything on the backend.- Throws:
IOException
-
testConnection
public String testConnection() throws IOException
- Throws:
IOException
-
getId
public String getId()
-
getSecret
public String getSecret()
-
getBaseUrl
public String getBaseUrl()
-
getApiUrl
public String getApiUrl()
-
urlBuilder
public okhttp3.HttpUrl.Builder urlBuilder()
-
request
public ResponseContent request(okhttp3.Request request) throws IOException
- Throws:
IOException
-
request
public ResponseContent request(HttpRequest request) throws IOException
- Throws:
IOException
-
requestTyped
public <T> T requestTyped(okhttp3.Request request, Type t) throws IOException- Throws:
IOException
-
requestTyped
public <T> T requestTyped(HttpRequest request, Type t) throws IOException
- Throws:
IOException
-
parseResponse
public <T> T parseResponse(ResponseContent response, Type t) throws IOException
- Throws:
IOException
-
getScanPayloadUploadInstance
public ScanPayloadUpload getScanPayloadUploadInstance(SastJobModel uploadRequest, String correlationId, String fragUrl, PrintStream logger) throws IOException
- Throws:
IOException
-
getDastScanPayloadUploadInstance
public DastScanPayloadUpload getDastScanPayloadUploadInstance(FilePath uploadFile, String releaseId, String apiUri, String correlationId, PrintStream logger) throws IOException
- Throws:
IOException
-
-