cbstorages

Class ClusterStorage

lucee.Component
    extended by cbstorages.ClusterStorage

Cluster Storage plugin. It provides the user with a mechanism for permanent data storage using the Cluster scope. This plugin creates a special variable in cluster scope that correctly identifies the coldbox app.

Class Attributes:
  • singleton
  •  
  • output : false
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Constructor Summary
    init(struct settings)
    Method Summary
    void clearAll()
         Clear the entire coldbox cluster storage.
    private void createStorage()
         Create the storage scope.
    boolean deleteVar(string name)
         Tries to delete a permanent cluster variable.
    boolean exists(string name)
         Checks wether the permanent variable exists.
    struct getStorage()
         Get the entire storage scope structure.
    any getVar(string name, [any default=''])
         Get a new permanent variable.
    void removeStorage()
         remove the entire storage from scope.
    private any safeName(any value)
         Make a variable a safe var name.
    void setVar(string name, any value)
         Set a new permanent variable.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(struct settings)

    Parameters:
    settings

    Method Detail

    clearAll

    public void clearAll()

    Clear the entire coldbox cluster storage


    createStorage

    private void createStorage()

    Create the storage scope. Thread Safe


    deleteVar

    public boolean deleteVar(string name)

    Tries to delete a permanent cluster variable. Returns True if deleted.

    Parameters:
    name - The variable name to retrieve.

    exists

    public boolean exists(string name)

    Checks wether the permanent variable exists.

    Parameters:
    name - The variable name to retrieve.

    getStorage

    public struct getStorage()

    Get the entire storage scope structure


    getVar

    public any getVar(string name, [any default=''])

    Get a new permanent variable. If the variable does not exist. The method returns blank unless using the default return argument.

    Parameters:
    name - The variable name to retrieve.
    default - The default value to set. If not used, a blank is returned.

    removeStorage

    public void removeStorage()

    remove the entire storage from scope


    safeName

    private any safeName(any value)

    Make a variable a safe var name

    Parameters:
    value - The value to make it var safe

    setVar

    public void setVar(string name, any value)

    Set a new permanent variable.

    Parameters:
    name - The name of the variable.
    value - The value to set in the variable.