AeroGear Android Library 1.1.0

org.jboss.aerogear.android
Class DataManager

java.lang.Object
  extended by org.jboss.aerogear.android.DataManager

public class DataManager
extends Object

Represents an abstraction layer for a storage system.

As a note, you should NOT extend this class for production or application purposes. This class is made non-final ONLY for testing/mocking/academic purposes.


Constructor Summary
DataManager()
          Creates a new DataManager using DefaultIdGenerator and DefaultStoreFactory
DataManager(IdGenerator idGenerator)
          Creates a new DataManager using the idGenerator parameter and DefaultStoreFactory
DataManager(IdGenerator idGenerator, StoreFactory storeFactory)
          Creates a DataManager using the supplied parameters
DataManager(StoreFactory storeFactory)
          Creates a new DataManager using the storeFactory parameter and DefaultIdGenerator
 
Method Summary
 Store get(String storeName)
          Loads a given Store implementation, based on the given storeName argument.
 Store remove(String storeName)
          Removes a Store implementation from the DataManager.
 Store store(String storeName)
          Creates a new default (in memory) Store implementation.
 Store store(String storeName, StoreConfig config)
          Creates a new Store implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataManager

public DataManager()
Creates a new DataManager using DefaultIdGenerator and DefaultStoreFactory


DataManager

public DataManager(IdGenerator idGenerator)
Creates a new DataManager using the idGenerator parameter and DefaultStoreFactory

Parameters:
idGenerator -
Throws:
IllegalArgumentException - if idGenerator is null

DataManager

public DataManager(StoreFactory storeFactory)
Creates a new DataManager using the storeFactory parameter and DefaultIdGenerator

Parameters:
storeFactory -
Throws:
IllegalArgumentException - if storeFactory is null

DataManager

public DataManager(IdGenerator idGenerator,
                   StoreFactory storeFactory)
Creates a DataManager using the supplied parameters

Parameters:
idGenerator -
storeFactory -
Throws:
IllegalArgumentException - if idGenerator is null
IllegalArgumentException - if storeFactory is null
Method Detail

store

public Store store(String storeName)
Creates a new default (in memory) Store implementation.

Parameters:
storeName - The name of the actual data store object.

store

public Store store(String storeName,
                   StoreConfig config)
Creates a new Store implementation. The actual type is determined by the type argument.

Parameters:
storeName - The name of the actual data store object.
config - The config object used to build the store

remove

public Store remove(String storeName)
Removes a Store implementation from the DataManager. The store to be removed is determined by the storeName argument.

Parameters:
storeName - The name of the actual data store object.

get

public Store get(String storeName)
Loads a given Store implementation, based on the given storeName argument.

Parameters:
storeName - The name of the actual data store object.

AeroGear Android Library 1.1.0

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.