AeroGear Android Library 1.1.0

org.jboss.aerogear.android.authentication
Class AbstractAuthenticationModule

java.lang.Object
  extended by org.jboss.aerogear.android.authentication.AbstractAuthenticationModule
All Implemented Interfaces:
AuthenticationModule
Direct Known Subclasses:
AGSecurityAuthenticationModule, HttpBasicAuthenticationModule, HttpDigestAuthenticationModule

public abstract class AbstractAuthenticationModule
extends Object
implements AuthenticationModule

This class stubs out the enroll, login, and logout methods. If you call these methods without overriding them they will throw an IllegalStateException in the callback. This will be passed to onFailure as normal.


Field Summary
protected static Executor THREAD_POOL_EXECUTOR
           
 
Constructor Summary
AbstractAuthenticationModule()
           
 
Method Summary
 void enroll(Map<String,String> userData, Callback<HeaderAndBody> callback)
          Will try to register a user with a service using userData.
 void login(String username, String password, Callback<HeaderAndBody> callback)
          Will try to log in a user using username and password.
 void logout(Callback<Void> callback)
          Performs a logout of the current user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.aerogear.android.authentication.AuthenticationModule
getAuthorizationFields, getAuthorizationFields, getBaseURL, getEnrollEndpoint, getLoginEndpoint, getLogoutEndpoint, isLoggedIn, retryLogin
 

Field Detail

THREAD_POOL_EXECUTOR

protected static final Executor THREAD_POOL_EXECUTOR
Constructor Detail

AbstractAuthenticationModule

public AbstractAuthenticationModule()
Method Detail

enroll

public void enroll(Map<String,String> userData,
                   Callback<HeaderAndBody> callback)
Description copied from interface: AuthenticationModule
Will try to register a user with a service using userData.

It will call the callbacks onSuccess with a parameter of a Map of the values returned by the enroll service or onFailure if there is an error

Specified by:
enroll in interface AuthenticationModule

login

public void login(String username,
                  String password,
                  Callback<HeaderAndBody> callback)
Description copied from interface: AuthenticationModule
Will try to log in a user using username and password.

It will call the callbacks onSuccess with a parameter of a Map of the values returned by the enroll service or onFailure if there is an error

Specified by:
login in interface AuthenticationModule

logout

public void logout(Callback<Void> callback)
Description copied from interface: AuthenticationModule
Performs a logout of the current user.

It will call callback.onSuccess with no value on success and callback.onFailure if there is an error.

Specified by:
logout in interface AuthenticationModule

AeroGear Android Library 1.1.0

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.