net.sf.farrago.test
Class FarragoMockLoginModule

java.lang.Object
  extended by net.sf.farrago.test.FarragoMockLoginModule
All Implemented Interfaces:
LoginModule

public class FarragoMockLoginModule
extends Object
implements LoginModule

Mock login module for testing farrago authentication.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/test/FarragoMockLoginModule.java#6 $
Author:
Oscar Gothberg

Field Summary
(package private)  CallbackHandler callbackHandler
           
(package private)  boolean debug
           
(package private)  Map<String,?> options
           
(package private)  Map<String,?> sharedState
           
(package private)  Subject subject
           
(package private)  boolean success
           
(package private)  List<FarragoMockCredential> tempCredentials
           
(package private)  List<FarragoMockPrincipal> tempPrincipals
           
 
Constructor Summary
FarragoMockLoginModule()
           
 
Method Summary
 boolean abort()
          Called if LoginContext's required authentications failed.
 boolean commit()
          Called if the LoginContext's required authentications succeeded.
 void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)
          Initialize this LoginModule
 boolean login()
          Try to log in a user.
 boolean logout()
          Log out currently logged in subject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

callbackHandler

CallbackHandler callbackHandler

subject

Subject subject

sharedState

Map<String,?> sharedState

options

Map<String,?> options

tempCredentials

List<FarragoMockCredential> tempCredentials

tempPrincipals

List<FarragoMockPrincipal> tempPrincipals

success

boolean success

debug

boolean debug
Constructor Detail

FarragoMockLoginModule

public FarragoMockLoginModule()
Method Detail

abort

public boolean abort()
              throws LoginException
Called if LoginContext's required authentications failed.

Specified by:
abort in interface LoginModule
Throws:
LoginException

commit

public boolean commit()
               throws LoginException
Called if the LoginContext's required authentications succeeded.

Specified by:
commit in interface LoginModule
Throws:
LoginException

initialize

public void initialize(Subject subject,
                       CallbackHandler callbackHandler,
                       Map<String,?> sharedState,
                       Map<String,?> options)
Initialize this LoginModule

Specified by:
initialize in interface LoginModule

login

public boolean login()
              throws LoginException
Try to log in a user.

Specified by:
login in interface LoginModule
Throws:
LoginException

logout

public boolean logout()
               throws LoginException
Log out currently logged in subject

Specified by:
logout in interface LoginModule
Throws:
LoginException