Package ubic.gemma.core.util
Class GemmaRestApiClientImpl
- java.lang.Object
-
- ubic.gemma.core.util.GemmaRestApiClientImpl
-
- All Implemented Interfaces:
GemmaRestApiClient
public class GemmaRestApiClientImpl extends Object implements GemmaRestApiClient
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ubic.gemma.core.util.GemmaRestApiClient
GemmaRestApiClient.DataResponse, GemmaRestApiClient.EmptyResponse, GemmaRestApiClient.ErrorResponse, GemmaRestApiClient.Response
-
-
Constructor Summary
Constructors Constructor Description GemmaRestApiClientImpl(String hostUrl)
GemmaRestApiClientImpl(String hostUrl, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Concrete 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, org.springframework.util.MultiValueMap<String,Object> params)
Access a given endpoint REST endpoint with parameters.void
setAuthentication(String username, String password)
Set the authentication credentials used by this client.
-
-
-
Method Detail
-
setAuthentication
public void setAuthentication(String username, String password)
Set the authentication credentials used by this client.- Specified by:
setAuthentication
in interfaceGemmaRestApiClient
-
clearAuthentication
public void clearAuthentication()
Description copied from interface:GemmaRestApiClient
Clear any credentials.- Specified by:
clearAuthentication
in interfaceGemmaRestApiClient
-
perform
public GemmaRestApiClient.Response perform(String endpoint) throws IOException
Description copied from interface:GemmaRestApiClient
Access a given REST endpoint.- Specified by:
perform
in interfaceGemmaRestApiClient
- Throws:
IOException
-
perform
public GemmaRestApiClient.Response perform(String endpoint, org.springframework.util.MultiValueMap<String,Object> params) throws IOException
Description copied from interface:GemmaRestApiClient
Access a given endpoint REST endpoint with parameters.- Specified by:
perform
in interfaceGemmaRestApiClient
- Throws:
IOException
- if anything goes wrong with I/O including issues with JSON deserialization
-
perform
public GemmaRestApiClient.Response perform(String endpoint, String firstParamName, Object firstParamValue, Object... otherParams) throws IOException
- Specified by:
perform
in interfaceGemmaRestApiClient
- Throws:
IOException
-
-