public class APIKeyClient extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
getApiKey(String serverHost,
int serverPort,
String apiKeyName)
Retrieves the specified api key from the specified server.
|
static String |
getApiKey(String serverHost,
int serverPort,
String apiKeyName,
int responseTimeoutInMilliSeconds)
Retrieves the specified api key from the specified server.
|
static String |
getApiKey(String serverHost,
String apiKeyName)
Retrieves the specified api key from the specified server.
|
public static String getApiKey(String serverHost, String apiKeyName) throws InternalServerException, TimeoutException, IOException
serverHost - The host address of the server.apiKeyName - The name of the api key to retrievenull in case of unexpected errors.IOException - In case the connection with the server cannot be established or the received key cannot be decrypted.TimeoutException - If the server takes more than 10 seconds time to respond.InternalServerException - If something went wrong on the server sidepublic static String getApiKey(String serverHost, int serverPort, String apiKeyName) throws TimeoutException, InternalServerException, IOException
serverHost - The host address of the server.serverPort - The port that the server is running onapiKeyName - The name of the api key to retrievenull in case of unexpected errors.IOException - In case the connection with the server cannot be established or the received key cannot be decrypted.TimeoutException - If the server takes more than 10 seconds time to respond.InternalServerException - If something went wrong on the server sidepublic static String getApiKey(String serverHost, int serverPort, String apiKeyName, int responseTimeoutInMilliSeconds) throws IOException, TimeoutException, InternalServerException
serverHost - The host address of the server.serverPort - The port that the server is running onapiKeyName - The name of the api key to retrieveresponseTimeoutInMilliSeconds - Time in milliseconds after which the request is aborted if no response was received from the server.null in case of unexpected errors.IOException - In case the connection with the server cannot be established or the received key cannot be decrypted.TimeoutException - If the server takes more than the specified time to respond.InternalServerException - If something went wrong on the server sideCopyright © 2016–2018 Frederik Kammel. All rights reserved.