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 ClassesModifier and TypeInterfaceDescriptionstatic interface
static interface
For endpoints that return no data (i.e. a 201 No Content reply code).static interface
For endpoints that may return an error.static interface
A response from the API, which is either aGemmaRestApiClient.DataResponse
orGemmaRestApiClient.ErrorResponse
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear any credentials.Access a given REST endpoint.Access a given endpoint REST endpoint with parameters.void
setAuthentication
(org.springframework.security.core.Authentication authentication) Set credentials used for authenticating API requests.
-
Method Details
-
getHostUrl
String getHostUrl() -
perform
Access a given REST endpoint.- Throws:
IOException
-
perform
GemmaRestApiClient.Response perform(String endpoint, org.springframework.util.MultiValueMap<String, Object> params) throws IOExceptionAccess 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(org.springframework.security.core.Authentication authentication) Set credentials used for authenticating API requests. -
clearAuthentication
void clearAuthentication()Clear any credentials.
-