@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
AccessTokenManager
persist
in interface AccessTokenManager
xInfo
- A User
's XPair
NotFoundException
public java.lang.String persist(java.lang.String partnerRef, XInfoImpl xInfo) throws NotFoundException
persist
in interface AccessTokenManager
NotFoundException
public int getXUserId(java.lang.String appRef, java.lang.String accessTokenStr) throws NotFoundException
AccessTokenManager
getXUserId
in interface AccessTokenManager
appRef
- Application partner referenceaccessTokenStr
- Access tokenNotFoundException
public ExternalReference getXRef(java.lang.String accessTokenStr)
AccessTokenManager
getXRef
in interface AccessTokenManager
public java.lang.String findByXRef(java.lang.String appRef, XInfoImpl xInfo) throws NotFoundException
AccessTokenManager
findByXRef
in interface AccessTokenManager
appRef
- Application partner referencexInfo
- External user infoNotFoundException
public java.lang.String renewToken(java.lang.String appRef, java.lang.String accessTokenStr) throws NotFoundException
renewToken
in interface AccessTokenManager
NotFoundException
public void invalidateToken(java.lang.String appRef, java.lang.String accessTokenStr) throws NotFoundException
invalidateToken
in interface AccessTokenManager
NotFoundException
public java.time.Instant getExpiration(java.lang.String appRef, java.lang.String accessTokenStr) throws NotFoundException
getExpiration
in interface AccessTokenManager
NotFoundException
public boolean isExpired(java.lang.String appRef, java.lang.String accessTokenStr) throws NotFoundException
isExpired
in interface AccessTokenManager
NotFoundException
public AccessToken findByToken(java.lang.String appRef, java.lang.String accessTokenStr) throws NotFoundException
findByToken
in interface AccessTokenManager
NotFoundException
public void purge(int unusedDays)
AccessTokenManager
purge
in interface AccessTokenManager
unusedDays
- Length of time, in days, a token has been unused.public void purge(java.lang.String appRef, int unusedDays)
AccessTokenManager
If appRef is not same as the application calling the method, the caller must be the admin app.
purge
in interface AccessTokenManager
appRef
- Application reference whose tokens are to be purged.unusedDays
- Length of time, in days, a token has been unused.