com.truelayer.java.http.auth.cache.ICredentialsCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truelayer-java Show documentation
Show all versions of truelayer-java Show documentation
TrueLayer Java SDK for https://truelayer.com
package com.truelayer.java.http.auth.cache;
import com.truelayer.java.auth.entities.AccessToken;
import com.truelayer.java.entities.RequestScopes;
import java.util.Optional;
public interface ICredentialsCache {
/**
* Gets the cached access token for the given request scopes.
* @param scopes the requested scopes
* @return an optional access token. If the token is expired an empty optional is returned
*/
Optional getToken(RequestScopes scopes);
/**
* Stores an access token in cache for the given request scopes.
* @param token the new token to store
* @param scopes the requested scopes
*/
void storeToken(RequestScopes scopes, AccessToken token);
/**
* Remove the entry in the cache for the given request scopes.
* @param scopes the requested scopes
*/
void clearToken(RequestScopes scopes);
}