com.splitforce.lib.dao
Class SplitforceManifestDao

java.lang.Object
  extended by com.splitforce.lib.dao.SplitforceManifestDao
All Implemented Interfaces:
SfManifestDao

public class SplitforceManifestDao
extends java.lang.Object
implements SfManifestDao


Method Summary
 void addNewManifestRow(android.content.Context context, ManifestRow manifestRow)
          Add a new row (variation) to the Splitforce manifest.
 void deleteManifestRow(android.content.Context context, long id)
          Delete a row from the Splitforce manifest.
 ManifestRow getExperiment(android.content.Context context, java.lang.String name, boolean forceCohort)
          Get the selected experiment.
static SfManifestDao getInstance()
           
 java.util.List<ManifestRow> getManifestRows(android.content.Context context)
          Get all of the rows in the Splitforce Manifest.
 ManifestRow isManifestRowInDb(android.content.Context context, java.lang.String objectId)
          Checks if manifest row is in the ManifestTable
 void modifyManifestRowFromServer(android.content.Context context, ManifestRow manifestRow)
          Update local manifest data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SfManifestDao getInstance()

getManifestRows

public java.util.List<ManifestRow> getManifestRows(android.content.Context context)
Description copied from interface: SfManifestDao
Get all of the rows in the Splitforce Manifest.

Specified by:
getManifestRows in interface SfManifestDao
Parameters:
context - Application context
Returns:
A list of the manifest rows

getExperiment

public ManifestRow getExperiment(android.content.Context context,
                                 java.lang.String name,
                                 boolean forceCohort)
Description copied from interface: SfManifestDao
Get the selected experiment. If this is the first time accessing an experiment a variation will be cohorted here.

Specified by:
getExperiment in interface SfManifestDao
name - The name of the experiment
forceCohort - Cohort a new a variation even if one already was
Returns:
The cohorted variation

deleteManifestRow

public void deleteManifestRow(android.content.Context context,
                              long id)
Description copied from interface: SfManifestDao
Delete a row from the Splitforce manifest.

Specified by:
deleteManifestRow in interface SfManifestDao
Parameters:
context - The application's context.
id - The local id of the row to delete.

addNewManifestRow

public void addNewManifestRow(android.content.Context context,
                              ManifestRow manifestRow)
Description copied from interface: SfManifestDao
Add a new row (variation) to the Splitforce manifest.

Specified by:
addNewManifestRow in interface SfManifestDao
Parameters:
context - The applications context
manifestRow - The row to add.

isManifestRowInDb

public ManifestRow isManifestRowInDb(android.content.Context context,
                                     java.lang.String objectId)
Description copied from interface: SfManifestDao
Checks if manifest row is in the ManifestTable

Specified by:
isManifestRowInDb in interface SfManifestDao
objectId - Parse objectId
Returns:
a ManifestRow or null

modifyManifestRowFromServer

public void modifyManifestRowFromServer(android.content.Context context,
                                        ManifestRow manifestRow)
Description copied from interface: SfManifestDao
Update local manifest data. If the local data was previously cohorted that is persisted.

Specified by:
modifyManifestRowFromServer in interface SfManifestDao
manifestRow - The row to update