AeroGear Android Library 1.1.0

org.jboss.aerogear.android.authentication.impl
Class Authenticator

java.lang.Object
  extended by org.jboss.aerogear.android.authentication.impl.Authenticator

public class Authenticator
extends Object

This is the default implementation of Authenticator. It uses a HashMap behind the scenes to store its modules.

As a note, you should NOT extend this class for production or application purposes. This class is made non-final ONLY for testing/mocking/academic purposes.


Constructor Summary
Authenticator(String baseURL)
           
Authenticator(URL baseURL)
           
 
Method Summary
 void add(String name, AuthenticationModule module)
           
 AuthenticationModule auth(String name, AuthenticationConfig config)
          Builds a AuthenticationModule based on the AuthenticationConfig and records it as name
 AuthenticationModule get(String name)
          Gets a AuthenticationModule for name This method should NOT be called by Activities or Fragments.
 AuthenticationModule get(String name, android.app.Activity activity)
          Gets a AuthenticationModule for name.
 AuthenticationModule get(String name, android.support.v4.app.FragmentActivity activity)
          Gets a AuthenticationModule for name.
 AuthenticationModule get(String name, android.app.Fragment fragment, android.content.Context applicationContext)
          Gets a AuthenticationModule for name.
 AuthenticationModule get(String name, android.support.v4.app.Fragment fragment, android.content.Context applicationContext)
          Gets a AuthenticationModule for name.
 AuthenticationModule remove(String name)
          Removes a AuthenticationModule for name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Authenticator

public Authenticator(URL baseURL)

Authenticator

public Authenticator(String baseURL)
Method Detail

remove

public AuthenticationModule remove(String name)
Removes a AuthenticationModule for name

Parameters:
name -
Returns:
a AuthenticationModule for name or null if there isn't a value for name
Throws:
NullPointerException - is name is null

auth

public AuthenticationModule auth(String name,
                                 AuthenticationConfig config)
Builds a AuthenticationModule based on the AuthenticationConfig and records it as name

Parameters:
name -
config -
Returns:
a fully operational AuthenticationModule
Throws:
NullPointerException - is config or name is null

add

public void add(String name,
                AuthenticationModule module)

get

public AuthenticationModule get(String name)
Gets a AuthenticationModule for name This method should NOT be called by Activities or Fragments. This method is safe for Services, tests, etc.

Parameters:
name -
Returns:
a AuthenticationModule for name or null if there isn't a value for name
Throws:
NullPointerException - is name is null

get

public AuthenticationModule get(String name,
                                android.app.Activity activity)
Gets a AuthenticationModule for name. This will wrap the module in a Loader.

Parameters:
name -
activity - the activity which the Loaders should be bound against.
Returns:
a AuthenticationModuleAdapter for name
Throws:
NullPointerException - is name is null

get

public AuthenticationModule get(String name,
                                android.app.Fragment fragment,
                                android.content.Context applicationContext)
Gets a AuthenticationModule for name. This will wrap the module in a Loader.

Parameters:
name -
fragment - the fragment the Loaders will be bound against.
applicationContext -
Returns:
a AuthenticationModuleAdapterfor name
Throws:
NullPointerException - is name is null

get

public AuthenticationModule get(String name,
                                android.support.v4.app.FragmentActivity activity)
Gets a AuthenticationModule for name. This will wrap the module in a Loader.

Parameters:
name -
activity - the activity which the Loaders should be bound against.
Returns:
a SupportAuthenticationModuleAdapter for name
Throws:
NullPointerException - is name is null

get

public AuthenticationModule get(String name,
                                android.support.v4.app.Fragment fragment,
                                android.content.Context applicationContext)
Gets a AuthenticationModule for name. This will wrap the module in a Loader.

Parameters:
name -
fragment - the fragment the Loaders will be bound against.
applicationContext -
Returns:
a SupportAuthenticationModuleAdapter for name
Throws:
NullPointerException - is name is null

AeroGear Android Library 1.1.0

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