cbstorages

Class CacheStorage

lucee.Component
    extended by cbstorages.CacheStorage

Copyright Ortus Solutions, Corp www.ortussolutions.com --- This storage leverages cachebox in order to operate. It simulates a session/client storage bucket in cache.

Class Attributes:
  • threadsafe
  •  
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any appName
          Application name, comes from the application settings.

    • access = public
    • returntype = any
    true false
    any cache
          The cache provider to use.

    • access = public
    • returntype = any
    true false
    any settings
          Settings.

    • access = public
    • returntype = any
    true false
    numeric timeout
          Session Timeout, defaults to 60 minutes.

    • access = public
    • returntype = any
    60 true false
    Constructor Summary
    init(any settings, any cachebox)
          Constructor.
    Method Summary
    CacheStorage clearAll()
         Clear the entire coldbox session storage.
    CacheStorage deleteVar(any name)
         Delete a variable in storage.
    boolean exists(any name)
         Checks wether the permanent variable exists.
    string getAppName()
    string getCache()
    private string getSessionKey()
         Builds the unique Session Key of a user request.
    string getSettings()
    struct getStorage()
         Get the entire storage scope from cache.
    string getTimeout()
    any getVar(any name, [any defaultValue])
         Get a new variable in storage if it exists, else return default value, else will return null.
    CacheStorage removeStorage()
         Remove the bucket.
    any setAppName(any appName)
    any setCache(any cache)
    any setSettings(any settings)
    any setTimeout(numeric timeout)
    CacheStorage setVar(any name, any value)
         Set a new variable in storage.
    boolean storageExists()
         Check if storage exists.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any settings, any cachebox)

    Constructor

    Parameters:
    settings - The storage settings struct
    cachebox - A reference to CacheBox

    Property Detail

    appName

    property any appName

    Application name, comes from the application settings

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

    cache

    property any cache

    The cache provider to use

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

    settings

    property any settings

    Settings

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

    timeout

    property numeric timeout = [60]

    Session Timeout, defaults to 60 minutes

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

    Method Detail

    clearAll

    public CacheStorage clearAll()

    Clear the entire coldbox session storage


    deleteVar

    public CacheStorage deleteVar(any name)

    Delete a variable in storage

    Parameters:
    name - The name of the data key

    exists

    public boolean exists(any name)

    Checks wether the permanent variable exists

    Parameters:
    name - The name of the data key

    getAppName

    public string getAppName()


    getCache

    public string getCache()


    getSessionKey

    private string getSessionKey()

    Builds the unique Session Key of a user request


    getSettings

    public string getSettings()


    getStorage

    public struct getStorage()

    Get the entire storage scope from cache. If it does not exist, then create the default bucket


    getTimeout

    public string getTimeout()


    getVar

    public any getVar(any name, [any defaultValue])

    Get a new variable in storage if it exists, else return default value, else will return null.

    Parameters:
    name - The name of the data key
    defaultValue - The default value to return if not found in storage

    removeStorage

    public CacheStorage removeStorage()

    Remove the bucket


    setAppName

    public any setAppName(any appName)

    Parameters:
    appName

    setCache

    public any setCache(any cache)

    Parameters:
    cache

    setSettings

    public any setSettings(any settings)

    Parameters:
    settings

    setTimeout

    public any setTimeout(numeric timeout)

    Parameters:
    timeout

    setVar

    public CacheStorage setVar(any name, any value)

    Set a new variable in storage

    Parameters:
    name - The name of the data key
    value - The value of the data to store

    storageExists

    public boolean storageExists()

    Check if storage exists