@Component public class AccessTokenManagerImpl extends java.lang.Object implements AccessTokenManager
AccessTokenManager.UpdateField| Constructor and Description |
|---|
AccessTokenManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
AccessToken |
findByToken(java.lang.String appRef,
java.lang.String accessTokenStr) |
java.lang.String |
findByXRef(java.lang.String appRef,
XInfoImpl xInfo)
Returns the access token for the specified application partner, user pair
|
java.time.Instant |
getExpiration(java.lang.String appRef,
java.lang.String accessTokenStr) |
ExternalReference |
getXRef(java.lang.String accessTokenStr)
Returns the access token for the specified application partner, user pair
|
int |
getXUserId(java.lang.String appRef,
java.lang.String accessTokenStr)
Returns the external user ID for the specified application partner, access token pair.
|
void |
invalidateToken(java.lang.String appRef,
java.lang.String accessTokenStr) |
boolean |
isExpired(java.lang.String appRef,
java.lang.String accessTokenStr) |
java.lang.String |
persist(java.lang.String partnerRef,
XInfoImpl xInfo) |
java.lang.String |
persist(XInfoImpl xInfo)
Creates, stores, and returns an access token for the specified user for the
current partner.
|
void |
purge(int unusedDays)
Delete your application's access tokens that have been unused for a specified number of days.
|
void |
purge(java.lang.String appRef,
int unusedDays)
For an admin application: Delete tokens that have been unused for a specified number of days.
|
java.lang.String |
renewToken(java.lang.String appRef,
java.lang.String accessTokenStr) |
public java.lang.String persist(XInfoImpl xInfo) throws NotFoundException
AccessTokenManagerpersist in interface AccessTokenManagerxInfo - A User's XPairNotFoundExceptionpublic java.lang.String persist(java.lang.String partnerRef,
XInfoImpl xInfo)
throws NotFoundException
persist in interface AccessTokenManagerNotFoundExceptionpublic int getXUserId(java.lang.String appRef,
java.lang.String accessTokenStr)
throws NotFoundException
AccessTokenManagergetXUserId in interface AccessTokenManagerappRef - Application partner referenceaccessTokenStr - Access tokenNotFoundExceptionpublic ExternalReference getXRef(java.lang.String accessTokenStr)
AccessTokenManagergetXRef in interface AccessTokenManagerpublic java.lang.String findByXRef(java.lang.String appRef,
XInfoImpl xInfo)
throws NotFoundException
AccessTokenManagerfindByXRef in interface AccessTokenManagerappRef - Application partner referencexInfo - External user infoNotFoundExceptionpublic java.lang.String renewToken(java.lang.String appRef,
java.lang.String accessTokenStr)
throws NotFoundException
renewToken in interface AccessTokenManagerNotFoundExceptionpublic void invalidateToken(java.lang.String appRef,
java.lang.String accessTokenStr)
throws NotFoundException
invalidateToken in interface AccessTokenManagerNotFoundExceptionpublic java.time.Instant getExpiration(java.lang.String appRef,
java.lang.String accessTokenStr)
throws NotFoundException
getExpiration in interface AccessTokenManagerNotFoundExceptionpublic boolean isExpired(java.lang.String appRef,
java.lang.String accessTokenStr)
throws NotFoundException
isExpired in interface AccessTokenManagerNotFoundExceptionpublic AccessToken findByToken(java.lang.String appRef, java.lang.String accessTokenStr) throws NotFoundException
findByToken in interface AccessTokenManagerNotFoundExceptionpublic void purge(int unusedDays)
AccessTokenManagerpurge in interface AccessTokenManagerunusedDays - Length of time, in days, a token has been unused.public void purge(java.lang.String appRef,
int unusedDays)
AccessTokenManagerIf appRef is not same as the application calling the method, the caller must be the admin app.
purge in interface AccessTokenManagerappRef - Application reference whose tokens are to be purged.unusedDays - Length of time, in days, a token has been unused.