lucee.Component coldbox.system.web.flash.AbstractFlashScope
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- An abstract flash scope that can be used to build ColdBox Flash scopes. In order to build scopes you must implement the following methods: - clearFlash() A method that will destroy the flash storage - saveFlash() A method that will be called before relocating so the storage can be saved - flashExists() A method that tells ColdBox if the storage exists and if it has content to inflate - getFlash() A method that returns the flash storage All these methds can use any of the concrete methods below. The most important one is the getScope() method which will most likely be called by the saveFlash() method in order to persist the flashed map.
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
controller
ColdBox Controller.
|
true
|
false
|
|
any
|
defaults
Flash Defaults.
|
true
|
false
|
|
any
|
properties
Flash Properties.
|
true
|
false
|
Constructor Summary | |
---|---|
init(any controller, 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=''])
Keep all or a single flash temp variable alive for another relocation. |
boolean
|
exists(any 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(any name, [any defaultValue])
Get an object from flash scope. |
string
|
getController()
|
string
|
getDefaults()
|
struct
|
getFlash()
Get the flash storage structure to inflate it. |
string
|
getKeys()
Get a list of all the objects in the temp flash scope. |
string
|
getProperties()
|
any
|
getProperty(any property)
Get a named property. |
struct
|
getScope()
Get the flash temp request storage used throughout a request until flashed at the end of a request. |
private any
|
getUtil()
Get utility object. |
any
|
inflateFlash()
|
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([any include=''], [any exclude=''], [boolean saveNow='false'])
Persist keys from the coldbox request collection in flash scope. |
any
|
propertyExists(any property)
Check a named property. |
any
|
put(string name, any value, [boolean saveNow='false'], [boolean keep='true'], [boolean inflateToRC='[runtime expression]'], [boolean inflateToPRC='[runtime expression]'], [boolean autoPurge='[runtime expression]'])
Keep all or a single flash temp variable alive for another relocation. |
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(any 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
|
setController(any controller)
|
any
|
setDefaults(any defaults)
|
any
|
setProperties(any properties)
|
any
|
setProperty(any property, any value)
Set a named property. |
numeric
|
size()
Get the size of the items in flash scope. |
private any
|
statusMarks([string keys=''], [boolean keep='true'])
Change the status marks of the temp scope entries. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
controller
- ColdBox Controllerdefaults
- Default flash data packet for the flash RAM object=[scope,properties,inflateToRC,inflateToPRC,autoPurge,autoSave]Property Detail |
---|
ColdBox Controller
access
- publicrequired
- falsereturntype
- anyserializable
- trueFlash Defaults
access
- publicrequired
- falsereturntype
- anyserializable
- trueFlash Properties
access
- publicrequired
- falsereturntype
- anyserializable
- trueMethod Detail |
---|
Clear the temp flash scope and remove all data
Clear the flash storage
Keep all or a single flash temp variable alive for another relocation
keys
- The keys in the flash RAM that you want to mark to be kept until the next requestCheck if an object exists in flash scope
name
- The name of the valueChecks if the flash storage exists and IT HAS DATA to inflate.
Get an object from flash scope
name
- The name of the valuedefaultValue
- The default value if the scope does not have the object"Get the flash storage structure to inflate it.
Get a list of all the objects in the temp flash scope
Get a named property
property
- The property nameGet the flash temp request storage used throughout a request until flashed at the end of a request.
Get utility object
Check if the flash scope is empty or not
Keep all or a single flash temp variable alive for another relocation
keys
- The keys in the flash RAM that you want to mark to be kept until the next requestPersist 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
include
- MUTEX: A list of request collection keys you want to persistexclude
- 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 relocationCheck a named property
property
- The property nameKeep all or a single flash temp variable alive for another relocation
name
- The name of the valuevalue
- The value to storesaveNow
- Whether to send the contents for saving to flash ram or not. Default is to wait for a relocationkeep
- 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 notinflateToPRC
- Whether this flash variable is inflated to the Private Request Collection or notautoPurge
- Flash memory auto purges variables for you. You can control this purging by saying false to autoPurgePut a map of name-value pairs into the flash scope
map
- The map of data to flashsaveNow
- Whether to send the contents for saving to flash ram or not. Default is to wait for a relocationkeep
- 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 notinflateToPRC
- Whether this flash variable is inflated to the Private Request Collection or notautoPurge
- Flash memory auto purges variables for you. You can control this purging by saying false to autoPurgeRemove an object from flash scope
name
- Whether to send the contents for saving to flash ram or not. Default is to wait for a relocationsaveNow
- trueRemove the entire flash storage
Save the flash storage in preparing to go to the next request
controller
defaults
properties
Set a named property
property
- The property namevalue
- The valueGet the size of the items in flash scope
Change the status marks of the temp scope entries
keys
keep