|
User | createUser (String email, String password, JSONObject user_info, String secret_code) throws IOException, RuntimeException |
|
User | getUser () throws IOException, RuntimeException |
|
void | deleteUser () throws IOException, RuntimeException |
|
boolean | updateUser (User user) throws Exception |
|
|
static UserAPI | getInstance (SensePlatform sensePlatform) |
|
|
final String | USER_END_POINT_PREFIX = "/users" |
|
final String | RESPONSE_CODE = "http response code" |
|
final String | RESPONSE_CONTENT = "content" |
|
String | secret_code |
|
SensePlatform | mSensePlatform |
|
SharedPreferences | mAuthPrefs |
|
CoachingEngine | coachingEngine |
|
|
static final String | TAG = "UserAPI" |
|
static String | KEY_USER_ID = "user_id" |
|
static String | KEY_USER_INFO = "user_info" |
|
static String | KEY_EMAIL = "email" |
|
static String | KEY_PASSWORD = "password" |
|
static String | KEY_USER_TYPE = "user_type" |
|
static String | KEY_SECRET_CODE = "secret_code" |
|
static UserAPI | instance |
|
static String | BASE_URL_STAGING = "http://coaching-api.staging.sense-os.nl" |
|
static String | BASE_URL_TESTING = "http://coaching-api.dev.sense-os.nl" |
|
static final String | RESPONSE_OK = "200" |
|
static final String | RESPONSE_CREATED = "201" |
|
static final String | RESPONSE_NO_CONENT = "204" |
|
static final String | REQUEST_METHOD_PUT = "PUT" |
|
static final String | REQUEST_METHOD_DELETE = "DELETE" |
|
|
static final String | BASE_URL_PRODUCTION = "https://coaching-api.sense-os.nl" |
|
| CoachingAPI (SensePlatform sensePlatform) |
|
Map< String, String > | request (String endPoint, JSONObject content) throws IOException, RuntimeException |
|
BACKEND_RELEASE | getBackendRelease () |
|
Map< String, String > | request (String endPoint, JSONObject content, String requestMethod) throws IOException, RuntimeException |
|
User nl.sense_os.cortex.coaching.backend.UserAPI.createUser |
( |
String |
email, |
|
|
String |
password, |
|
|
JSONObject |
user_info, |
|
|
String |
secret_code |
|
) |
| throws IOException, RuntimeException |
Creates the Coaching enabled CommonSense user
Will create a CommonSense user which is enabled added to the Coaching database. The current user will be logged out.
- Parameters
-
email | The email of the user |
password | The md5 hashed password of the user |
user_info | the JSONOBject user info |
secret_code | The secret registration code |
- Returns
- The Coaching enabled user. Will return null if it fails.
void nl.sense_os.cortex.coaching.backend.UserAPI.deleteUser |
( |
| ) |
throws IOException, RuntimeException |
Delete the CommonSense Coaching User
This will delete the user and all it's data from the Coaching database and CommonSense
User nl.sense_os.cortex.coaching.backend.UserAPI.getUser |
( |
| ) |
throws IOException, RuntimeException |
Get the CommonSense Coaching User
This will return the user object from the Coaching database
- Returns
- The User object
boolean nl.sense_os.cortex.coaching.backend.UserAPI.updateUser |
( |
User |
user | ) |
throws Exception |
Updates the User in the Coaching database
Updates an existing user in the Coaching database
- Parameters
-
- Returns
- True if it was successful, false if it failed.
The documentation for this class was generated from the following file:
- android-sdk/src/nl/sense_os/cortex/coaching/backend/UserAPI.java