Accela SDK for Android  V3.0
 All Classes Functions Variables Pages
com.accela.mobile.AccelaMobile Class Reference

Inherited by com.accela.mobile.AccelaMobileInternal.

Classes

enum  AuthorizationStatus
 
enum  Environment
 

Public Member Functions

 AccelaMobile (Activity ownerActivity, String appId, String appSecret)
 
 AccelaMobile (Activity ownerActivity, String appId, String appSecret, AMSessionDelegate sessionDelegate)
 
void setAmIsRemember (Boolean remember)
 
String getAppId ()
 
String getAppSecret ()
 
String getAgency ()
 
Environment getEnvironment ()
 
void setEnvironment (Environment environment)
 
String getUrlSchema ()
 
void setUrlSchema (String urlSchema)
 
AMSessionDelegate getSessionDelegate ()
 
void setSessionDelegate (AMSessionDelegate sessionDelegate)
 
void setAuthorizationManager (AuthorizationManager authorizationManager)
 
AuthorizationStatus getAuthorizationStatus ()
 
void authorize (String[] permissions)
 
void authorize (String[] permissions, String agency)
 
void authorize2 (String[] permissions)
 
void authorize2 (String[] permissions, String agency)
 
Boolean isSessionValid ()
 
void logout ()
 
JSONObject fetch (String path, RequestParams urlParams)
 
JSONObject fetch (String path, RequestParams urlParams, HTTPMethod httpMethod, RequestParams postData)
 
AMRequest request (String path, RequestParams urlParams, AMRequestDelegate requestDelegate)
 
AMRequest request (String path, RequestParams urlParams, HTTPMethod httpMethod, RequestParams postData, AMRequestDelegate requestDelegate)
 
AMRequest request (String path, RequestParams urlParams, HTTPMethod httpMethod, RequestParams postData, Map< String, String > attachments, AMRequestDelegate requestDelegate)
 
AMRequest uploadAttachment (String path, RequestParams urlParams, Map< String, String > fileInformation, AMRequestDelegate requestDelegate)
 
AMRequest downloadAttachment (String path, RequestParams urlParams, String localFile, AMRequestDelegate requestDelegate)
 

Static Public Member Functions

static AccelaMobile defaultInstance ()
 

Protected Attributes

String amAuthHost
 
String amApisHost
 
AuthorizationManager authorizationManager
 
Boolean amIsRemember = true
 
AMSessionDelegate sessionDelegate
 
AuthorizationStatus authorizationStatus
 
Context ownerContext
 
ResourceBundle stringLoader = AMSetting.getStringResourceBundle()
 
String agency
 
Environment environment = Environment.PROD
 

Detailed Description

 Accela Amobile
 File: AccelaMobile.java
 Accela, Inc.
 Copyright (C): 2013
 Description:
 AccelaMobile object, used to call mobile cloud APIs.
 Notes:
 Revision History

   @since 1.0
 

Constructor & Destructor Documentation

com.accela.mobile.AccelaMobile.AccelaMobile ( Activity  ownerActivity,
String  appId,
String  appSecret 
)
inline

Constructor with the given activity, application Id, and application secret.

Parameters
ownerActivityThe activity which creates the current AccelaMobile instance.
appIdThe Id string of the current application.
appSecretThe secret string of the current application.
Returns
An initialized AccelaMobile instance.
Since
3.0
com.accela.mobile.AccelaMobile.AccelaMobile ( Activity  ownerActivity,
String  appId,
String  appSecret,
AMSessionDelegate  sessionDelegate 
)
inline

Constructor with the given activity, application Id, application secret, and session delegate.

Parameters
ownerActivityThe activity which creates the current AccelaMobile instance.
appIdThe Id string of the current application.
appSecretThe secret string of the current application.
sessionDelegateThe receiever's delegate or null if it doesn't have a delegate. See AMSessionDelegate for more information.
Returns
An initialized AccelaMobile instance.
Since
3.0

Member Function Documentation

void com.accela.mobile.AccelaMobile.authorize ( String[]  permissions)
inline

Authorizes user through web view with the given permissions array.

Parameters
permissionsThe array of access permissions. For example, search_records get_single_record create_record, and etc.
Returns
Void.
Since
3.0
void com.accela.mobile.AccelaMobile.authorize ( String[]  permissions,
String  agency 
)
inline

Authorizes user through web view with the given agency and permissions array.

Parameters
permissionsThe array of access permissions. For example, search_records get_single_record create_record, and etc.
agencyThe agency name.
Returns
Void.
Since
3.0
void com.accela.mobile.AccelaMobile.authorize2 ( String[]  permissions)
inline

Authorizes the user with the given agency, through the login web view wrapped in a native login dialog. The native login dialog will be presented for the user if he / she has not valid token. Otherwise, the user will be authorized directly without the native login dialog.

