Cortex Android
 All Classes Namespaces Functions Variables
nl.sense_os.cortex.coaching.Historian Class Reference
Inheritance diagram for nl.sense_os.cortex.coaching.Historian:

Public Member Functions

void startNewSample ()
 
boolean isSampleComplete ()
 
void onNewData (SensorDataPoint dataPoint)
 
List< TaskgetPastTasks (double start_time, double end_time, Coach.TYPE coach_type)
 
List< TaskgetPastTasks (double start_time, double end_time)
 
List< MessagegetMessages (Task task)
 
Task getTask (Message message)
 
void updateTaskValue (Task task)
 
DBBackendSync getDBBackEndSync ()
 
void clearHistory ()
 

Protected Member Functions

boolean firstTimeInit ()
 

Static Protected Member Functions

static synchronized Historian getInstance (SensePlatform sensePlatformt)
 

Protected Attributes

MessageDB messageDB
 
TaskDB taskDB
 
SensePlatform sensePlatform
 
DBBackendSync dbBackendSync
 
String PREFERENCES_FIRST_TIME_SYNCED = "historian_first_time_synced"
 

Static Protected Attributes

static final String name = "Historian"
 
static final String TAG = name
 

Member Function Documentation

void nl.sense_os.cortex.coaching.Historian.clearHistory ( )

Removes all the local historical data (tasks and messages)

boolean nl.sense_os.cortex.coaching.Historian.firstTimeInit ( )
protected

First time initialization

When this is the first run on this phone for this user, a check will be performed whether this users has old tasks and messages to be downloaded.

Returns
True if the initialization was successful. False if it failed.
DBBackendSync nl.sense_os.cortex.coaching.Historian.getDBBackEndSync ( )

Get the backend sync instance

The DBBackendSync uploads the Tasks, Messages, and Coach states to the back-end. With this instance the current local data can be manually flushed, and the periodically scheduled uploads can be started/stopped.

Returns
The DBBackendSync instance
static synchronized Historian nl.sense_os.cortex.coaching.Historian.getInstance ( SensePlatform  sensePlatformt)
staticprotected

The Historian instance

Returns the singleton instance of a historian.
The Historian receive data of all the Coaches.

Returns
The Historian instance
List<Message> nl.sense_os.cortex.coaching.Historian.getMessages ( Task  task)

Get Messages based on the Task

Get the messages of a Task.

Parameters
taskThe Task to get the messages for
Returns
A list with the Messages
List<Task> nl.sense_os.cortex.coaching.Historian.getPastTasks ( double  start_time,
double  end_time,
Coach.TYPE  coach_type 
)

Get the Completed tasks

Get the Tasks from a certain Coach.Type which were active in the given time range.

Parameters
start_timeThe epoch start time in seconds
end_timeThe epoch end time in seconds
coach_typeThe Coach.Type of the Coach
Returns
The past or current tasks for a certain period and coach type
List<Task> nl.sense_os.cortex.coaching.Historian.getPastTasks ( double  start_time,
double  end_time 
)

Get the Completed tasks

Get the Tasks which where active in the given time range.

Parameters
start_timeThe epoch start time in seconds
end_timeThe epoch end time in seconds
Returns
The past or current tasks for a certain period
Task nl.sense_os.cortex.coaching.Historian.getTask ( Message  message)

Get a Task based on the message

Parameters
messageThe message to find the task for
Returns
a Task

The documentation for this class was generated from the following file: