API: Storage YAHOO.util.StorageManager (YUI Library)

# Yahoo! UI Library

### Storage 2.9.0

Yahoo! UI Library > Storage > YAHOO.util.StorageManager
Search:
Filters Show Private Show Protected Show Deprecated

## `static` Class YAHOO.util.StorageManager

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

### Properties

#### 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.

### Methods

#### _getClass

`private Function _getClass ( fnClass )`
Fetches a storage constructor if it is available, otherwise returns NULL.

Parameters:
  `fnClass <Function>` Required. The storage constructor to test.

Returns: `Function`
  An available storage constructor or NULL.

#### _getStorageEngine

`private void _getStorageEngine ( sLocation , fnClass , oConf )`
Fetches the storage engine from the cache, or creates and caches it.

Parameters:
  `sLocation <String>` Required. The location to store.
  `fnClass <Function>` Required. A pointer to the engineType Class.
  `oConf <Object>` Optional. Additional configuration for the data source engine.

#### _getValidLocation

`private void _getValidLocation ( sLocation )`
Ensures that the location is valid before returning it or a default value.

Parameters:
  `sLocation <String>` Required. The location to evaluate.

#### get

`static void get ( engineType , sLocation , oConf )`
Fetches the desired engine type or first available engine type.

Parameters:
  `engineType <String>` Optional. The engine type, see engines.
  `sLocation <String>` Optional. The storage location - LOCATION_SESSION & LOCATION_LOCAL; default is LOCAL.
  `oConf <Object} Optional. Additional configuration for the getting the storage engine. { engine: {Object} configuration parameters for the desired engine force: {Boolean} force the `engineType` or fail order: {Array} an array of storage engine names; the desired order to try engines} >`

#### register

`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.

Copyright © 2011 Yahoo! Inc. All rights reserved.