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

Public Member Functions

 UserDB (SensePlatform sensePlatform)
 
User createUser (String email, String password, JSONObject user_info, String secret_code) throws Exception
 
User getUser () throws Exception
 
boolean updateUserInfo (User user)
 
boolean deleteUser ()
 
- Public Member Functions inherited from nl.sense_os.cortex.coaching.db.CoachingDB
 CoachingDB (SensePlatform sensePlatform, JSONObject dataStructure)
 
SQLiteDatabase getWritableDatabase ()
 
SQLiteDatabase getReadableDatabase ()
 
void onConfigure (SQLiteDatabase db)
 
void onOpen (SQLiteDatabase db)
 
void onCreate (SQLiteDatabase db)
 
void onUpgrade (SQLiteDatabase db, int oldVersion, int newVersion)
 
boolean add (JSONObject object)
 
boolean add (JSONObject object, SQLiteDatabase db)
 
JSONArray get (JSONObject criterion)
 
JSONArray get (JSONObject start_criterion, JSONObject end_criterion)
 
void clearTable ()
 

Static Public Attributes

static String KEY_USER_INFO = "userInfo"
 
static String KEY_EMAIL = "email"
 
- Static Public Attributes inherited from nl.sense_os.cortex.coaching.db.CoachingDB
static final String KEY_ID = "_id"
 
static final String KEY_LOGIN_USERNAME = "login_username"
 
static final String KEY_MUTATED_AT = "mutated_at"
 

Static Protected Attributes

static String TAG = "UserDB"
 
static UserAPI mUserApi
 
- Static Protected Attributes inherited from nl.sense_os.cortex.coaching.db.CoachingDB
static String TAG = "CoachingDB"
 
static final String TYPE_INTEGER = " INTEGER"
 
static final String TYPE_TEXT = " TEXT"
 
static final String TYPE_DATETIME = " DATETIME"
 
static final String TYPE_REAL = " REAL"
 

Additional Inherited Members

- Protected Member Functions inherited from nl.sense_os.cortex.coaching.db.CoachingDB
String getLoginUsername ()
 
String createTableString ()
 
ContentValues toContentValues (JSONObject object)
 
String createEquals (JSONObject criterion)
 
String createBetween (JSONObject first_criterion, JSONObject second_criterion)
 
JSONObject getSingleCreterion (JSONObject first_criterion, JSONObject second_criterion)
 
JSONObject toJSONObject (Cursor c)
 
boolean update (JSONObject object)
 
boolean delete (JSONObject object)
 
- Protected Attributes inherited from nl.sense_os.cortex.coaching.db.CoachingDB
String tableName
 
JSONObject dataStructure
 
SensePlatform sensePlatform
 
boolean userAutoIncrementKey = true
 
boolean isUserSpecificTable = true
 
boolean tableCreated = false
 

Member Function Documentation

User nl.sense_os.cortex.coaching.db.UserDB.createUser ( String  email,
String  password,
JSONObject  user_info,
String  secret_code 
) throws Exception

Creates the Coaching enabled CommonSense user

Will create a CommonSense user which is added to the Coaching database

Parameters
emailThe email of the user
passwordThe md5 hashed password of the user
user_infothe JSONOBject user info
secret_codeThe secret registration code
Returns
The Coaching enabled user. Will return null if it fails.
boolean nl.sense_os.cortex.coaching.db.UserDB.deleteUser ( )

Delete the current user

This will delete the current user and all of it's data locally, in the coaching engine back-end and in CommonSense.

Returns
True if the user was removed successfully
User nl.sense_os.cortex.coaching.db.UserDB.getUser ( ) throws Exception

Get the CommonSense Coaching User

This will return the user object from the Coaching database

Returns
The User object. Throws an exception if the user could not be found.
boolean nl.sense_os.cortex.coaching.db.UserDB.updateUserInfo ( User  user)

Updates the User's user info into in the Coaching database

Updates an existing user's user info in the Coaching database

Parameters
userThe User object
Returns
Returns true if the update was successful else False;

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