com.accurisnetworks.accuroam
Class AccuROAMClient

java.lang.Object
  extended by com.accurisnetworks.accuroam.AccuROAMClient
Direct Known Subclasses:
Ipass

public class AccuROAMClient
extends java.lang.Object

Provides a class to register with AccuROAM server and generate a username/password using exchanged credentials. Creating an instance of this class will create entries in your Android App's preferences to preserve data across multiple runs. An app using this class requires the following Android permissions: INTERNET, SEND_SMS, READ_PHONE_STATE

Author:
Accuris Networks

Constructor Summary
AccuROAMClient()
           
 
Method Summary
 ResultMessages.CallHomeResult callHome(android.content.Context context)
          Call home to the server, checking for updated credentials.
 ResultMessages.CallHomeResult callHome(android.content.Context context, java.lang.String call_home_url)
          Call home to the server, checking for updated credentials.
 boolean checkIfRegistered(android.content.Context context)
          Check if we are already performed the registration procedure.
 UsernamePassword getUsernamePassword(android.content.Context context)
          Generate UsernamePassword based on registered credentials.
 ResultMessages.RegistrationResult register(android.content.Context context)
          Register with the server, exchanging credentials.
 ResultMessages.RegistrationResult register(android.content.Context context, java.lang.String sms_shortcode, java.lang.String registration_url, java.lang.String realm)
          Register with the server, exchanging credentials.
 ResultMessages.RegistrationResult register(android.content.Context context, java.lang.String sms_shortcode, java.lang.String registration_url, java.lang.String realm, java.lang.String user_agent)
          Register with the server, exchanging credentials.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccuROAMClient

public AccuROAMClient()
Method Detail

checkIfRegistered

public boolean checkIfRegistered(android.content.Context context)
Check if we are already performed the registration procedure.

This does not validate the credentials. It merely checks that credentials have been stored on the device. For example, if application was restarted, not uninstalled.

Use checkIfRegistered(Context) to check if credentials have already been exchanged and stored in internal device storage.

Parameters:
context - Android application context so service can access resources
Returns:
true if already registered, false if not

register

public ResultMessages.RegistrationResult register(android.content.Context context)
Register with the server, exchanging credentials. Uses default values for accessing the server.

This method contacts a remote server and may take several seconds to execute. Do not call it from a thread that may affect user interaction.

Use register(Context) to register.

Parameters:
context - Android application context so service can access resources
Returns:
RegistrationResult

register

public ResultMessages.RegistrationResult register(android.content.Context context,
                                                  java.lang.String sms_shortcode,
                                                  java.lang.String registration_url,
                                                  java.lang.String realm)
                                           throws java.net.MalformedURLException
Register with the server, exchanging credentials. Provides ability to override defaults.

This method contacts a remote server and may take several seconds to execute. Do not call it from a thread that may affect user interaction.

Use register(Context, String, String, String) to register.

Parameters:
context - Android application context so service can access resources
sms_shortcode - SMS destination address. If the device is CDMA and the shortcode is international you may need to prefix it with 011
registration_url - URL of registration server
realm - realm to use in UserName. This should be prefixed by '@' - e.g. '@abc.com'
Returns:
RegistrationResult
Throws:
java.net.MalformedURLException

register

public ResultMessages.RegistrationResult register(android.content.Context context,
                                                  java.lang.String sms_shortcode,
                                                  java.lang.String registration_url,
                                                  java.lang.String realm,
                                                  java.lang.String user_agent)
                                           throws java.net.MalformedURLException
Register with the server, exchanging credentials. Provides ability to override defaults.

This method contacts a remote server and may take several seconds to execute. Do not call it from a thread that may affect user interaction.

Use register(Context, String, String, String, String) to register.

Parameters:
context - Android application context so service can access resources
sms_shortcode - SMS destination address
registration_url - URL of registration server
realm - realm to use in UserName
user_agent - UserAgent to use in HTTP requests to server
Returns:
RegistrationResult
Throws:
java.net.MalformedURLException

callHome

public ResultMessages.CallHomeResult callHome(android.content.Context context)
Call home to the server, checking for updated credentials. Uses default values for accessing the server.

This method contacts a remote server and may take several seconds to execute. Do not call it from a thread that may affect user interaction.

Use callHome(Context) to call home.

Parameters:
context - Android application context so service can access resources

callHome

public ResultMessages.CallHomeResult callHome(android.content.Context context,
                                              java.lang.String call_home_url)
Call home to the server, checking for updated credentials. Provides ability to override defaults.

This method contacts a remote server and may take several seconds to execute. Do not call it from a thread that may affect user interaction.

Use callHome(Context, String) to call home.

Parameters:
context - Android application context so service can access resources
call_home_url - URL of call home server

getUsernamePassword

public UsernamePassword getUsernamePassword(android.content.Context context)
                                     throws NotRegisteredException
Generate UsernamePassword based on registered credentials. Use getUsernamePassword(Context) to retrieve username.

Returns:
instance of UsernamePassword class
Throws:
NotRegisteredException