class Cerner::OAuth1a::Cache
Internal: A simple cache abstraction for use by AccessTokenAgent
only.
Constants
- ONE_HOUR
- TWENTY_FOUR_HOURS
Public Class Methods
Internal: Gets the singleton instance.
# File lib/cerner/oauth1a/cache.rb, line 17 def self.instance @cache_instance_lock.synchronize do return @cache_instance if instance_variable_defined?(:@cache_instance) && @cache_instance @cache_instance = DefaultCache.new(max: 50) end end
Internal: Sets the singleton instance.
# File lib/cerner/oauth1a/cache.rb, line 10 def self.instance=(cache_impl) raise ArgumentError, 'cache_impl must not be nil' unless cache_impl @cache_instance_lock.synchronize { @cache_instance = cache_impl } end
Internal: The base constructor for the interface.
# File lib/cerner/oauth1a/cache.rb, line 116 def initialize; end
Public Instance Methods
Internal: Constructs a single, fully qualified key based on the namespace and key value passed.
namespace - The namespace for the cache entries. key - The key for the cache entries.
# File lib/cerner/oauth1a/cache.rb, line 136 def full_key(namespace, key) "#{namespace}:#{key}" end
Internal: Retrieves the entry, if available, from the cache store.
namespace - The namespace for the cache entries. key - The key for the cache entries.
# File lib/cerner/oauth1a/cache.rb, line 129 def get(namespace, key); end
Internal: The abstract operation for putting (storing) data in the cache.
namespace - The namespace for the cache entries. key - The key for the cache entries, which is qualified by namespace. entry - The entry to be stored in the cache.
# File lib/cerner/oauth1a/cache.rb, line 123 def put(namespace, key, entry); end