ColdBox Platform Version 3.7.0

coldbox.system.cache.providers
Class MockProvider

WEB-INF.cftags.component
        extended by coldbox.system.cache.AbstractCacheBoxProvider
            extended by coldbox.system.cache.providers.MockProvider
All Implemented Interfaces:
IColdboxApplicationCache

public class MockProvider
extends AbstractCacheBoxProvider

A mock cache provider


Constructor Summary
init()
          Simple Constructor
 
Method Summary
 any clear(any objectKey)
          Clears an object from the cache by using its cache key
 void clearAll()
          Clear all the cache elements from the cache
 void clearAllEvents([any async])
          Clears all events from the cache
 void clearAllViews([any async])
          Clears all views from the cache
 void clearByKeySnippet(any keySnippet, [any regex], [any async])
          Clears keys using the passed in object key snippet
 void clearEvent(any eventsnippet, [any queryString=''])
          Clears all the event permutations from the cache according to snippet and querystring
 void clearEventMulti(any eventsnippets, [any queryString=''])
          Clears all the event permutations from the cache according to the list of snippets and querystrings
 any clearQuiet(any objectKey)
          Clears an object from the cache by using its cache key
 void clearView(any viewSnippet)
          Clears all view name permutations from the cache according to the view name
 void clearViewMulti(any viewSnippets)
          Clears all view name permutations from the cache according to the view name
 void configure()
          This method makes the cache ready to accept elements and run
 void expireAll()
          Expire all the elments in the cache
 void expireObject(any objectKey)
          Expires an object from the cache by using its cache key
 any get(any objectKey)
          Get an object from the cache and updates stats
 any getCachedObjectMetadata(any objectKey)
          Get a cache objects metadata about its performance
 any getColdbox()
          Get the coldbox application reference
 any getEventCacheKeyPrefix()
          Get the event cache key prefix
 any getEventURLFacade()
          Get the event caching URL facade utility
 any getKeys()
          Returns a list of all elements in the cache, whether or not they are expired
 any<IObjectStore> getObjectStore()
          If the cache provider implements it, this returns the cache's object store as type: coldbox
 any getQuiet(any objectKey)
          Get an object from the cache without updating stats or listners
 any getSize()
          Get the number of elements in the cache
 any getStoreMetadataKeyMap()
          Get a key lookup structure where cachebox can build the report on
 any getStoreMetadataReport()
          Get a structure of all the keys in the cache with their appropriate metadata structures
 any getViewCacheKeyPrefix()
          Get the cached view key prefix
 any isExpired(any objectKey)
          Has the object key expired in the cache
 any lookup(any objectKey)
          Check if an object is in cache, if not found it records a miss
 any lookupQuiet(any objectKey)
          Check if an object is in cache, no stats updated or listeners
 any lookupValue(any objectValue)
          Check if an object is in cache, if not found it records a miss
 void reap()
          Reap the caches for expired objects and expiries
 any set(any objectKey, any object, [any timeout], [any lastAccessTimeout], [any extra])
          sets an object in cache
 void setColdbox(any coldbox)
          Set the coldbox application reference
 any setQuiet(any objectKey, any object, [any timeout], [any lastAccessTimeout], [any extra])
          sets an object in cache and returns true if set correctly, else false
 void shutdown()
          Shutdown command issued when CacheBox is going through shutdown phase
 
Methods inherited from class coldbox.system.cache.AbstractCacheBoxProvider
clearStatistics, getCacheFactory, getCacheID, getConfiguration, getEventManager, getMemento, getName, getStats, getUtil, isEnabled, isReportingEnabled, setCacheFactory, setConfiguration, setEventManager, setName, statusCheck
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init()
Simple Constructor

Method Detail

clear

public any clear(any objectKey)
Clears an object from the cache by using its cache key. Returns false if object was not removed or did not exist anymore

Specified by:
clear in interface ICacheProvider
Parameters:
objectKey - The object cache key

clearAll

public void clearAll()
Clear all the cache elements from the cache

Specified by:
clearAll in interface ICacheProvider

clearAllEvents

public void clearAllEvents([any async])
Clears all events from the cache.

Specified by:
clearAllEvents in interface IColdboxApplicationCache
Parameters:
async - Run command asynchronously or not

clearAllViews

public void clearAllViews([any async])
Clears all views from the cache.

Specified by:
clearAllViews in interface IColdboxApplicationCache
Parameters:
async - Run command asynchronously or not

clearByKeySnippet

public void clearByKeySnippet(any keySnippet, [any regex], [any async])
Clears keys using the passed in object key snippet

Parameters:
keySnippet - the cache key snippet to use
regex - Use regex or not
async - Run command asynchronously or not

clearEvent

public void clearEvent(any eventsnippet, [any queryString=''])
Clears all the event permutations from the cache according to snippet and querystring. Be careful when using incomplete event name with query strings as partial event names are not guaranteed to match with query string permutations

Specified by:
clearEvent in interface IColdboxApplicationCache
Parameters:
eventsnippet - The event snippet to clear on. Can be partial or full
queryString - If passed in, it will create a unique hash out of it. For purging purposes

clearEventMulti

public void clearEventMulti(any eventsnippets, [any queryString=''])
Clears all the event permutations from the cache according to the list of snippets and querystrings. Be careful when using incomplete event name with query strings as partial event names are not guaranteed to match with query string permutations

Specified by:
clearEventMulti in interface IColdboxApplicationCache
Parameters:
eventsnippets - The comma-delimmitted list event snippet to clear on. Can be partial or full
queryString - The comma-delimmitted list of queryStrings passed in. If passed in, it will create a unique hash out of it. For purging purposes. If passed in the list length must be equal to the list length of the event snippets passed in.

clearQuiet

