Class AccessTokenServiceRestClient
java.lang.Object
org.craftercms.commons.rest.AbstractRestClientBase
org.craftercms.profile.services.impl.AbstractProfileRestClientBase
org.craftercms.profile.services.impl.AccessTokenServiceRestClient
- All Implemented Interfaces:
AccessTokenService
public class AccessTokenServiceRestClient
extends AbstractProfileRestClientBase
implements AccessTokenService
REST client implementation of
AccessTokenService.- Author:
- avasquez
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.springframework.core.ParameterizedTypeReference<List<AccessToken>> Fields inherited from class org.craftercms.profile.services.impl.AbstractProfileRestClientBase
accessTokenIdResolverFields inherited from class org.craftercms.commons.rest.AbstractRestClientBase
baseUrl, extension, restTemplate -
Constructor Summary
ConstructorsConstructorDescriptionAccessTokenServiceRestClient(String baseUrl, org.springframework.web.client.RestTemplate restTemplate, AccessTokenIdResolver accessTokenIdResolver) -
Method Summary
Modifier and TypeMethodDescriptioncreateToken(AccessToken token) Creates a new access token.voiddeleteToken(String id) Deletes the token with the given ID.Returns all the access tokens in the DB.Returns the token for the given ID.Methods inherited from class org.craftercms.profile.services.impl.AbstractProfileRestClientBase
createBaseParams, doGetForObject, doGetForObject, doGetForObject, doGetForObject, doPostForLocation, doPostForObject, doPostForUpload, getAbsoluteUrlWithAccessTokenIdParam, handleException, handleRestServiceExceptionMethods inherited from class org.craftercms.commons.rest.AbstractRestClientBase
getAbsoluteUrl, setExtension
-
Field Details
-
accessTokenListTypeRef
public static final org.springframework.core.ParameterizedTypeReference<List<AccessToken>> accessTokenListTypeRef
-
-
Constructor Details
-
AccessTokenServiceRestClient
public AccessTokenServiceRestClient(String baseUrl, org.springframework.web.client.RestTemplate restTemplate, AccessTokenIdResolver accessTokenIdResolver)
-
-
Method Details
-
createToken
Description copied from interface:AccessTokenServiceCreates a new access token.- Specified by:
createTokenin interfaceAccessTokenService- Parameters:
token- the token to create- Returns:
- the created token
- Throws:
ProfileException
-
getToken
Description copied from interface:AccessTokenServiceReturns the token for the given ID.- Specified by:
getTokenin interfaceAccessTokenService- Parameters:
id- the ID of the token- Returns:
- the token, or null if not found
- Throws:
ProfileException
-
getAllTokens
Description copied from interface:AccessTokenServiceReturns all the access tokens in the DB.- Specified by:
getAllTokensin interfaceAccessTokenService- Returns:
- all the access tokens
- Throws:
ProfileException
-
deleteToken
Description copied from interface:AccessTokenServiceDeletes the token with the given ID.- Specified by:
deleteTokenin interfaceAccessTokenService- Parameters:
id- the ID of the token- Throws:
ProfileException
-