Package ubic.gemma.core.util
Interface GemmaRestApiClient
-
- All Known Implementing Classes:
GemmaRestApiClientImpl
public interface GemmaRestApiClient
A minimalist client for accessing Gemma's RESTful API.- Author:
- poirigui
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
GemmaRestApiClient.DataResponse
static interface
GemmaRestApiClient.EmptyResponse
For endpoints that return no data (i.e.static interface
GemmaRestApiClient.ErrorResponse
static interface
GemmaRestApiClient.Redirection
For endpoint that return a redirection.static interface
GemmaRestApiClient.Response
A response from the API, which is either aGemmaRestApiClient.DataResponse
orGemmaRestApiClient.ErrorResponse
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clearAuthentication()
Clear any credentials.GemmaRestApiClient.Response
perform(String endpoint)
Access a given REST endpoint.GemmaRestApiClient.Response
perform(String endpoint, String firstParamName, Object firstParamValue, Object... otherParams)
GemmaRestApiClient.Response
perform(String endpoint, MultiValueMap<String,Object> params)
Access a given endpoint REST endpoint with parameters.void
setAuthentication(String username, String password)
Set credentials used for authenticating API requests.
-
-
-
Method Detail
-
perform
GemmaRestApiClient.Response perform(String endpoint) throws IOException
Access a given REST endpoint.- Throws:
IOException
-
perform
GemmaRestApiClient.Response perform(String endpoint, MultiValueMap<String,Object> params) throws IOException
Access a given endpoint REST endpoint with parameters.- Throws:
IOException
- if anything goes wrong with I/O including issues with JSON deserialization
-
perform
GemmaRestApiClient.Response perform(String endpoint, String firstParamName, Object firstParamValue, Object... otherParams) throws IOException
- Throws:
IOException
-
setAuthentication
void setAuthentication(String username, String password)
Set credentials used for authenticating API requests.
-
clearAuthentication
void clearAuthentication()
Clear any credentials.
-
-