storage.CollectableStorage Extends goog.storage.ExpiringStorage
Provides a storage with expirning keys and a collection method.

Inheritance

Constructor

goog.storage.CollectableStorage(mechanism)

Parameters

mechanism : !goog.storage.mechanism.IterableMechanism
The underlying storage mechanism.

Instance Methods

Public Protected Private
collect(opt_strict)
Cleans up the storage by removing expired keys.
Arguments:
opt_strict : boolean=
Also remove invalid keys.
code »
collectInternal(keysopt_strict) !Array.<string>
Cleans up the storage by removing expired keys.
Arguments:
keys : Array.<string>
List of all keys.
opt_strict : boolean=
Also remove invalid keys.
Returns: !Array.<string>  a list of expired keys.
code »
getExpiredKeys_(keysopt_strict) !Array.<string>
Iterate over keys and returns those that expired.
Arguments:
keys : goog.iter.Iterable
keys to iterate over.
opt_strict : boolean=
Also return invalid keys.
Returns: !Array.<string>  Keys of values that expired.
code »
getWrapper(keyopt_expired) ⇒ (!Object | undefined)
Get an item wrapper (the item and its metadata) from the storage.
Arguments:
key : string
The key to get.
opt_expired : boolean=
If true, return expired wrappers as well.
Returns: (!Object | undefined)  The wrapper, or undefined if not found.
code »
set(keyvalueopt_expiration)
Set an item in the storage.
Arguments:
key : string
The key to set.
value : *
The value to serialize to a string and save.
opt_expiration : number=
The number of miliseconds since epoch (as in goog.now()) when the value is to expire. If the expiration time is not provided, the value will persist as long as possible.
code »
get()
No description.
code »
getWrapper(key) ⇒ (!Object | undefined)
Get an item wrapper (the item and its metadata) from the storage. WARNING: This returns an Object, which once used to be goog.storage.RichStorage.Wrapper. This is due to the fact that deserialized objects lose type information and it is hard to do proper typecasting in JavaScript. Be sure you know what you are doing when using the returned value.
Arguments:
key : string
The key to get.
Returns: (!Object | undefined)  The wrapper, or undefined if not found.
code »
set()
No description.
code »
get(key) *
Gets an item from the data storage.
Arguments:
key : string
The key to get.
Returns: *  Deserialized value or undefined if not found.
code »
remove(key)
Removes an item from the data storage.
Arguments:
key : string
The key to remove.
code »
set(keyvalue)
Sets an item in the data storage.
Arguments:
key : string
The key to set.
value : *
The value to serialize to a string and save.
code »

Instance Properties

constructor :
No description.
Code »
constructor :
No description.
Code »
constructor :
No description.
Code »
The mechanism used to persist key-value pairs.
Code »

Static Properties

goog.storage.CollectableStorage.superClass_ :
No description.
Code »

Package storage

Package Reference