Class DataSourceLoginService
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:
LoginService, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
DataSourceUserRealm
Obtain user/password/role information from a database via jndi DataSource.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class AbstractLoginService
AbstractLoginService.RolePrincipal, AbstractLoginService.UserPrincipalNested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate DataSourceprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Serverprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate static final LoggerFields inherited from class AbstractLoginService
_fullValidate, _identityService, _name -
Constructor Summary
ConstructorsConstructorDescriptionDataSourceLoginService(String name) DataSourceLoginService(String name, IdentityService identityService) -
Method Summary
Modifier and TypeMethodDescriptionprivate ConnectionbooleanvoidinitDb()Lookup the datasource for the jndiName and formulate the necessary sql query strings based on the configured table and column names.String[]loadUserInfo(String username) private voidvoidsetCreateTables(boolean createTables) voidsetJndiName(String jndi) voidsetRoleTableKey(String tableKey) voidsetRoleTableName(String tableName) voidsetRoleTableRoleField(String tableRoleField) voidvoidsetUserRoleTableName(String roleTableName) voidsetUserRoleTableRoleKey(String roleTableRoleKey) voidsetUserRoleTableUserKey(String roleTableUserKey) voidsetUserTableKey(String tableKey) voidsetUserTableName(String name) voidsetUserTablePasswordField(String tablePasswordField) voidsetUserTableUserField(String tableUserField) Methods inherited from class AbstractLoginService
getIdentityService, getName, isFullValidate, login, logout, setFullValidate, setIdentityService, setName, toString, validateMethods inherited from class ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansMethods inherited from class AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Dumpable.DumpableContainer
isDumpable
-
Field Details
-
LOG
-
_jndiName
-
_datasource
-
_server
-
_userTableName
-
_userTableKey
-
_userTableUserField
-
_userTablePasswordField
-
_roleTableName
-
_roleTableKey
-
_roleTableRoleField
-
_userRoleTableName
-
_userRoleTableUserKey
-
_userRoleTableRoleKey
-
_userSql
-
_roleSql
-
_createTables
private boolean _createTables
-
-
Constructor Details
-
DataSourceLoginService
public DataSourceLoginService() -
DataSourceLoginService
-
DataSourceLoginService
-
-
Method Details
-
setJndiName
-
getJndiName
-
setServer
-
getServer
-
setCreateTables
public void setCreateTables(boolean createTables) -
getCreateTables
public boolean getCreateTables() -
setUserTableName
-
getUserTableName
-
getUserTableKey
-
setUserTableKey
-
getUserTableUserField
-
setUserTableUserField
-
getUserTablePasswordField
-
setUserTablePasswordField
-
getRoleTableName
-
setRoleTableName
-
getRoleTableKey
-
setRoleTableKey
-
getRoleTableRoleField
-
setRoleTableRoleField
-
getUserRoleTableName
-
setUserRoleTableName
-
getUserRoleTableUserKey
-
setUserRoleTableUserKey
-
getUserRoleTableRoleKey
-
setUserRoleTableRoleKey
-
loadUserInfo
- Specified by:
loadUserInfoin classAbstractLoginService
-
loadRoleInfo
- Specified by:
loadRoleInfoin classAbstractLoginService
-
initDb
Lookup the datasource for the jndiName and formulate the necessary sql query strings based on the configured table and column names.- Throws:
NamingException- if unable to init jndiSQLException- if unable to init database
-
prepareTables
- Throws:
NamingExceptionSQLException
-
getConnection
- Throws:
NamingExceptionSQLException
-