coldbox.system.cache.store

Class DiskStore

lucee.Component
    extended by coldbox.system.cache.store.DiskStore
All Implemented Interfaces:
IObjectStore

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- I am a disk store, I am not that fancy as I am slower.

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • author : Luis Majano
  •  
    Property Summary
    type property default serializable required
    any<ICacheProvider> cacheProvider
          The cache provider reference.

    • access = public
    • returntype = any
    • doc_generic = coldbox.system.cache.providers.ICacheProvider
    true false
    any<ObjectMarshaller> converter
          The object serializer and deserializer utility.

    • access = public
    • returntype = any
    • doc_generic = coldbox.system.core.conversion.ObjectMarshaller
    true false
    any directoryPath
          The location of the disk cache.

    • access = public
    • returntype = any
    true false
    any<MetadataIndexer> indexer
          The metadata indexer object.

    • access = public
    • returntype = any
    • doc_generic = coldbox.system.cache.store.indexers.MetadataIndexer
    true false
    any storeID
          The human store name.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init(any<ICacheProvider> cacheProvider)
          Constructor.
    Method Summary
    any clear(any objectKey)
         Clears an object from the storage.
    void clearAll()
         Clear all the elements in the store.
    void expireObject(any objectKey)
         Expire an object.
    void flush()
         Flush the store to a permanent storage.
    any get(any objectKey)
         Get an object from the store with metadata tracking, or null if not found.
    any getCacheFilePath(any objectKey)
         Get the cached file path according to our rules.
    string getCacheProvider()
    string getConverter()
    string getDirectoryPath()
    any getIndexer()
         Get the store's pool metadata indexer structure.
    any getKeys()
         Get all the store's object keys array.
    any getQuiet(any objectKey)
         Get an object from cache with no metadata tracking.
    any getSize()
         Get the size of the store.
    string getStoreID()
    any isExpired(any objectKey)
         Expire check.
    any lookup(any objectKey)
         Check if an object is in the store.
    void reap()
         Reap the storage.
    void set(any objectKey, any object, [any timeout=''], [any lastAccessTimeout=''], [any extras='[runtime expression]'])
         Sets an object in the storage.
    any setCacheProvider(any cacheProvider)
    any setConverter(any converter)
    any setDirectoryPath(any directoryPath)
    any setIndexer(any indexer)
    any setStoreID(any storeID)
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any<ICacheProvider> cacheProvider)

    Constructor

    Parameters:
    cacheProvider - The associated cache provider as coldbox.system.cache.providers.ICacheProvider

    Property Detail

    cacheProvider

    property any<ICacheProvider> cacheProvider

    The cache provider reference

    Attributes:
    access - public
    required - false
    returntype - any
    doc_generic - coldbox.system.cache.providers.ICacheProvider
    serializable - true

    converter

    property any<ObjectMarshaller> converter

    The object serializer and deserializer utility

    Attributes:
    access - public
    required - false
    returntype - any
    doc_generic - coldbox.system.core.conversion.ObjectMarshaller
    serializable - true

    directoryPath

    property any directoryPath

    The location of the disk cache

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    indexer

    property any<MetadataIndexer> indexer

    The metadata indexer object

    Attributes:
    access - public
    required - false
    returntype - any
    doc_generic - coldbox.system.cache.store.indexers.MetadataIndexer
    serializable - true

    storeID

    property any storeID

    The human store name

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    clear

    public any clear(any objectKey)

    Clears an object from the storage

    Specified by:
    clear in interface IObjectStore
    Parameters:
    objectKey - The object key to clear

    clearAll

    public void clearAll()

    Clear all the elements in the store

    Specified by:
    clearAll in interface IObjectStore

    expireObject

    public void expireObject(any objectKey)

    Expire an object

    Specified by:
    expireObject in interface IObjectStore
    Parameters:
    objectKey - The key to expire

    flush

    public void flush()

    Flush the store to a permanent storage

    Specified by:
    flush in interface IObjectStore

    get

    public any get(any objectKey)

    Get an object from the store with metadata tracking, or null if not found

    Specified by:
    get in interface IObjectStore
    Parameters:
    objectKey - The key to retrieve

    getCacheFilePath

    public any getCacheFilePath(any objectKey)

    Get the cached file path according to our rules

    Parameters:
    objectKey - The key to lookup

    getCacheProvider

    public string getCacheProvider()


    getConverter

    public string getConverter()


    getDirectoryPath

    public string getDirectoryPath()


    getIndexer

    public any getIndexer()

    Get the store's pool metadata indexer structure

    Specified by:
    getIndexer in interface IObjectStore
    Returns:
    coldbox.system.cache.store.indexers.MetadataIndexer

    getKeys

    public any getKeys()

    Get all the store's object keys array

    Specified by:
    getKeys in interface IObjectStore
    Returns:
    array

    getQuiet

    public any getQuiet(any objectKey)

    Get an object from cache with no metadata tracking

    Specified by:
    getQuiet in interface IObjectStore
    Parameters:
    objectKey - The key to retrieve

    getSize

    public any getSize()

    Get the size of the store

    Specified by:
    getSize in interface IObjectStore

    getStoreID

    public string getStoreID()


    isExpired

    public any isExpired(any objectKey)

    Expire check

    Specified by:
    isExpired in interface IObjectStore
    Parameters:
    objectKey - The key to check
    Returns:
    boolean

    lookup

    public any lookup(any objectKey)

    Check if an object is in the store

    Specified by:
    lookup in interface IObjectStore
    Parameters:
    objectKey - The key to lookup
    Returns:
    boolean

    reap

    public void reap()

    Reap the storage

    Specified by:
    reap in interface IObjectStore

    set

    public void set(any objectKey, any object, [any timeout=''], [any lastAccessTimeout=''], [any extras='[runtime expression]'])

    Sets an object in the storage

    Specified by:
    set in interface IObjectStore
    Parameters:
    objectKey - The object key
    object - The object to save
    timeout - Timeout in minutes
    lastAccessTimeout - Idle Timeout in minutes
    extras - A map of extra name-value pairs to store alongside the object

    setCacheProvider

    public any setCacheProvider(any cacheProvider)

    Parameters:
    cacheProvider

    setConverter

    public any setConverter(any converter)

    Parameters:
    converter

    setDirectoryPath

    public any setDirectoryPath(any directoryPath)

    Parameters:
    directoryPath

    setIndexer

    public any setIndexer(any indexer)

    Parameters:
    indexer

    setStoreID

    public any setStoreID(any storeID)

    Parameters:
    storeID