lucee.Componentcoldbox.system.cache.store.JDBCStore
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- I am a cool cool JDBC Store for CacheBox You need to create the table first with the following columns id - varchar(100) PK objectKey - varchar(255) objectValue - clob, longtext, etc hits - integer timeout - integer lastAccessTimeout - integer created - datetime or timestamp lastAccessed - datetime or timestamp isExpired - tinyint or boolean isSimple - tinyint or boolean We also recommend indexes for: hits, created, lastAccessed, timeout and isExpired columns. Or look in the /coldbox/system/cache/store/sql/*.sql for you sql script for your DB.
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any<ICacheProvider>
|
cacheProvider
The cache provider reference.
|
true
|
false
|
|
any<ObjectMarshaller>
|
converter
The object serializer and deserializer utility.
|
true
|
false
|
|
any
|
dsn
The datasource to use for the connection.
|
true
|
false
|
|
any
|
dsnPassword
The password to use for the connection, if any.
|
true
|
false
|
|
any
|
dsnUsername
The username to use for the connection, if any.
|
true
|
false
|
|
any<MetadataIndexer>
|
indexer
The metadata indexer object.
|
true
|
false
|
|
any
|
storeID
The human store name.
|
true
|
false
|
|
any
|
table
The table to use for storage.
|
true
|
false
|
|
boolean
|
tableAutoCreate
Auto create the table or just use it.
|
true
|
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. |
private any
|
ensureTable()
Create the caching table if necessary. |
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. |
string
|
getCacheProvider()
|
string
|
getConverter()
|
string
|
getDsn()
|
string
|
getDsnPassword()
|
string
|
getDsnUsername()
|
any
|
getIndexer()
Get the store's pool metadata indexer structure. |
any
|
getKeys()
Get all the store's object keys array. |
any
|
getNormalizedId(any objectKey)
Get the cached normalized id as we store it. |
any
|
getQuiet(any objectKey)
Get an object from cache with no metadata tracking. |
any
|
getSize()
Get the size of the store. |
string
|
getStoreID()
|
string
|
getTable()
|
string
|
getTableAutoCreate()
|
any
|
isExpired(any objectKey)
Expire check. |
any
|
lookup(any objectKey)
Check if an object is in the store. |
private query
|
lookupQuery(any objectKey)
Get the id and isExpired from the object. |
void
|
reap()
Reap the storage. |
void
|
set(any objectKey, any object, [any timeout='0'], [any lastAccessTimeout='0'], [any extras='[runtime expression]'])
Sets an object in the storage. |
any
|
setCacheProvider(any cacheProvider)
|
any
|
setConverter(any converter)
|
any
|
setDsn(any dsn)
|
any
|
setDsnPassword(any dsnPassword)
|
any
|
setDsnUsername(any dsnUsername)
|
any
|
setIndexer(any indexer)
|
any
|
setStoreID(any storeID)
|
any
|
setTable(any table)
|
any
|
setTableAutoCreate(boolean tableAutoCreate)
|
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
cacheProvider
- The associated cache provider as coldbox.system.cache.providers.ICacheProviderProperty Detail |
---|
The cache provider reference
access
- publicrequired
- falsereturntype
- anydoc_generic
- coldbox.system.cache.providers.ICacheProviderserializable
- trueThe object serializer and deserializer utility
access
- publicrequired
- falsereturntype
- anydoc_generic
- coldbox.system.core.conversion.ObjectMarshallerserializable
- trueThe datasource to use for the connection
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe password to use for the connection, if any
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe username to use for the connection, if any
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe metadata indexer object
access
- publicrequired
- falsereturntype
- anydoc_generic
- coldbox.system.cache.store.indexers.MetadataIndexerserializable
- trueThe human store name
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe table to use for storage
access
- publicrequired
- falsereturntype
- anyserializable
- trueAuto create the table or just use it
access
- publicrequired
- falsereturntype
- anyserializable
- trueMethod Detail |
---|
Clears an object from the storage
clear
in interface
IObjectStore
objectKey
- The object key to clearClear all the elements in the store
clearAll
in interface
IObjectStore
Create the caching table if necessary
Expire an object
expireObject
in interface
IObjectStore
objectKey
- The key to expireFlush the store to a permanent storage
flush
in interface
IObjectStore
Get an object from the store with metadata tracking, or null if not found
get
in interface
IObjectStore
objectKey
- The key to retrieveGet the store's pool metadata indexer structure
getIndexer
in interface
IObjectStore
Get all the store's object keys array
getKeys
in interface
IObjectStore
Get the cached normalized id as we store it
objectKey
- The object keyGet an object from cache with no metadata tracking
getQuiet
in interface
IObjectStore
objectKey
- The key to retrieveGet the size of the store
getSize
in interface
IObjectStore
Expire check
isExpired
in interface
IObjectStore
objectKey
- The key to checkCheck if an object is in the store
lookup
in interface
IObjectStore
objectKey
- The key to lookupGet the id and isExpired from the object
objectKey
- The key of the objectReap the storage
reap
in interface
IObjectStore
Sets an object in the storage
set
in interface
IObjectStore
objectKey
- The object keyobject
- The object to savetimeout
- Timeout in minuteslastAccessTimeout
- Idle Timeout in minutesextras
- A map of extra name-value pairs to store alongside the objectcacheProvider
converter
dsn
dsnPassword
dsnUsername
indexer
storeID
table
tableAutoCreate