Parameters
permissionsThe array of access permissions. For example, search_records get_single_record create_record, and etc.
Returns
Void.
Since
3.0
void com.accela.mobile.AccelaMobile.authorize2 ( String[]  permissions,
String  agency 
)
inline

Authorizes the user with default agency defined in cloud, through the login web view wrapped in a native login dialog. The native login dialog will be presented for the user if he / she has not valid token. Otherwise, the user will be authorized directly without the native login dialog.

Parameters
permissionsThe array of access permissions. For example, search_records get_single_record create_record, and etc.
agencyThe agency name.
Returns
Void.
Since
3.0
static AccelaMobile com.accela.mobile.AccelaMobile.defaultInstance ( )
inlinestatic

Get a default static instance of the current class.

Returns
An initialized AccelaMobile instance.
Since
3.0
AMRequest com.accela.mobile.AccelaMobile.downloadAttachment ( String  path,
RequestParams  urlParams,
String  localFile,
AMRequestDelegate  requestDelegate 
)
inline

Downloads a binary file as an asynchronous operation.

Parameters
pathThe path to the Accela Mobile Cloud API endpoint.
urlParamsThe collection of parameters associated with the specific URL.
localFileThe path for file.
requestDelegateThe request's delegate or null if it doesn't have a delegate. See AMRequestDelegate for more information.
Returns
The AMRequest object corresponding to this Accela Mobile Cloud API endpoint call.
Since
1.0
JSONObject com.accela.mobile.AccelaMobile.fetch ( String  path,
RequestParams  urlParams 
)
inline

Synchronously get resource identified by the Accela Mobile Cloud API endpoint with the given parameters using HTTP GET method.

Parameters
pathThe path to the Accela Mobile Cloud API endpoint.
urlParamsThe collection of parameters associated with the specific URL.
Returns
A simple JSON object or a complex JSON object which contains child JSON objects.
Since
1.0
JSONObject com.accela.mobile.AccelaMobile.fetch ( String  path,
RequestParams  urlParams,
HTTPMethod  httpMethod,
RequestParams  postData 
)
inline

Synchronously get resource identified by the Accela Mobile Cloud API endpoint with the given parameters using the given HTTP method.

Parameters
pathThe path to the Accela Mobile Cloud API endpoint.
urlParamsThe collection of parameters associated with the specific URL.
httpMethodThe HTTP data transfer method (such as GET, POST, PUT or DELETE).
postDataThe content sent with the corresponding request(only used in POST or PUT method).
Returns
The resulting object is a simple JSON object or a complex JSON object which contains child JSON objects.
Since
1.0
String com.accela.mobile.AccelaMobile.getAgency ( )
inline

Get the value of property agency.

Returns
The value of property agency.
Since
1.0
String com.accela.mobile.AccelaMobile.getAppId ( )
inline

Get the value of property appId.

Returns
The value of property appId.
Since
1.0
String com.accela.mobile.AccelaMobile.getAppSecret ( )
inline

Get the value of property appSecret.

Returns
The value of property appSecret.
Since
3.0
AuthorizationStatus com.accela.mobile.AccelaMobile.getAuthorizationStatus ( )
inline

Get the flag whether the current user has been authorized.

Returns
true if user has been authorized; otherwise false.
Since
3.0
Environment com.accela.mobile.AccelaMobile.getEnvironment ( )
inline

Get the value of property environment.

Returns
The value of property environment.
Since
3.0
AMSessionDelegate com.accela.mobile.AccelaMobile.getSessionDelegate ( )
inline

Get the value of property sessionDelegate.

Returns
The value of property sessionDelegate.
Since
1.0
String com.accela.mobile.AccelaMobile.getUrlSchema ( )
inline

Get the value of property urlSchema.

Returns
The value of property urlSchema.
Since
2.1
Boolean com.accela.mobile.AccelaMobile.isSessionValid ( )
inline

Checks if the current session is valid or not.

Returns
true if user session is valid; otherwise false.
Since
1.0
void com.accela.mobile.AccelaMobile.logout ( )
inline

Logs out the user.

Returns
Void.
Since
1.0
AMRequest com.accela.mobile.AccelaMobile.request ( String  path,
RequestParams  urlParams,
AMRequestDelegate  requestDelegate 
)
inline

Makes a request to the Accela Mobile Cloud API endpoint with the given parameters using HTTP GET method as an asynchronous operation.

Parameters
pathThe path to the Accela Mobile Cloud API endpoint.
urlParamsThe collection of parameters associated with the specific URL.
requestDelegateThe request's delegate or null if it doesn't have a delegate. See AMRequestDelegate for more information.
Returns
The AMRequest object corresponding to this API call.
Since
1.0
AMRequest com.accela.mobile.AccelaMobile.request ( String  path,
RequestParams  urlParams,
HTTPMethod  httpMethod,
RequestParams  postData,
AMRequestDelegate  requestDelegate 
)
inline

Makes a request to the Accela Mobile Cloud API endpoint with the given parameters using the given HTTP method as an asynchronous operation.

