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

# Yahoo! UI Library

### Storage 2.8.1

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

#### _getStorageEngine

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

#### _getValidLocation

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

#### get

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

#### 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 © 2010 Yahoo! Inc. All rights reserved.