Class AbstractTokenAPIHandler
- java.lang.Object
-
- co.arago.hiro.client.connection.AbstractAPIHandler
-
- co.arago.hiro.client.connection.AbstractVersionAPIHandler
-
- co.arago.hiro.client.connection.token.AbstractTokenAPIHandler
-
- All Implemented Interfaces:
TokenAPIHandler,java.lang.AutoCloseable
- Direct Known Subclasses:
AbstractRemoteAuthTokenAPIHandler,EnvironmentTokenAPIHandler,FixedTokenAPIHandler
public abstract class AbstractTokenAPIHandler extends AbstractVersionAPIHandler implements TokenAPIHandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractTokenAPIHandler.Conf<T extends AbstractTokenAPIHandler.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 protectedAbstractTokenAPIHandler(AbstractTokenAPIHandler.Conf<?> builder)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToHeaders(HttpHeaderMap headers)Override this to add authentication tokens.voidclose()Close the underlying httpClientHandler.DecodedTokendecodeToken()Decode the payload part of the internal token.-
Methods inherited from class co.arago.hiro.client.connection.AbstractVersionAPIHandler
getApiURIOf, getVersionMap, requestVersionMap
-
Methods inherited from class co.arago.hiro.client.connection.AbstractAPIHandler
addQueryFragmentAndNormalize, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface co.arago.hiro.client.connection.token.TokenAPIHandler
buildWebSocketURI, checkResponse, expiryInstant, getApiURIOf, getConf, getOrBuildClient, getRootApiURI, getToken, getUserAgent, getVersionMap, hasRefreshToken, hasToken, refreshToken, revokeToken
-
-
-
-
Constructor Detail
-
AbstractTokenAPIHandler
protected AbstractTokenAPIHandler(AbstractTokenAPIHandler.Conf<?> builder)
Constructor- Parameters:
builder- The builder to use.
-
-
Method Detail
-
addToHeaders
public void addToHeaders(HttpHeaderMap headers)
Override this to add authentication tokens. TokenHandlers do not have tokens, so this only returns default headers.- Specified by:
addToHeadersin interfaceTokenAPIHandler- Specified by:
addToHeadersin classAbstractAPIHandler- Parameters:
headers- Map of headers with initial values.
-
decodeToken
public DecodedToken decodeToken() throws HiroException, java.io.IOException, java.lang.InterruptedException
Decode the payload part of the internal token.- Specified by:
decodeTokenin interfaceTokenAPIHandler- Returns:
- Decoded token as
DecodedToken. - Throws:
java.lang.InterruptedException- When call gets interrupted.java.io.IOException- When call has IO errors.HiroException- On Hiro protocol / handling errors.
-
close
public void close()
Close the underlying httpClientHandler.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceTokenAPIHandler
-
-