public any clearQuiet(any objectKey)
Clears an object from the cache by using its cache key. Returns false if object was not removed or did not exist anymore without doing statistics or updating listeners

Specified by:
clearQuiet in interface ICacheProvider
Parameters:
objectKey - The object cache key

clearView

public void clearView(any viewSnippet)
Clears all view name permutations from the cache according to the view name.

Specified by:
clearView in interface IColdboxApplicationCache
Parameters:
viewSnippet - The view name snippet to purge from the cache

clearViewMulti

public void clearViewMulti(any viewSnippets)
Clears all view name permutations from the cache according to the view name.

Specified by:
clearViewMulti in interface IColdboxApplicationCache
Parameters:
viewSnippets - The comma-delimmitted list or array of view snippet to clear on. Can be partial or full

configure

public void configure()
This method makes the cache ready to accept elements and run

Specified by:
configure in interface ICacheProvider

expireAll

public void expireAll()
Expire all the elments in the cache

Specified by:
expireAll in interface ICacheProvider

expireObject

public void expireObject(any objectKey)
Expires an object from the cache by using its cache key. Returns false if object was not removed or did not exist anymore

Specified by:
expireObject in interface ICacheProvider
Parameters:
objectKey - The object cache key

get

public any get(any objectKey)
Get an object from the cache and updates stats

Specified by:
get in interface ICacheProvider
Parameters:
objectKey - The object key

getCachedObjectMetadata

public any getCachedObjectMetadata(any objectKey)
Get a cache objects metadata about its performance.

Specified by:
getCachedObjectMetadata in interface ICacheProvider
Parameters:
objectKey - The key of the object to lookup its metadata

getColdbox

public any getColdbox()
Get the coldbox application reference

Specified by:
getColdbox in interface IColdboxApplicationCache

getEventCacheKeyPrefix

public any getEventCacheKeyPrefix()
Get the event cache key prefix

Specified by:
getEventCacheKeyPrefix in interface IColdboxApplicationCache

getEventURLFacade

public any getEventURLFacade()
Get the event caching URL facade utility

Specified by:
getEventURLFacade in interface IColdboxApplicationCache

getKeys

public any getKeys()
Returns a list of all elements in the cache, whether or not they are expired.

Specified by:
getKeys in interface ICacheProvider

getObjectStore

public any<IObjectStore> getObjectStore()
If the cache provider implements it, this returns the cache's object store as type: coldbox.system.cache.store.IObjectStore

Specified by:
getObjectStore in interface ICacheProvider

getQuiet

public any getQuiet(any objectKey)
Get an object from the cache without updating stats or listners

Specified by:
getQuiet in interface ICacheProvider
Parameters:
objectKey - The object key

getSize

public any getSize()
Get the number of elements in the cache

Specified by:
getSize in interface ICacheProvider

getStoreMetadataKeyMap

public any getStoreMetadataKeyMap()
Get a key lookup structure where cachebox can build the report on. Ex: [timeout=timeout,lastAccessTimeout=idleTimeout]. It is a way for the visualizer to construct the columns correctly on the reports

Specified by:
getStoreMetadataKeyMap in interface ICacheProvider

getStoreMetadataReport

public any getStoreMetadataReport()
Get a structure of all the keys in the cache with their appropriate metadata structures. This is used to build the reporting.

Specified by:
getStoreMetadataReport in interface ICacheProvider

getViewCacheKeyPrefix

public any getViewCacheKeyPrefix()
Get the cached view key prefix

Specified by:
getViewCacheKeyPrefix in interface IColdboxApplicationCache

isExpired

public any isExpired(any objectKey)
Has the object key expired in the cache

Specified by:
isExpired in interface ICacheProvider
Parameters:
objectKey - The object key

lookup

public any lookup(any objectKey)
Check if an object is in cache, if not found it records a miss.

Specified by:
lookup in interface ICacheProvider
Parameters:
objectKey - The key of the object to lookup.

lookupQuiet

public any lookupQuiet(any objectKey)
Check if an object is in cache, no stats updated or listeners

Specified by:
lookupQuiet in interface ICacheProvider
Parameters:
objectKey - The key of the object to lookup.

lookupValue

public any lookupValue(any objectValue)
Check if an object is in cache, if not found it records a miss.

Parameters:
objectValue - The value of the object to lookup.

reap

public void reap()
Reap the caches for expired objects and expiries

Specified by:
reap in interface ICacheProvider

set

public any set(any objectKey, any object, [any timeout], [any lastAccessTimeout], [any extra])
sets an object in cache.

Specified by:
set in interface ICacheProvider
Parameters:
objectKey - The object cache key
object - The object to cache
timeout - The timeout to use on the object (if any, provider specific)
lastAccessTimeout - The idle timeout to use on the object (if any, provider specific)
extra - A map of name-value pairs to use as extra arguments to pass to a providers set operation

setColdbox

public void setColdbox(any coldbox)
Set the coldbox application reference

Specified by:
setColdbox in interface IColdboxApplicationCache
Parameters:
coldbox - The coldbox application reference

setQuiet

public any setQuiet(any objectKey, any object, [any timeout], [any lastAccessTimeout], [any extra])
sets an object in cache and returns true if set correctly, else false. With no statistic updates or listener updates

Specified by:
setQuiet in interface ICacheProvider
Parameters:
objectKey - The object cache key
object - The object to cache
timeout - The timeout to use on the object (if any, provider specific)
lastAccessTimeout - The idle timeout to use on the object (if any, provider specific)
extra - A map of name-value pairs to use as extra arguments to pass to a providers set operation

shutdown

public void shutdown()
Shutdown command issued when CacheBox is going through shutdown phase

Specified by:
shutdown in interface ICacheProvider

ColdBox Platform Version 3.7.0