Table of Contents

Class ApplicationLocalDataCache

Namespace
Arc4u.OAuth2.Token
Assembly
Arc4u.OAuth2.dll

An ITokenCache for a local client application: the token is persisted in the ISecureCache and kept in memory for the next reads.

[Export(typeof(ITokenCache))]
[Shared]
public class ApplicationLocalDataCache : ITokenCache
Inheritance
ApplicationLocalDataCache
Implements
Inherited Members

Constructors

ApplicationLocalDataCache(ISecureCache, ILogger)

Initializes a new instance of the ApplicationLocalDataCache class.

public ApplicationLocalDataCache(ISecureCache cache, ILogger logger)

Parameters

cache ISecureCache

The secure cache in which the token is persisted.

logger ILogger

The logger.

Methods

Clear(string)

Removes the token from the secure cache and from the in-memory copy. Errors are ignored.

public void Clear(string key)

Parameters

key string

The key of the token.

DeleteItem(string)

Delete a token based on its unique key.

public void DeleteItem(string key)

Parameters

key string

The unique key of the token.

Get<T>(string)

Gets a value.

public T? Get<T>(string key)

Parameters

key string

The unique key.

Returns

T

The value, or the default of T when there is none.

Type Parameters

T

The type of the value.

Put<T>(string, T)

Adds or replaces a value.

public void Put<T>(string key, T data)

Parameters

key string

The unique key.

data T

The value to store. A null value is ignored by some implementations.

Type Parameters

T

The type of the value.