org.marketcetera.util.auth
Class AuthenticationSystem

java.lang.Object
  extended by org.marketcetera.util.auth.AuthenticationSystem

public class AuthenticationSystem
extends Object

An authentication system. It is responsible for using a series of authentication contexts to set the data of a group of data holders. Roughly speaking, for each holder and context pair, a setter is responsible for determining whether the context can (or should) supply the holder's data. This conceptual design does not directly translate to the class API; instead, expected usage takes the following form:

  1. The contexts and holders are created.
  2. For each context:
    1. A setter is created for each holder, and added to the context.
    2. The context is added to the authentication system.
  3. When setValues() is called, the system dynamically determines its set of holders by retrieving the union of all holders from all setters from all its contexts.
Note that this API makes it possible for a context to have setters for only a subset of the system holders. This is acceptable.

Since:
0.5.0
Version:
$Id: AuthenticationSystem.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Constructor Summary
AuthenticationSystem()
          Creates a new authentication system.
 
Method Summary
 void add(Context<?> context)
          Adds the given context to the receiver's contexts.
 void printUsage(PrintStream stream)
          Prints the receiver's usage instructions onto the given stream.
 boolean setValues()
          Sets the data of the receiver's holders.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationSystem

public AuthenticationSystem()
Creates a new authentication system.

Method Detail

add

public void add(Context<?> context)
Adds the given context to the receiver's contexts.

Parameters:
context - The context.

printUsage

public void printUsage(PrintStream stream)
Prints the receiver's usage instructions onto the given stream. This is a compilation of the usage instructions of the receiver's contexts.

Parameters:
stream - The stream.

setValues

public boolean setValues()
Sets the data of the receiver's holders. Once done, it checks whether all holders with required data have had their data set.

Returns:
True if so.


Copyright © 2012. All Rights Reserved.