static
Class YAHOO.util.StorageManager
The StorageManager class is a singleton that registers DataStorage objects and returns instances of those objects.
Properties
The storage location - local; data cleared on demand.
The storage location - session; data cleared at the end of a user's session.
Methods
private
Function
_getClass
(
klass
)
Fetches a storage constructor if it is available, otherwise returns NULL.
- Parameters:
-
klass
<Function>
Required. The storage constructor to test.
- Returns:
Function
- An available storage constructor or NULL.
private
void
_getStorageEngine
(
location
,
klass
,
conf
)
Fetches the storage engine from the cache, or creates and caches it.
- Parameters:
-
location
<String>
Required. The location to store.
-
klass
<Function>
Required. A pointer to the engineType Class.
-
conf
<Object>
Optional. Additional configuration for the data source engine.
- Returns:
void
private
void
_getValidLocation
(
location
)
Ensures that the location is valid before returning it or a default value.
- Parameters:
-
location
<String>
Required. The location to evaluate.
- Returns:
void
static
void
get
(
engineType
,
location
,
conf
)
Fetches the desired engine type or first available engine type.
- Parameters:
-
engineType
<String>
Optional. The engine type, see engines.
-
location
<String>
Optional. The storage location - LOCATION_SESSION & LOCATION_LOCAL; default is LOCAL.
-
conf
<Object} Optional. Additional configuration for the getting the storage engine.
{
engine: {Object} configuration parameters for the desired engine
order: {Array} an array of storage engine names; the desired order to try engines}
>
- Returns:
void
static
Boolean
register
(
engineConstructor
)
Registers a engineType Class with the StorageManager singleton; first in is the first out.
- Parameters:
-
engineConstructor
<Function>
Required. The engine constructor function, see engines.
- Returns:
Boolean
- When successfully registered.