com.microsoft.aad.adal
Class FileTokenCacheStore

java.lang.Object
  extended by com.microsoft.aad.adal.FileTokenCacheStore
All Implemented Interfaces:
ITokenCacheStore, Serializable

public class FileTokenCacheStore
extends Object
implements ITokenCacheStore

Persisted cache that keeps cache in-memory until write operation. Filename should not be used on another instance of FiletokenCacheStore since read operations are not synced to file.

See Also:
Serialized Form

Constructor Summary
FileTokenCacheStore(android.content.Context context, String fileName)
          It tracks data in memory until it writes that to a file with write operation.
 
Method Summary
 boolean contains(String key)
          Checks if cache key exists.
 TokenCacheItem getItem(String key)
          Get cache item.
 void removeAll()
          Removes all items from cache.
 void removeItem(String key)
          Removes item with key.
 void setItem(String key, TokenCacheItem item)
          Sets item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTokenCacheStore

public FileTokenCacheStore(android.content.Context context,
                           String fileName)
It tracks data in memory until it writes that to a file with write operation.

Parameters:
context - Context
fileName - filename should be unique to this instance since read operations don't read from file directly. write operations write to a file.
Method Detail

getItem

public TokenCacheItem getItem(String key)
Description copied from interface: ITokenCacheStore
Get cache item.

Specified by:
getItem in interface ITokenCacheStore
Parameters:
key - CacheKey
Returns:
Token cache item

contains

public boolean contains(String key)
Description copied from interface: ITokenCacheStore
Checks if cache key exists.

Specified by:
contains in interface ITokenCacheStore
Parameters:
key - CacheKey
Returns:
true if it exists

setItem

public void setItem(String key,
                    TokenCacheItem item)
Description copied from interface: ITokenCacheStore
Sets item.

Specified by:
setItem in interface ITokenCacheStore
Parameters:
key - CacheKey
item - Cache item

removeItem

public void removeItem(String key)
Description copied from interface: ITokenCacheStore
Removes item with key.

Specified by:
removeItem in interface ITokenCacheStore
Parameters:
key - CacheKey

removeAll

public void removeAll()
Description copied from interface: ITokenCacheStore
Removes all items from cache.

Specified by:
removeAll in interface ITokenCacheStore


Copyright © 2003–2015. All rights reserved.