AeroGear Android Libary 1.0.0.M1

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

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.


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, getBaseURL, getEnrollEndpoint, getLoginEndpoint, getLogoutEndpoint, isLoggedIn
 

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 Libary 1.0.0.M1

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.