coldbox.system.web.flash

Class AbstractFlashScope

WEB-INF.cftags.component
        extended by coldbox.system.web.flash.AbstractFlashScope
Class Attributes:
  • output : false
  •  
    Direct Known Subclasses:
    ClientFlash , ClusterFlash , ColdboxCacheFlash , MockFlash , SessionFlash

    An abstract flash scope that can be used to build ColdBox Flash scopes

    Constructor Summary
    init(any<Controller> controller, [any<struct> defaults='[runtime expression]'])
          Constructor.
    Method Summary
    any clear()
         Clear the temp flash scope and remove all data.
    any clearFlash()
         Clear the flash storage.
    any discard([string keys=''])
         Mark for discard all or a single flash temp variable for another relocation.
    boolean exists(string name)
         Check if an object exists in flash scope.
    boolean flashExists()
         Checks if the flash storage exists and IT HAS DATA to inflate.
    any get(string name, [any default])
         Get an object from flash scope.
    private Controller getController()
         Get the controller reference.
    struct getDefaults()
         Get flash scope default data packet.
    struct getFlash()
         Get the flash storage structure to inflate it.
    string getKeys()
         Get a list of all the objects in the temp flash scope.
    struct getProperties()
         Get flash scope properties.
    any getProperty(any property)
         Get a flash scope property, throws exception if not found.
    struct getScope()
         Get the flash temp request storage used throughout a request until flashed at the end of a request.
    private Util getUtil()
         Get the coldbox utility class.
    any inflateFlash()
         Inflate the flash storage into the request collection and request temp storage.
    boolean isEmpty()
         Check if the flash scope is empty or not.
    any keep([string keys=''])
         Keep all or a single flash temp variable alive for another relocation.
    any persistRC([string include=''], [string exclude=''], [boolean saveNow='false'])
         Persist keys from the coldbox request collection in flash scope.
    boolean propertyExists(any property)
         Checks wether a given flash scope property exists or not.
    any put(string name, any value, [boolean saveNow='false'], [boolean keep='true'], [boolean inflateToRC='[runtime expression]'], [boolean inflateToPRC='[runtime expression]'], [boolean autoPurge='[runtime expression]'])
         Put an object in temp flash scope.
    any putAll(struct map, [boolean saveNow='false'], [boolean keep='true'], [boolean inflateToRC='[runtime expression]'], [boolean inflateToPRC='[runtime expression]'], [boolean autoPurge='[runtime expression]'])
         Put a map of name-value pairs into the flash scope.
    any remove(string name, [boolean saveNow='false'])
         Remove an object from flash scope.
    any removeFlash()
         Remove the entire flash storage.
    any saveFlash()
         Save the flash storage in preparing to go to the next request.
    any setProperties(any<struct> properties)
         Set flash scope properties.
    any setProperty(any property, any value)
         Set a flash scope property.
    numeric size()
         Get the size of the items in flash scope.
    private any statusMarks([string keys=''], boolean keep)
         Change the status marks of the temp scope entries.
     
    Methods inherited from class WEB-INF.cftags.component
    None

    Constructor Detail

    init

    public init(any<Controller> controller, [any<struct> defaults='[runtime expression]'])

    Constructor

    Parameters:
    controller - The ColdBox Controller
    defaults - Default flash data packet for the flash RAM object=[scope,properties,inflateToRC,inflateToPRC,autoPurge,autoSave]

    Method Detail

    clear

    public any clear()

    Clear the temp flash scope and remove all data


    clearFlash

    public any clearFlash()

    Clear the flash storage


    discard

    public any discard([string keys=''])

    Mark for discard all or a single flash temp variable for another relocation. You can also remove them if you like.

    Parameters:
    keys - The keys in the flash ram that you want to be discarded until the next relocation

    exists

    public boolean exists(string name)

    Check if an object exists in flash scope

    Parameters:
    name - The name of the value

    flashExists

    public boolean flashExists()

    Checks if the flash storage exists and IT HAS DATA to inflate.


    get

    public any get(string name, [any default])

    Get an object from flash scope

    Parameters:
    name - The name of the value
    default - The default value if the scope does not have the object

    getController

    private Controller getController()

    Get the controller reference


    getDefaults

    public struct getDefaults()

    Get flash scope default data packet


    getFlash

    public struct getFlash()

    Get the flash storage structure to inflate it.


    getKeys

    public string getKeys()

    Get a list of all the objects in the temp flash scope


    getProperties

    public struct getProperties()

    Get flash scope properties


    getProperty

    public any getProperty(any property)

    Get a flash scope property, throws exception if not found.

    Parameters:
    property - The key of the property to return.

    getScope

    public struct getScope()

    Get the flash temp request storage used throughout a request until flashed at the end of a request.


    getUtil

    private Util getUtil()

    Get the coldbox utility class


    inflateFlash

    public any inflateFlash()

    Inflate the flash storage into the request collection and request temp storage


    isEmpty

    public boolean isEmpty()

    Check if the flash scope is empty or not


    keep

    public any keep([string keys=''])

    Keep all or a single flash temp variable alive for another relocation.

    Parameters:
    keys - The keys in the flash ram that you want to mark to be kept until the next relocation

    persistRC

    public any persistRC([string include=''], [string exclude=''], [boolean saveNow='false'])

    Persist keys from the coldbox request collection in flash scope. If using exclude, then it will try to persist the entire rc but excluding. Including will only include the keys passed.

    Parameters:
    include - MUTEX: A list of request collection keys you want to persist
    exclude - MUTEX: A list of request collection keys you want to exclude from persisting. If sent, then we inspect all rc keys.
    saveNow - Whether to send the contents for saving to flash ram or not. Default is to wait for a relocation

    propertyExists

    public boolean propertyExists(any property)

    Checks wether a given flash scope property exists or not.

    Parameters:
    property - The property name

    put

    public any put(string name, any value, [boolean saveNow='false'], [boolean keep='true'], [boolean inflateToRC='[runtime expression]'], [boolean inflateToPRC='[runtime expression]'], [boolean autoPurge='[runtime expression]'])

    Put an object in temp flash scope

    Parameters:
    name - The name of the value
    value - The value to store
    saveNow - Whether to send the contents for saving to flash ram or not. Default is to wait for a relocation
    keep - Whether to mark the entry to be kept after saving to the flash storage.
    inflateToRC - Whether this flash variable is inflated to the Request Collection or not
    inflateToPRC - Whether this flash variable is inflated to the Private Request Collection or not
    autoPurge - Flash memory auto purges variables for you. You can control this purging by saying false to autoPurge.

    putAll

    public any putAll(struct map, [boolean saveNow='false'], [boolean keep='true'], [boolean inflateToRC='[runtime expression]'], [boolean inflateToPRC='[runtime expression]'], [boolean autoPurge='[runtime expression]'])

    Put a map of name-value pairs into the flash scope

    Parameters:
    map - The map of data to flash
    saveNow - Whether to send the contents for saving to flash ram or not. Default is to wait for a relocation
    keep - Whether to mark the entry to be kept after saving to the flash storage.
    inflateToRC - Whether this flash variable is inflated to the Request Collection or not
    inflateToPRC - Whether this flash variable is inflated to the Private Request Collection or not
    autoPurge - Flash memory auto purges variables for you. You can control this purging by saying false to autoPurge.

    remove

    public any remove(string name, [boolean saveNow='false'])

    Remove an object from flash scope

    Parameters:
    name - The name of the value
    saveNow - Whether to send the contents for saving to flash ram or not. Default is to wait for a relocation

    removeFlash

    public any removeFlash()

    Remove the entire flash storage


    saveFlash

    public any saveFlash()

    Save the flash storage in preparing to go to the next request


    setProperties

    public any setProperties(any<struct> properties)

    Set flash scope properties

    Parameters:
    properties

    setProperty

    public any setProperty(any property, any value)

    Set a flash scope property

    Parameters:
    property - The property name to set.
    value - The value of the property.

    size

    public numeric size()

    Get the size of the items in flash scope


    statusMarks

    private any statusMarks([string keys=''], boolean keep)

    Change the status marks of the temp scope entries

    Parameters:
    keys - The keys in the flash ram that you want to be discarded or kept until the next relocation
    keep - Keep or Discard