org.jecars
Class CARS_LoginModule

java.lang.Object
  extended by org.jecars.CARS_LoginModule
All Implemented Interfaces:
javax.security.auth.spi.LoginModule

public class CARS_LoginModule
extends java.lang.Object
implements javax.security.auth.spi.LoginModule

CARS_LoginModule

Version:
$Id: CARS_LoginModule.java,v 1.3 2008/02/06 12:29:22 weertj Exp $

Constructor Summary
CARS_LoginModule()
           
 
Method Summary
 boolean abort()
          
 boolean commit()
          
 java.lang.String getAnonymousId()
          Returns the anonymous user id.
 java.lang.String getDefaultUserId()
          Returns the default user id.
protected static javax.jcr.Node getKeyNode(java.lang.String pKey)
          getKeyNode
protected static java.util.Collection<javax.jcr.Node> getUserKeys(java.lang.String pUsername)
          Get all current active keys of the give username
 void initialize(javax.security.auth.Subject pSubject, javax.security.auth.callback.CallbackHandler pCallbackHandler, java.util.Map pSharedState, java.util.Map pOptions)
          
 boolean login()
          
 boolean logout()
          
 void setAnonymousId(java.lang.String pAnonymousId)
          Sets the default user id to be used when no login credentials are presented.
 void setDefaultUserId(java.lang.String pDefaultUserId)
          Sets the default user id to be used when no login credentials are presented.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CARS_LoginModule

public CARS_LoginModule()
Method Detail

getAnonymousId

public java.lang.String getAnonymousId()
Returns the anonymous user id.

Returns:
anonymous user id

setAnonymousId

public void setAnonymousId(java.lang.String pAnonymousId)
Sets the default user id to be used when no login credentials are presented.

Parameters:
pAnonymousId - user id

getDefaultUserId

public java.lang.String getDefaultUserId()
Returns the default user id.

Returns:
default user id

setDefaultUserId

public void setDefaultUserId(java.lang.String pDefaultUserId)
Sets the default user id to be used when no login credentials are presented.

Parameters:
pDefaultUserId - default user id

initialize

public void initialize(javax.security.auth.Subject pSubject,
                       javax.security.auth.callback.CallbackHandler pCallbackHandler,
                       java.util.Map pSharedState,
                       java.util.Map pOptions)

Specified by:
initialize in interface javax.security.auth.spi.LoginModule

getUserKeys

protected static java.util.Collection<javax.jcr.Node> getUserKeys(java.lang.String pUsername)
                                                           throws javax.jcr.RepositoryException
Get all current active keys of the give username

Parameters:
pUsername -
Returns:
Collection of keys (nodes)
Throws:
javax.jcr.RepositoryException

getKeyNode

protected static javax.jcr.Node getKeyNode(java.lang.String pKey)
                                    throws javax.jcr.RepositoryException
getKeyNode

Parameters:
pKey -
Returns:
Throws:
javax.jcr.RepositoryException

login

public boolean login()
              throws javax.security.auth.login.LoginException

Specified by:
login in interface javax.security.auth.spi.LoginModule
Throws:
javax.security.auth.login.LoginException

commit

public boolean commit()
               throws javax.security.auth.login.LoginException

Specified by:
commit in interface javax.security.auth.spi.LoginModule
Throws:
javax.security.auth.login.LoginException

abort

public boolean abort()
              throws javax.security.auth.login.LoginException

Specified by:
abort in interface javax.security.auth.spi.LoginModule
Throws:
javax.security.auth.login.LoginException

logout

public boolean logout()
               throws javax.security.auth.login.LoginException

Specified by:
logout in interface javax.security.auth.spi.LoginModule
Throws:
javax.security.auth.login.LoginException