org.cruxframework.crux.core.client.db
Class IDXAbstractDatabase

java.lang.Object
  extended by org.cruxframework.crux.core.client.db.AbstractDatabase
      extended by org.cruxframework.crux.core.client.db.IDXAbstractDatabase
All Implemented Interfaces:
Database

public abstract class IDXAbstractDatabase
extends AbstractDatabase

CRUX INTERNAL CLASS. DO NOT USE IT DIRECTLY. Indexed DB implementation for Database Interface. Use the interface Database to define your databases.

Author:
Thiago da Rosa de Bustamante

Field Summary
protected  IDBDatabase db
           
 
Fields inherited from class org.cruxframework.crux.core.client.db.AbstractDatabase
errorHandler, logger, messages, name, version
 
Constructor Summary
IDXAbstractDatabase()
           
 
Method Summary
 void close()
          Close the current database.
protected  Transaction createTransaction(String[] storeNames, Transaction.Mode mode)
           
 void delete(DatabaseCallback callback)
          Remove the current database from client browser.
protected  void doOpen(DatabaseCallback callback)
           
protected abstract
<K,V> ObjectStore<K,V>
getObjectStore(String storeName, IDBObjectStore idbObjectStore)
           
 boolean isOpen()
          Return true if the current database is open.
 boolean isSupported()
          Return true if Crux Database is supported by current browser.
protected abstract  void updateDatabaseStructure(IDBOpenDBRequest openDBRequest)
           
 
Methods inherited from class org.cruxframework.crux.core.client.db.AbstractDatabase
add, add, delete, delete, get, getName, getTransaction, getTransaction, getVersion, open, put, put, setDefaultErrorHandler, setName, setVersion, useIndexedDB, useWebSQL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

db

protected IDBDatabase db
Constructor Detail

IDXAbstractDatabase

public IDXAbstractDatabase()
Method Detail

close

public void close()
Description copied from interface: Database
Close the current database.


delete

public void delete(DatabaseCallback callback)
Description copied from interface: Database
Remove the current database from client browser.

Parameters:
callback - called when operation is completed

isOpen

public boolean isOpen()
Description copied from interface: Database
Return true if the current database is open.

Returns:
true if open

isSupported

public boolean isSupported()
Description copied from interface: Database
Return true if Crux Database is supported by current browser.

Returns:
true if supported

createTransaction

protected Transaction createTransaction(String[] storeNames,
                                        Transaction.Mode mode)
Specified by:
createTransaction in class AbstractDatabase

doOpen

protected void doOpen(DatabaseCallback callback)
Specified by:
doOpen in class AbstractDatabase

updateDatabaseStructure

protected abstract void updateDatabaseStructure(IDBOpenDBRequest openDBRequest)

getObjectStore

protected abstract <K,V> ObjectStore<K,V> getObjectStore(String storeName,
                                                         IDBObjectStore idbObjectStore)


Copyright © 2014. All rights reserved.