Package co.arago.hiro.client.connection
Class AbstractVersionAPIHandler
- java.lang.Object
-
- co.arago.util.validation.RequiredFieldChecks
-
- co.arago.hiro.client.connection.AbstractAPIHandler
-
- co.arago.hiro.client.connection.AbstractClientAPIHandler
-
- co.arago.hiro.client.connection.AbstractVersionAPIHandler
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Direct Known Subclasses:
AbstractTokenAPIHandler
public abstract class AbstractVersionAPIHandler extends AbstractClientAPIHandler
Handles Version information for HIRO.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractVersionAPIHandler.Conf<T extends AbstractVersionAPIHandler.Conf<T>>-
Nested classes/interfaces inherited from class co.arago.hiro.client.connection.AbstractClientAPIHandler
AbstractClientAPIHandler.ProxySpec
-
Nested classes/interfaces inherited from class co.arago.hiro.client.connection.AbstractAPIHandler
AbstractAPIHandler.GetterConf
-
-
Field Summary
-
Fields inherited from class co.arago.hiro.client.connection.AbstractClientAPIHandler
connectTimeout, externalHttpClient, followRedirects, httpClient, httpLogger, maxConnectionPool, proxy, sslContext, sslParameters
-
Fields inherited from class co.arago.hiro.client.connection.AbstractAPIHandler
apiUrl, httpRequestTimeout, maxRetries, title, userAgent, version, webSocketUri
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractVersionAPIHandler(AbstractVersionAPIHandler.Conf<?> builder)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.URIgetApiUriOf(java.lang.String apiName)Determine the API URI path for a named API.VersionResponsegetVersionMap()Returns the currentversionMap.protected VersionResponserequestVersionMap()Get API Versions-
Methods inherited from class co.arago.hiro.client.connection.AbstractClientAPIHandler
close, getHttpLogger, getOrBuildClient
-
Methods inherited from class co.arago.hiro.client.connection.AbstractAPIHandler
addQueryAndFragment, addToHeaders, buildApiURI, buildEndpointURI, buildURI, buildWebSocketURI, checkResponse, delete, executeAsyncWithStreamBody, executeAsyncWithStringBody, executeBinary, executeWithStreamBody, executeWithStringBody, get, getApiUrl, getBinary, getHttpRequestTimeout, getMaxRetries, getRequestBuilder, getUserAgent, getWebSocketUri, patch, patchBinary, post, postBinary, put, putBinary, send, sendAsync
-
-
-
-
Constructor Detail
-
AbstractVersionAPIHandler
protected AbstractVersionAPIHandler(AbstractVersionAPIHandler.Conf<?> builder)
Constructor- Parameters:
builder- The builder to use.
-
-
Method Detail
-
requestVersionMap
protected VersionResponse requestVersionMap() throws java.io.IOException, java.lang.InterruptedException, HiroException
Get API VersionsHIRO REST query API: `GET
AbstractAPIHandler.apiUrl+ '/api/version'`- Returns:
- A map with the api versions
- Throws:
HiroException- When the request fails.java.io.IOException- When the connection fails.java.lang.InterruptedException- When interrupted.
-
getVersionMap
public VersionResponse getVersionMap() throws HiroException, java.io.IOException, java.lang.InterruptedException
Returns the currentversionMap. If noversionMapis available, it will be requested, cached and then returned.- Returns:
- The (cached) versionMap.
- Throws:
HiroException- When the request fails.java.io.IOException- When the connection fails.java.lang.InterruptedException- When interrupted.
-
getApiUriOf
public java.net.URI getApiUriOf(java.lang.String apiName) throws java.io.IOException, java.lang.InterruptedException, HiroExceptionDetermine the API URI path for a named API.- Parameters:
apiName- Name of the API- Returns:
- The URI for that API
- Throws:
HiroException- When the request fails.java.io.IOException- When the connection fails.java.lang.InterruptedException- When interrupted.
-
-