Package app.sdkgen.client
Class ClientAbstract
- java.lang.Object
-
- app.sdkgen.client.ClientAbstract
-
public abstract class ClientAbstract extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringbaseUrlprotected CredentialsInterfacecredentialsprotected com.fasterxml.jackson.databind.ObjectMapperobjectMapperprotected java.util.List<java.lang.String>scopesprotected TokenStoreInterfacetokenStore
-
Constructor Summary
Constructors Constructor Description ClientAbstract(java.lang.String baseUrl, CredentialsInterface credentials, TokenStoreInterface tokenStore)ClientAbstract(java.lang.String baseUrl, CredentialsInterface credentials, TokenStoreInterface tokenStore, java.util.List<java.lang.String> scopes)ClientAbstract(java.lang.String baseUrl, CredentialsInterface credentials, TokenStoreInterface tokenStore, java.util.List<java.lang.String> scopes, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringbuildRedirectUrl(java.lang.String redirectUrl, java.util.List<java.lang.String> scopes, java.lang.String state)protected AccessTokenfetchAccessTokenByClientCredentials()protected AccessTokenfetchAccessTokenByCode(java.lang.String code)protected AccessTokenfetchAccessTokenByRefresh(java.lang.String refreshToken)protected java.lang.StringgetAccessToken()protected java.lang.StringgetAccessToken(boolean automaticRefresh, int expireThreshold)protected org.apache.http.client.HttpClientnewHttpClient()protected org.apache.http.client.HttpClientnewHttpClient(CredentialsInterface credentials)
-
-
-
Field Detail
-
baseUrl
protected java.lang.String baseUrl
-
credentials
protected CredentialsInterface credentials
-
tokenStore
protected TokenStoreInterface tokenStore
-
scopes
protected java.util.List<java.lang.String> scopes
-
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Detail
-
ClientAbstract
public ClientAbstract(java.lang.String baseUrl, CredentialsInterface credentials, TokenStoreInterface tokenStore, java.util.List<java.lang.String> scopes, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
ClientAbstract
public ClientAbstract(java.lang.String baseUrl, CredentialsInterface credentials, TokenStoreInterface tokenStore, java.util.List<java.lang.String> scopes)
-
ClientAbstract
public ClientAbstract(java.lang.String baseUrl, CredentialsInterface credentials, TokenStoreInterface tokenStore)
-
-
Method Detail
-
buildRedirectUrl
public java.lang.String buildRedirectUrl(java.lang.String redirectUrl, java.util.List<java.lang.String> scopes, java.lang.String state) throws InvalidCredentialsException, java.net.URISyntaxException- Throws:
InvalidCredentialsExceptionjava.net.URISyntaxException
-
fetchAccessTokenByCode
protected AccessToken fetchAccessTokenByCode(java.lang.String code) throws InvalidCredentialsException, java.io.IOException, InvalidAccessTokenException, TokenPersistException
- Throws:
InvalidCredentialsExceptionjava.io.IOExceptionInvalidAccessTokenExceptionTokenPersistException
-
fetchAccessTokenByClientCredentials
protected AccessToken fetchAccessTokenByClientCredentials() throws InvalidCredentialsException, java.io.IOException, InvalidAccessTokenException, TokenPersistException
- Throws:
InvalidCredentialsExceptionjava.io.IOExceptionInvalidAccessTokenExceptionTokenPersistException
-
fetchAccessTokenByRefresh
protected AccessToken fetchAccessTokenByRefresh(java.lang.String refreshToken) throws InvalidCredentialsException, FoundNoAccessTokenException, java.io.IOException, InvalidAccessTokenException, TokenPersistException
- Throws:
InvalidCredentialsExceptionFoundNoAccessTokenExceptionjava.io.IOExceptionInvalidAccessTokenExceptionTokenPersistException
-
getAccessToken
protected java.lang.String getAccessToken(boolean automaticRefresh, int expireThreshold) throws FoundNoAccessTokenException, InvalidAccessTokenException, TokenPersistException, InvalidCredentialsException, java.io.IOException- Throws:
FoundNoAccessTokenExceptionInvalidAccessTokenExceptionTokenPersistExceptionInvalidCredentialsExceptionjava.io.IOException
-
getAccessToken
protected java.lang.String getAccessToken() throws FoundNoAccessTokenException, InvalidAccessTokenException, TokenPersistException, InvalidCredentialsException, java.io.IOException- Throws:
FoundNoAccessTokenExceptionInvalidAccessTokenExceptionTokenPersistExceptionInvalidCredentialsExceptionjava.io.IOException
-
newHttpClient
protected org.apache.http.client.HttpClient newHttpClient(CredentialsInterface credentials)
-
newHttpClient
protected org.apache.http.client.HttpClient newHttpClient()
-
-