All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.truelayer.java.http.auth.cache.ICredentialsCache Maven / Gradle / Ivy

There is a newer version: 16.0.0
Show newest version
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);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy