org.openmdx.security.auth.context.pool
Class AuthenticationContextThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.openmdx.security.auth.context.pool.AuthenticationContextThread
All Implemented Interfaces:
Runnable, AuthenticationContext

public class AuthenticationContextThread
extends Thread
implements AuthenticationContext

Authenticator


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 boolean continueLogin()
          Continue execution
 int getAttempt()
          Tells how often the login sequence has been started for the associated LoginContext.
 Callback[] getCallbacks()
          Retrieve the callbacks to be handled.
 String getCorrelationId()
          Retrieve the id.
 Subject getSubject()
          Return the authenticated Subject.
static ObjectPool newPool(Configuration loginConfiguration, String applicationName, int initialCapacity, int maximumCapacity, long maximumWait, long idleTimeout, long callbackTimeout, boolean debug, Invalidator invalidator)
          Create an Authenticator pool
 boolean restartLogin()
          Re-starts the authentication sequence
 boolean resumeLogin()
          Resumes execution
 boolean resumeLogin(IOException exception)
          Resumes execution
 boolean resumeLogin(UnsupportedCallbackException exception)
          Resumes execution
 void run()
           
 void setCorrelationId(String id)
          Set the id
 boolean startLogin(Subject subject)
          Starts the authentication sequence
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openmdx.security.auth.context.spi.AuthenticationContext
getName
 

Method Detail

getCorrelationId

public String getCorrelationId()
Retrieve the id.

Specified by:
getCorrelationId in interface AuthenticationContext
Returns:
the id's value

setCorrelationId

public void setCorrelationId(String id)
Set the id

Specified by:
setCorrelationId in interface AuthenticationContext
Parameters:
id - The id's value

newPool

public static ObjectPool newPool(Configuration loginConfiguration,
                                 String applicationName,
                                 int initialCapacity,
                                 int maximumCapacity,
                                 long maximumWait,
                                 long idleTimeout,
                                 long callbackTimeout,
                                 boolean debug,
                                 Invalidator invalidator)
                          throws IOException
Create an Authenticator pool

Parameters:
loginConfiguration - the login Configuration URL
applicationName -
initialCapacity -
maximumCapacity -
maximumWait -
idleTimeout -
callbackTimeout -
debug -
logger -
invalidator -
Returns:
a new Authenticator pool
Throws:
IOException - if the login Configuration can not be acquired

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

startLogin

public boolean startLogin(Subject subject)
                   throws LoginException,
                          IOException
Description copied from interface: AuthenticationContext
Starts the authentication sequence

Specified by:
startLogin in interface AuthenticationContext
Parameters:
subject - the Subject to authenticate, or null
Returns:
true if there are no more callbacks to be handled and login has commpleted successfully.
Throws:
LoginException - if the login attempt failed
IOException

continueLogin

public boolean continueLogin()
                      throws LoginException,
                             IOException
Description copied from interface: AuthenticationContext
Continue execution

Specified by:
continueLogin in interface AuthenticationContext
Returns:
true if there are no more callbacks to be handled and login has commpleted successfully.
Throws:
LoginException - if the login process failed
IOException

restartLogin

public boolean restartLogin()
                     throws LoginException,
                            IOException
Description copied from interface: AuthenticationContext
Re-starts the authentication sequence

Specified by:
restartLogin in interface AuthenticationContext
Returns:
true if there are no more callbacks to be handled and login has commpleted successfully.
Throws:
LoginException - if the login attempt failed
IOException

resumeLogin

public boolean resumeLogin()
                    throws LoginException,
                           IOException
Description copied from interface: AuthenticationContext
Resumes execution

Specified by:
resumeLogin in interface AuthenticationContext
Returns:
true if there are no more callbacks to be handled and login has commpleted successfully.
Throws:
LoginException - if the login process failed
IOException

resumeLogin

public boolean resumeLogin(IOException exception)
                    throws LoginException,
                           IOException
Description copied from interface: AuthenticationContext
Resumes execution

Specified by:
resumeLogin in interface AuthenticationContext
Parameters:
exception - The IOException which occured during callback handling.
Returns:
true if there are no more callbacks to be handled and the login process has commpleted successfully.
Throws:
LoginException - if the login process failed
IOException

resumeLogin

public boolean resumeLogin(UnsupportedCallbackException exception)
                    throws LoginException,
                           IOException
Description copied from interface: AuthenticationContext
Resumes execution

Specified by:
resumeLogin in interface AuthenticationContext
Parameters:
exception - The UnsupportedCallbackException which occured during callback handling.
Returns:
true if there are no more callbacks to be handled and the login process has commpleted successfully.
Throws:
LoginException - if the login process failed
IOException

getSubject

public Subject getSubject()
Description copied from interface: AuthenticationContext
Return the authenticated Subject.

Specified by:
getSubject in interface AuthenticationContext
Returns:
the authenticated Subject. If the caller specified a Subject to this Authentication's login(Subject) method, this method returns the caller-specified Subject. If a Subject was not specified and authentication succeeds, this method returns the Subject instantiated and used for authentication by this Authentication. If a Subject was not specified, and authentication fails, this method returns null.

getAttempt

public int getAttempt()
Description copied from interface: AuthenticationContext
Tells how often the login sequence has been started for the associated LoginContext.

Specified by:
getAttempt in interface AuthenticationContext
Returns:
the number of starts or re-starts.

getCallbacks

public Callback[] getCallbacks()
                        throws LoginException
Description copied from interface: AuthenticationContext
Retrieve the callbacks to be handled.

Specified by:
getCallbacks in interface AuthenticationContext
Returns:
the callbacks to be handled
Throws:
LoginException - if the callback handler is not ACTIVE and a LoginException is pending


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