org.openmdx.security.auth.client.spi
Class AbstractLoginClient

java.lang.Object
  extended by org.openmdx.security.auth.client.spi.AbstractLoginClient
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
TestCallbackHandler

public abstract class AbstractLoginClient
extends Object
implements Runnable

Abstract Login Client


Field Summary
protected static int CANCELLED
          Authentication failed
protected static int FAILED
          Authentication failed
protected static int SUCCESS
          Authentication succeeded
 
Constructor Summary
protected AbstractLoginClient()
          Constructor
 
Method Summary
protected
<T> T
abort(String phase, Exception cause)
          Terminate the launcher with an exception stack on the terminal window
protected abstract  CallbackHandler getCallbackHandler()
          Retrieve the callback handler
protected  Configuration getLoginConfiguration()
          Create a new login configuration
protected  LoginContext getLoginContext()
          Create a new login context
protected  int getLoginLimit()
          Define the maximal number of retries
protected  String getName()
          Provider the client name
protected static
<T> T
getSingleton(Class<T> elementClass, Set<T> set)
          Retrieve a single value out of a set
protected  void handle(LoginException exception)
          Log the exception
protected  boolean login(LoginContext loginContext)
          Log-in
protected  CallbackHandler newCallbackHandler()
          Create a callback handler, which may be amended by a sub-class.
 void run()
          Implements Runnable
protected abstract  void run(Subject subject)
          This method is executed while the user is logged in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUCCESS

protected static final int SUCCESS
Authentication succeeded

See Also:
Constant Field Values

CANCELLED

protected static final int CANCELLED
Authentication failed

See Also:
Constant Field Values

FAILED

protected static final int FAILED
Authentication failed

See Also:
Constant Field Values
Constructor Detail

AbstractLoginClient

protected AbstractLoginClient()
Constructor

Method Detail

abort

protected <T> T abort(String phase,
                      Exception cause)
Terminate the launcher with an exception stack on the terminal window

Parameters:
phase - the phase during which the error occurred
cause - the reason for the abort
Returns:
null

getCallbackHandler

protected abstract CallbackHandler getCallbackHandler()
Retrieve the callback handler

Returns:
the callback handler to be used to log-in

newCallbackHandler

protected CallbackHandler newCallbackHandler()
Create a callback handler, which may be amended by a sub-class.

Returns:
the new callback handler

getLoginConfiguration

protected Configuration getLoginConfiguration()
Create a new login configuration

Returns:
the configuration to be used to log-in

getLoginContext

protected LoginContext getLoginContext()
Create a new login context

Returns:
the context to be used to log-in

getName

protected String getName()
Provider the client name

Returns:
the client name

getLoginLimit

protected int getLoginLimit()
Define the maximal number of retries

Returns:
the maximal number of login attempts

login

protected boolean login(LoginContext loginContext)
Log-in

Parameters:
loginContext - the context to be used to log-in
Returns:
true if log-in succeeded, false if log-in has been canceled.

handle

protected void handle(LoginException exception)
Log the exception

Parameters:
exception -

run

protected abstract void run(Subject subject)
This method is executed while the user is logged in.

Parameters:
subject - the authenticated subject

run

public void run()
Implements Runnable

Specified by:
run in interface Runnable

getSingleton

protected static <T> T getSingleton(Class<T> elementClass,
                                    Set<T> set)
Retrieve a single value out of a set

Parameters:
elementClass -
set -
Returns:
the single value out of the set
Throws:
IllegalArgumentException - if the set's size is not equal to one


This software is published under the BSD license. Copyright © 2003-2008, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.