Cortex Android
 All Classes Namespaces Functions Variables
nl.sense_os.cortex.coaching.backend.CoachingAPI Class Reference
Inheritance diagram for nl.sense_os.cortex.coaching.backend.CoachingAPI:
nl.sense_os.cortex.coaching.backend.AdviceAPI nl.sense_os.cortex.coaching.backend.CoachAPI nl.sense_os.cortex.coaching.backend.DomainStateAPI nl.sense_os.cortex.coaching.backend.MessageAPI nl.sense_os.cortex.coaching.backend.StyleMessageAPI nl.sense_os.cortex.coaching.backend.TaskAPI nl.sense_os.cortex.coaching.backend.UserAPI

Static Public Attributes

static final String BASE_URL_PRODUCTION = "https://coaching-api.sense-os.nl"
 

Protected Member Functions

 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
 

Protected Attributes

final String RESPONSE_CODE = "http response code"
 
final String RESPONSE_CONTENT = "content"
 
String secret_code
 
SensePlatform mSensePlatform
 
SharedPreferences mAuthPrefs
 
CoachingEngine coachingEngine
 

Static Protected Attributes

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"
 

Member Function Documentation

Map<String, String> nl.sense_os.cortex.coaching.backend.CoachingAPI.request ( String  endPoint,
JSONObject  content 
) throws IOException, RuntimeException
protected

Performs request at CommonSense API. Returns the response code, content, and headers.

Parameters
sensePlatformSensePlaform, used to read preferences.
endPointThe end point of the URL to perform request to (e.g.: /users).
content(Optional) Content for the request. If the content is not null, the request method is automatically POST. The default method is GET.
Returns
Map with SenseApi.KEY_CONTENT and SenseApi.KEY_RESPONSE_CODE fields, plus fields for all response headers.
Exceptions
IOException
Map<String, String> nl.sense_os.cortex.coaching.backend.CoachingAPI.request ( String  endPoint,
JSONObject  content,
String  requestMethod 
) throws IOException, RuntimeException
protected

Performs request at CommonSense API. Returns the response code, content, and headers.

Parameters
sensePlatformSensePlaform, used to read preferences.
endPointThe end point of the URL to perform request to (e.g.: /users).
content(Optional) Content for the request. If the content is not null, the request method is automatically POST. The default method is GET.
Returns
Map with SenseApi.KEY_CONTENT and SenseApi.KEY_RESPONSE_CODE fields, plus fields for all response headers.
Exceptions
IOException

Member Data Documentation

final String nl.sense_os.cortex.coaching.backend.CoachingAPI.REQUEST_METHOD_PUT = "PUT"
staticprotected

HTTP methods

final String nl.sense_os.cortex.coaching.backend.CoachingAPI.RESPONSE_CODE = "http response code"
protected

Key for getting the http response code from the Map object that is returned by

final String nl.sense_os.cortex.coaching.backend.CoachingAPI.RESPONSE_CONTENT = "content"
protected

Key for getting the response content from the Map object that is returned by

final String nl.sense_os.cortex.coaching.backend.CoachingAPI.RESPONSE_OK = "200"
staticprotected

Response codes


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