Package co.arago.hiro.client.connection
Class AbstractVersionAPIHandler
- java.lang.Object
-
- co.arago.hiro.client.connection.AbstractAPIHandler
-
- co.arago.hiro.client.connection.AbstractVersionAPIHandler
-
- Direct Known Subclasses:
AbstractTokenAPIHandler,GraphConnectionHandler
public abstract class AbstractVersionAPIHandler extends AbstractAPIHandler
Handles Version information for HIRO.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractVersionAPIHandler.Conf<T extends AbstractVersionAPIHandler.Conf<T>>
-
Field Summary
-
Fields inherited from class co.arago.hiro.client.connection.AbstractAPIHandler
httpClientHandler, httpRequestTimeout, maxRetries, rootApiURI, 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.AbstractAPIHandler
addQueryFragmentAndNormalize, addToHeaders, buildApiURI, buildEndpointURI, buildURI, buildWebSocketURI, checkResponse, delete, executeAsyncWithStreamBody, executeAsyncWithStringBody, executeBinary, executeWithStreamBody, executeWithStringBody, get, getBinary, getConf, getHttpLogger, getHttpRequestTimeout, getMaxRetries, getOrBuildClient, getRequestBuilder, getRootApiURI, 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.rootApiURI+ '/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. if asharedConnectionHandleris set, the versionMap will be obtained from there.- 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.
-
-