Parameters
pathThe path to the Accela Mobile Cloud API endpoint.
urlParamsThe collection of parameters associated with the specific URL.
httpMethodThe HTTP data transfer method (such as GET, POST, PUT or DELETE).
postDataThe content sent with the corresponding request(only used in POST or PUT method).
requestDelegateThe request's delegate or null if it doesn't have a delegate. See AMRequestDelegate for more information.
Returns
The AMRequest object corresponding to this Accela Mobile Cloud API endpoint call.
Since
1.0
AMRequest com.accela.mobile.AccelaMobile.request ( String  path,
RequestParams  urlParams,
HTTPMethod  httpMethod,
RequestParams  postData,
Map< String, String >  attachments,
AMRequestDelegate  requestDelegate 
)
inline

Makes a request to upload multiple attachments as an asynchronous operation.

Parameters
pathThe path to the Accela Mobile Cloud API endpoint.
urlParamsThe collection of parameters associated with the specific URL.
httpMethodThe HTTP data transfer method (such as GET, POST, PUT or DELETE).
postDataThe content sent with the corresponding request(only used in POST or PUT method).
attachmentsThe attachments to be uploaded in the request. Values mapping: Key => File Path.
requestDelegateThe request's delegate or null if it doesn't have a delegate. See AMRequestDelegate for more information.
Returns
The AMRequest object corresponding to this Accela Mobile Cloud API endpoint call.
Since
3.0
void com.accela.mobile.AccelaMobile.setAmIsRemember ( Boolean  remember)
inline

Set the value of property amIsRemember.

Parameters
remembertrue or false.
Returns
Void.
Since
1.0
void com.accela.mobile.AccelaMobile.setAuthorizationManager ( AuthorizationManager  authorizationManager)
inline

Set the value of property authorizationManager.

Parameters
authorizationManagerThe new value to be assigned.
Returns
Void.
Since
3.0
void com.accela.mobile.AccelaMobile.setEnvironment ( Environment  environment)
inline

Set the value of property environment.

Parameters
environmentTypeThe new value to be assigned.
Returns
Void.
Since
3.0
void com.accela.mobile.AccelaMobile.setSessionDelegate ( AMSessionDelegate  sessionDelegate)
inline

Set the value of property sessionDelegate.

Parameters
sessionDelegateThe new value to be assigned.
Returns
Void.
Since
1.0
void com.accela.mobile.AccelaMobile.setUrlSchema ( String  urlSchema)
inline

Set the value of property urlSchema.

Parameters
urlSchemaThe new value to be assigned.
Returns
Void.
Since
2.1
AMRequest com.accela.mobile.AccelaMobile.uploadAttachment ( String  path,
RequestParams  urlParams,
Map< String, String >  fileInformation,
AMRequestDelegate  requestDelegate 
)
inline

Uploads a binary file as an asynchronous operation.

Parameters
pathThe path to the Accela Mobile Cloud API endpoint.
urlParamsThe collection of parameters associated with the specific URL.
fileInformationA dictionary instance specifies the name of the file as well as the path of it. Note that the key value of the file name should be "fileName" and the key value of the file path should be "localPath".
requestDelegateThe request's delegate or null if it doesn't have a delegate. See AMRequestDelegate for more information.
Returns
The AMRequest object corresponding to this Accela Mobile Cloud API endpoint call.
Since
1.0

Member Data Documentation

String com.accela.mobile.AccelaMobile.agency
protected

The agency to which user logs in.

Since
1.0
String com.accela.mobile.AccelaMobile.amApisHost
protected

The URL of cloud API host. For examle: https://apis.accela.com

Since
3.0
String com.accela.mobile.AccelaMobile.amAuthHost
protected

The URL of cloud authorization host. For examle: https://auth.accela.com

Since
3.0
Boolean com.accela.mobile.AccelaMobile.amIsRemember = true
protected

The flag which indicates whether user profile should be saved to local storage after successful login.

Since
1.0
AuthorizationManager com.accela.mobile.AccelaMobile.authorizationManager
protected

The AuthorizationManager instance which manages session state.

Since
3.0
AuthorizationStatus com.accela.mobile.AccelaMobile.authorizationStatus
protected

The authorization status

Since
3.0
Environment com.accela.mobile.AccelaMobile.environment = Environment.PROD
protected

The environment to which user logs in.

Since
3.0
Context com.accela.mobile.AccelaMobile.ownerContext
protected

The Android context (usually an Activity) which creates the current AccelaMobile instance.

Since
1.0
AMSessionDelegate com.accela.mobile.AccelaMobile.sessionDelegate
protected

The session delegate which methods are called during the progress of user authentication.

Since
1.0
ResourceBundle com.accela.mobile.AccelaMobile.stringLoader = AMSetting.getStringResourceBundle()
protected

The string loader which loads localized text strings.

Since
3.0

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