|
AeroGear Android Library 1.1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.aerogear.android.authentication.impl.loader.AuthenticationModuleAdapter
public class AuthenticationModuleAdapter
This class manages the relationship between Android's Loader framework and
requests to Authentication. This class acts as a proxy for an
AuthenticationModule instance.
This class instantiates the Loaders from android.content and will not work on
devices < Android 3.0. For these devices see
SupportAuthenticationModuleAdapter
| Field Summary |
|---|
| Fields inherited from interface org.jboss.aerogear.android.authentication.impl.loader.LoaderAuthenticationModule |
|---|
CALLBACK, METHOD, PARAMS, PASSWORD, USERNAME |
| Constructor Summary | |
|---|---|
AuthenticationModuleAdapter(android.app.Activity activity,
AuthenticationModule module,
String name)
|
|
AuthenticationModuleAdapter(android.app.Fragment fragment,
android.content.Context applicationContext,
AuthenticationModule module,
String name)
|
|
| Method Summary | |
|---|---|
void |
enroll(Map<String,String> userData,
Callback<HeaderAndBody> callback)
Will try to register a user with a service using userData. |
AuthorizationFields |
getAuthorizationFields()
This method is called be Pipe implementations when they need
security applied to their HttpProvider. |
AuthorizationFields |
getAuthorizationFields(URI requestUri,
String method,
byte[] requestBody)
This method is called be Pipe implementations when they need
security applied to their HttpProvider. |
URL |
getBaseURL()
|
String |
getEnrollEndpoint()
|
String |
getLoginEndpoint()
|
String |
getLogoutEndpoint()
|
boolean |
isLoggedIn()
|
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. |
android.content.Loader<HeaderAndBody> |
onCreateLoader(int id,
android.os.Bundle bundle)
|
void |
onLoaderReset(android.content.Loader<HeaderAndBody> loader)
|
void |
onLoadFinished(android.content.Loader<HeaderAndBody> loader,
HeaderAndBody data)
This method will call the Callback for a enroll, login, or logout method on the main thread of the application. |
boolean |
retryLogin()
Some authorization schemes (HTTP Digest, OAUTH) have a mechanism for retrying a login to fetch fresh credentials after the credentials expire. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AuthenticationModuleAdapter(android.app.Activity activity,
AuthenticationModule module,
String name)
public AuthenticationModuleAdapter(android.app.Fragment fragment,
android.content.Context applicationContext,
AuthenticationModule module,
String name)
| Method Detail |
|---|
public URL getBaseURL()
getBaseURL in interface AuthenticationModulepublic String getLoginEndpoint()
getLoginEndpoint in interface AuthenticationModulepublic String getLogoutEndpoint()
getLogoutEndpoint in interface AuthenticationModulepublic String getEnrollEndpoint()
getEnrollEndpoint in interface AuthenticationModule
public void enroll(Map<String,String> userData,
Callback<HeaderAndBody> callback)
AuthenticationModule
enroll in interface AuthenticationModule
public void login(String username,
String password,
Callback<HeaderAndBody> callback)
AuthenticationModule
login in interface AuthenticationModulepublic void logout(Callback<Void> callback)
AuthenticationModule
logout in interface AuthenticationModulepublic boolean isLoggedIn()
isLoggedIn in interface AuthenticationModulepublic AuthorizationFields getAuthorizationFields()
AuthenticationModulePipe implementations when they need
security applied to their HttpProvider. The headers/data/query
parameters returned should be applied to the Url and HttpProvider
directly before a call.
getAuthorizationFields in interface AuthenticationModule
public AuthorizationFields getAuthorizationFields(URI requestUri,
String method,
byte[] requestBody)
AuthenticationModulePipe implementations when they need
security applied to their HttpProvider. The headers/data/query
parameters returned should be applied to the Url and HttpProvider
directly before a call.
getAuthorizationFields in interface AuthenticationModulerequestUri - the Request-Line URI.method - the HTTP method being usedrequestBody - the body of the request. This method promises to not
modify the body.
public boolean retryLogin()
AuthenticationModule
retryLogin in interface AuthenticationModule
public android.content.Loader<HeaderAndBody> onCreateLoader(int id,
android.os.Bundle bundle)
onCreateLoader in interface android.app.LoaderManager.LoaderCallbacks<HeaderAndBody>
public void onLoadFinished(android.content.Loader<HeaderAndBody> loader,
HeaderAndBody data)
AbstractFragmentCallback or AbstractActivityCallback then
it will also configure the reference to Fragment or
FragmentActivity for the callback.
onLoadFinished in interface android.app.LoaderManager.LoaderCallbacks<HeaderAndBody>public void onLoaderReset(android.content.Loader<HeaderAndBody> loader)
onLoaderReset in interface android.app.LoaderManager.LoaderCallbacks<HeaderAndBody>
|
AeroGear Android Library 1.1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||