org.eclipse.jetty.plus.security
Class DataSourceLoginService

java.lang.Object
  extended by org.eclipse.jetty.util.component.AbstractLifeCycle
      extended by org.eclipse.jetty.security.MappedLoginService
          extended by org.eclipse.jetty.plus.security.DataSourceLoginService
All Implemented Interfaces:
LoginService, LifeCycle

public class DataSourceLoginService
extends MappedLoginService

//TODO JASPI cf JDBCLoginService DataSourceUserRealm Obtain user/password/role information from a database via jndi DataSource.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jetty.security.MappedLoginService
MappedLoginService.Anonymous, MappedLoginService.KnownUser, MappedLoginService.RolePrincipal, MappedLoginService.UserPrincipal
 
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
 
Field Summary
 
Fields inherited from class org.eclipse.jetty.security.MappedLoginService
_identityService, _name, _users
 
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
Constructor Summary
DataSourceLoginService()
           
DataSourceLoginService(String name)
           
DataSourceLoginService(String name, IdentityService identityService)
           
 
Method Summary
 int getCacheMs()
           
 boolean getCreateTables()
           
 String getJndiName()
           
 String getRoleTableKey()
           
 String getRoleTableName()
           
 String getRoleTableRoleField()
           
 Server getServer()
           
 String getUserRoleTableName()
           
 String getUserRoleTableRoleKey()
           
 String getUserRoleTableUserKey()
           
 String getUserTableKey()
           
 String getUserTableName()
           
 String getUserTablePasswordField()
           
 String getUserTableUserField()
           
 void initDb()
          Lookup the datasource for the jndiName and formulate the necessary sql query strings based on the configured table and column names.
protected  UserIdentity loadUser(String userName)
          Load user's info from database.
protected  void loadUsers()
           
 void setCacheMs(int ms)
           
 void setCreateTables(boolean createTables)
           
 void setJndiName(String jndi)
           
 void setRoleTableKey(String tableKey)
           
 void setRoleTableName(String tableName)
           
 void setRoleTableRoleField(String tableRoleField)
           
 void setServer(Server server)
           
 void setUserRoleTableName(String roleTableName)
           
 void setUserRoleTableRoleKey(String roleTableRoleKey)
           
 void setUserRoleTableUserKey(String roleTableUserKey)
           
 void setUserTableKey(String tableKey)
           
 void setUserTableName(String name)
           
 void setUserTablePasswordField(String tablePasswordField)
           
 void setUserTableUserField(String tableUserField)
           
 
Methods inherited from class org.eclipse.jetty.security.MappedLoginService
doStart, doStop, getIdentityService, getName, getUsers, login, putUser, putUser, removeUser, setIdentityService, setName, setUsers, toString, validate
 
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataSourceLoginService

public DataSourceLoginService()

DataSourceLoginService

public DataSourceLoginService(String name)

DataSourceLoginService

public DataSourceLoginService(String name,
                              IdentityService identityService)
Method Detail

setJndiName

public void setJndiName(String jndi)

getJndiName

public String getJndiName()

setServer

public void setServer(Server server)

getServer

public Server getServer()

setCreateTables

public void setCreateTables(boolean createTables)

getCreateTables

public boolean getCreateTables()

setUserTableName

public void setUserTableName(String name)

getUserTableName

public String getUserTableName()

getUserTableKey

public String getUserTableKey()

setUserTableKey

public void setUserTableKey(String tableKey)

getUserTableUserField

public String getUserTableUserField()

setUserTableUserField

public void setUserTableUserField(String tableUserField)

getUserTablePasswordField

public String getUserTablePasswordField()

setUserTablePasswordField

public void setUserTablePasswordField(String tablePasswordField)

getRoleTableName

public String getRoleTableName()

setRoleTableName

public void setRoleTableName(String tableName)

getRoleTableKey

public String getRoleTableKey()

setRoleTableKey

public void setRoleTableKey(String tableKey)

getRoleTableRoleField

public String getRoleTableRoleField()

setRoleTableRoleField

public void setRoleTableRoleField(String tableRoleField)

getUserRoleTableName

public String getUserRoleTableName()

setUserRoleTableName

public void setUserRoleTableName(String roleTableName)

getUserRoleTableUserKey

public String getUserRoleTableUserKey()

setUserRoleTableUserKey

public void setUserRoleTableUserKey(String roleTableUserKey)

getUserRoleTableRoleKey

public String getUserRoleTableRoleKey()

setUserRoleTableRoleKey

public void setUserRoleTableRoleKey(String roleTableRoleKey)

setCacheMs

public void setCacheMs(int ms)

getCacheMs

public int getCacheMs()

loadUsers

protected void loadUsers()
Specified by:
loadUsers in class MappedLoginService

loadUser

protected UserIdentity loadUser(String userName)
Load user's info from database.

Specified by:
loadUser in class MappedLoginService
Parameters:
user -

initDb

public void initDb()
            throws NamingException,
                   SQLException
Lookup the datasource for the jndiName and formulate the necessary sql query strings based on the configured table and column names.

Throws:
NamingException
SQLException


Copyright © 1995-2009 Mort Bay Consulting. All Rights Reserved.