Class PasswordAuthTokenAPIHandler.Conf<T extends PasswordAuthTokenAPIHandler.Conf<T>>
- java.lang.Object
-
- co.arago.hiro.client.connection.AbstractAPIHandler.Conf<T>
-
- co.arago.hiro.client.connection.AbstractClientAPIHandler.Conf<T>
-
- co.arago.hiro.client.connection.AbstractVersionAPIHandler.Conf<T>
-
- co.arago.hiro.client.connection.token.AbstractTokenAPIHandler.Conf<T>
-
- co.arago.hiro.client.connection.token.PasswordAuthTokenAPIHandler.Conf<T>
-
- All Implemented Interfaces:
AbstractAPIHandler.GetterConf
- Direct Known Subclasses:
PasswordAuthTokenAPIHandler.Builder
- Enclosing class:
- PasswordAuthTokenAPIHandler
public abstract static class PasswordAuthTokenAPIHandler.Conf<T extends PasswordAuthTokenAPIHandler.Conf<T>> extends AbstractTokenAPIHandler.Conf<T>
-
-
Field Summary
-
Fields inherited from class co.arago.hiro.client.connection.AbstractClientAPIHandler.Conf
acceptAllCerts, connectTimeout, followRedirects, httpClient, maxBinaryLogLength, maxConnectionPool, proxy, sslContext, sslParameters
-
-
Constructor Summary
Constructors Constructor Description Conf()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract PasswordAuthTokenAPIHandlerbuild()java.lang.StringgetApiPath()java.lang.StringgetClientId()java.lang.StringgetClientSecret()booleangetForceLogging()java.lang.StringgetPassword()java.lang.LonggetRefreshOffset()java.lang.LonggetRefreshPause()java.lang.StringgetUsername()TsetApiPath(java.lang.String apiPath)TsetClientId(java.lang.String clientId)TsetClientSecret(java.lang.String clientSecret)TsetCredentials(java.lang.String username, java.lang.String password, java.lang.String clientId, java.lang.String clientSecret)Shorthand to set all credentials at once.TsetForceLogging(boolean forceLogging)Force logging of insecure request / response data.TsetPassword(java.lang.String password)TsetRefreshOffset(java.lang.Long refreshOffset)Timespan that gets subtracted from the official expiration instant of a token so the token can be refreshed before it runs out.TsetRefreshPause(java.lang.Long refreshPause)Timespan where calls to refresh the token will be ignored and only the current token will be returned.TsetUsername(java.lang.String username)-
Methods inherited from class co.arago.hiro.client.connection.AbstractClientAPIHandler.Conf
getAcceptAllCerts, getConnectTimeout, getHttpClient, getMaxBinaryLogLength, getMaxConnectionPool, getSslContext, getSslParameters, isFollowRedirects, setAcceptAllCerts, setConnectTimeout, setFollowRedirects, setHttpClient, setMaxBinaryLogLength, setMaxConnectionPool, setProxy, setSslContext, setSslParameters
-
Methods inherited from class co.arago.hiro.client.connection.AbstractAPIHandler.Conf
getApiUrl, getHttpRequestTimeout, getMaxRetries, getUserAgent, getWebSocketUri, self, setApiUrl, setApiUrl, setHttpRequestTimeout, setMaxRetries, setUserAgent, setWebSocketUri, setWebSocketUrl
-
-
-
-
Method Detail
-
getUsername
public java.lang.String getUsername()
-
setUsername
public T setUsername(java.lang.String username)
- Parameters:
username- HIRO username for user account- Returns:
AbstractAPIHandler.Conf.self()
-
getPassword
public java.lang.String getPassword()
-
setPassword
public T setPassword(java.lang.String password)
- Parameters:
password- HIRO password for user account- Returns:
AbstractAPIHandler.Conf.self()
-
getClientId
public java.lang.String getClientId()
-
setClientId
public T setClientId(java.lang.String clientId)
- Parameters:
clientId- HIRO client_id of app- Returns:
AbstractAPIHandler.Conf.self()
-
getClientSecret
public java.lang.String getClientSecret()
-
setClientSecret
public T setClientSecret(java.lang.String clientSecret)
- Parameters:
clientSecret- HIRO client_secret of app- Returns:
AbstractAPIHandler.Conf.self()
-
setCredentials
public T setCredentials(java.lang.String username, java.lang.String password, java.lang.String clientId, java.lang.String clientSecret)
Shorthand to set all credentials at once.- Parameters:
username- HIRO username for user accountpassword- HIRO password for user accountclientId- HIRO client_id of appclientSecret- HIRO client_secret of app- Returns:
AbstractAPIHandler.Conf.self()
-
getRefreshOffset
public java.lang.Long getRefreshOffset()
-
setRefreshOffset
public T setRefreshOffset(java.lang.Long refreshOffset)
Timespan that gets subtracted from the official expiration instant of a token so the token can be refreshed before it runs out. Default is 5000 (5s).- Parameters:
refreshOffset- Offset in ms- Returns:
AbstractAPIHandler.Conf.self()
-
getRefreshPause
public java.lang.Long getRefreshPause()
-
setRefreshPause
public T setRefreshPause(java.lang.Long refreshPause)
Timespan where calls to refresh the token will be ignored and only the current token will be returned. Avoids refresh floods that can happen with multiple threads using the same TokenAPIHandler. Default is 30000 (30s).- Parameters:
refreshPause- Buffer span in ms- Returns:
AbstractAPIHandler.Conf.self()
-
getForceLogging
public boolean getForceLogging()
-
setForceLogging
public T setForceLogging(boolean forceLogging)
Force logging of insecure request / response data. USE ONLY FOR DEBUGGING PURPOSES!!!- Parameters:
forceLogging- the flag to set.- Returns:
AbstractAPIHandler.Conf.self()
-
getApiPath
public java.lang.String getApiPath()
-
setApiPath
public T setApiPath(java.lang.String apiPath)
- Parameters:
apiPath- The apiPath set externally. Overrides the fetching of the endpoint via /api/version.- Returns:
AbstractAPIHandler.Conf.self()
-
build
public abstract PasswordAuthTokenAPIHandler build()
- Specified by:
buildin classAbstractTokenAPIHandler.Conf<T extends PasswordAuthTokenAPIHandler.Conf<T>>
-
-