YUI recommends YUI 3.

YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.

Yahoo! UI Library

Storage  2.8.2r1

Yahoo! UI Library > Storage > YAHOO.util.StorageManager

static Class YAHOO.util.StorageManager

The StorageManager class is a singleton that registers DataStorage objects and returns instances of those objects.


LOCATION_LOCAL - static {String}

The storage location - local; data cleared on demand.

LOCATION_SESSION - static {String}

The storage location - session; data cleared at the end of a user's session.



private Function _getClass ( klass )
Fetches a storage constructor if it is available, otherwise returns NULL.
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.
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.


private void _getValidLocation ( location )
Ensures that the location is valid before returning it or a default value.
location <String> Required. The location to evaluate.


static void get ( engineType , location , conf )
Fetches the desired engine type or first available engine type.
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} >


static Boolean register ( engineConstructor )
Registers a engineType Class with the StorageManager singleton; first in is the first out.
engineConstructor <Function> Required. The engine constructor function, see engines.
Returns: Boolean
When successfully registered.

Copyright © 2010 Yahoo! Inc. All rights reserved.