Home

# Class goog.gears.ManagedResourceStore

Creates a ManagedResourceStore with the specified name and update. This follows the Closure event model so the COMPLETE event will fire both for SUCCESS and for ERROR. You can use {@code isSuccess} in UPDATE to see if the capture was successful or you can just listen to the different events. This supports PROGRESS events, which are fired any time {@code filesComplete} or {@code filesTotal} changes. If the Gears version is 0.3.6 or newer this will reflect the numbers returned by the underlying Gears MRS but for older Gears versions this will just be {@code 0} or {@code 1}. NOTE: This relies on at least the 0.2 version of gears (for timer).

extends goog.events.EventTarget

Instance Method Summary
| `assertExists_()` Throws an error if the store has not yet been created via create().
| `assertNotExists_()` Throws an error if the store has already been created via create().
| `cancelStatusCheck_()` Cancel periodic status checks.
| `checkUpdateStatus_()` Called periodically as the update proceeds. If it has completed, fire an approproiate event and cancel further checks.
| `create(string= opt_manifestUrl)` Create the ManagedResourceStore in gears

`disposeInternal()`

Unattach listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners, it should be something like this:

    MyClass.prototype.disposeInternal = function() {
    MyClass.superClass_.disposeInternal.call(this);
    // Dispose logic for MyClass
    };

| `exists() ⇒ boolean` Determine if the ManagedResourceStore has been created in Gears yet
| `getFilesComplete() ⇒ number` Number of files completed. This is 0 or 1 if the Gears version does not support progress events. If the Gears version supports progress events this will reflect the number of files that have been completed.
| `getFilesTotal() ⇒ number` Number of total files to load. This is always 1 if the Gears version does not support progress events. If the Gears version supports progress events this will reflect the number of files that needs to be loaded.
| `getLastError() ⇒ string` Get the last error message.
| `getManifestUrl() ⇒ string`
| `getStatus() ⇒ ?goog.gears.ManagedResourceStore.UpdateStatus`
| `getVersion() ⇒ ?string`
| `handleComplete_(?Object details)` Callback for when the Gears managed resource store fires a complete event.
| `handleError_(?Object error)` Callback for when the Gears managed resource store fires an error event.
| `handleProgress_(?Object details)` Callback for when the Gears managed resource store fires a progress event.
| `isActive() ⇒ boolean`
| `isComplete() ⇒ boolean`
| `isEnabled() ⇒ boolean`
| `isSuccess() ⇒ boolean`
| `remove()` Remove managed store.
| `setEnabled(boolean isEnabled)` Sets whether the store is currently enabled to serve local content.
| `setFilesCounts_(number complete, number total)` Sets the filesComplete and the filesTotal and dispathces an event when either changes.
| `setManifestUrl(string url)`
| `update()` Starts an asynchronous process to update the ManagedResourcStore