- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.security.AbstractLoginService
-
- org.eclipse.jetty.plus.security.DataSourceLoginService
-
- All Implemented Interfaces:
org.eclipse.jetty.security.LoginService,org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.LifeCycle
public class DataSourceLoginService extends org.eclipse.jetty.security.AbstractLoginServiceDataSourceLoginServiceObtain user/password/role information from a database via jndi DataSource.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDataSourceLoginService.DBUserPrincipalDBUser-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
-
-
Constructor Summary
Constructors Constructor Description DataSourceLoginService()DataSourceLoginService(java.lang.String name)DataSourceLoginService(java.lang.String name, org.eclipse.jetty.security.IdentityService identityService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetCreateTables()java.lang.StringgetJndiName()java.lang.StringgetRoleTableKey()java.lang.StringgetRoleTableName()java.lang.StringgetRoleTableRoleField()org.eclipse.jetty.server.ServergetServer()java.lang.StringgetUserRoleTableName()java.lang.StringgetUserRoleTableRoleKey()java.lang.StringgetUserRoleTableUserKey()java.lang.StringgetUserTableKey()java.lang.StringgetUserTableName()java.lang.StringgetUserTablePasswordField()java.lang.StringgetUserTableUserField()voidinitDb()Lookup the datasource for the jndiName and formulate the necessary sql query strings based on the configured table and column names.java.util.List<org.eclipse.jetty.security.RolePrincipal>loadRoleInfo(org.eclipse.jetty.security.UserPrincipal user)org.eclipse.jetty.security.UserPrincipalloadUserInfo(java.lang.String username)voidsetCreateTables(boolean createTables)voidsetJndiName(java.lang.String jndi)voidsetRoleTableKey(java.lang.String tableKey)voidsetRoleTableName(java.lang.String tableName)voidsetRoleTableRoleField(java.lang.String tableRoleField)voidsetServer(org.eclipse.jetty.server.Server server)voidsetUserRoleTableName(java.lang.String roleTableName)voidsetUserRoleTableRoleKey(java.lang.String roleTableRoleKey)voidsetUserRoleTableUserKey(java.lang.String roleTableUserKey)voidsetUserTableKey(java.lang.String tableKey)voidsetUserTableName(java.lang.String name)voidsetUserTablePasswordField(java.lang.String tablePasswordField)voidsetUserTableUserField(java.lang.String tableUserField)-
Methods inherited from class org.eclipse.jetty.security.AbstractLoginService
getIdentityService, getName, isFullValidate, login, logout, setFullValidate, setIdentityService, setName, toString, validate
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
setJndiName
public void setJndiName(java.lang.String jndi)
-
getJndiName
public java.lang.String getJndiName()
-
setServer
public void setServer(org.eclipse.jetty.server.Server server)
-
getServer
public org.eclipse.jetty.server.Server getServer()
-
setCreateTables
public void setCreateTables(boolean createTables)
-
getCreateTables
public boolean getCreateTables()
-
setUserTableName
public void setUserTableName(java.lang.String name)
-
getUserTableName
public java.lang.String getUserTableName()
-
getUserTableKey
public java.lang.String getUserTableKey()
-
setUserTableKey
public void setUserTableKey(java.lang.String tableKey)
-
getUserTableUserField
public java.lang.String getUserTableUserField()
-
setUserTableUserField
public void setUserTableUserField(java.lang.String tableUserField)
-
getUserTablePasswordField
public java.lang.String getUserTablePasswordField()
-
setUserTablePasswordField
public void setUserTablePasswordField(java.lang.String tablePasswordField)
-
getRoleTableName
public java.lang.String getRoleTableName()
-
setRoleTableName
public void setRoleTableName(java.lang.String tableName)
-
getRoleTableKey
public java.lang.String getRoleTableKey()
-
setRoleTableKey
public void setRoleTableKey(java.lang.String tableKey)
-
getRoleTableRoleField
public java.lang.String getRoleTableRoleField()
-
setRoleTableRoleField
public void setRoleTableRoleField(java.lang.String tableRoleField)
-
getUserRoleTableName
public java.lang.String getUserRoleTableName()
-
setUserRoleTableName
public void setUserRoleTableName(java.lang.String roleTableName)
-
getUserRoleTableUserKey
public java.lang.String getUserRoleTableUserKey()
-
setUserRoleTableUserKey
public void setUserRoleTableUserKey(java.lang.String roleTableUserKey)
-
getUserRoleTableRoleKey
public java.lang.String getUserRoleTableRoleKey()
-
setUserRoleTableRoleKey
public void setUserRoleTableRoleKey(java.lang.String roleTableRoleKey)
-
loadUserInfo
public org.eclipse.jetty.security.UserPrincipal loadUserInfo(java.lang.String username)
- Specified by:
loadUserInfoin classorg.eclipse.jetty.security.AbstractLoginService
-
loadRoleInfo
public java.util.List<org.eclipse.jetty.security.RolePrincipal> loadRoleInfo(org.eclipse.jetty.security.UserPrincipal user)
- Specified by:
loadRoleInfoin classorg.eclipse.jetty.security.AbstractLoginService
-
initDb
public void initDb() throws javax.naming.NamingException, java.sql.SQLExceptionLookup the datasource for the jndiName and formulate the necessary sql query strings based on the configured table and column names.- Throws:
javax.naming.NamingException- if unable to init jndijava.sql.SQLException- if unable to init database
-
-