All Downloads are FREE. Search and download functionalities are using the official Maven repository.

elemental.html.IDBTransaction Maven / Gradle / Ivy

There is a newer version: 2.8.2.vaadin2
Show newest version
/*
 * Copyright 2012 Google Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package elemental.html;
import elemental.dom.DOMError;
import elemental.events.EventListener;
import elemental.events.EventTarget;
import elemental.events.Event;

import elemental.events.*;
import elemental.util.*;
import elemental.dom.*;
import elemental.html.*;
import elemental.css.*;
import elemental.stylesheets.*;

import java.util.Date;

/**
  * 

The IDBTransaction interface of the IndexedDB API provides a static, asynchronous transaction on a database using event handler attributes. All reading and writing of data are done within transactions. You actually use IDBDatabase to start transactions and use IDBTransaction to set the mode of the transaction and access an object store and make your request. You can also use it to abort transactions.

Inherits from: EventTarget

*/ public interface IDBTransaction extends EventTarget { /** * Allows data to be read but not changed.  */ static final int READ_ONLY = 0; /** * Allows reading and writing of data in existing data stores to be changed. */ static final int READ_WRITE = 1; /** * Allows any operation to be performed, including ones that delete and create object stores and indexes. This mode is for updating the version number of transactions that were started using the setVersion() method of IDBDatabase objects. Transactions of this mode cannot run concurrently with other transactions. */ static final int VERSION_CHANGE = 2; /** * The database connection that this transaction is associated with. */ IDBDatabase getDb(); DOMError getError(); /** * The mode for isolating access to data in the object stores that are in the scope of the transaction. For possible values, see Constants. The default value is READ_ONLY. */ String getMode(); EventListener getOnabort(); void setOnabort(EventListener arg); EventListener getOncomplete(); void setOncomplete(EventListener arg); EventListener getOnerror(); void setOnerror(EventListener arg); /** *

Returns immediately, and undoes all the changes to objects in the database associated with this transaction. If this transaction has been aborted or completed, then this method throws an error event, with its code set to ABORT_ERR and a suitable message.

All pending IDBRequest objects created during this transaction have their errorCode set to ABORT_ERR.

Exceptions

This method can raise an IDBDatabaseException, with the following code:

NOT_ALLOWED_ERR
The transaction has already been committed or aborted.
*/ void abort(); EventRemover addEventListener(String type, EventListener listener); EventRemover addEventListener(String type, EventListener listener, boolean useCapture); boolean dispatchEvent(Event evt); /** *

Returns an object store that has already been added to the scope of this transaction. Every call to this method on the same transaction object, with the same name, returns the same IDBObjectStore instance. If this method is called on a different transaction object, a different IDBObjectStore instance is returned.

Parameters
name
The name of the requested object store.
Returns
IDBObjectStore
An object for accessing the requested object store.
Exceptions

The method can raise an IDBDatabaseException with the following code:

NOT_FOUND_ERR
The requested object store is not in this transaction's scope.
NOT_ALLOWED_ERR
request is made on a source object that has been deleted or removed..
*/ IDBObjectStore objectStore(String name); void removeEventListener(String type, EventListener listener); void removeEventListener(String type, EventListener listener, boolean useCapture); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy