java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.security.AbstractLoginService
org.eclipse.jetty.security.JDBCLoginService
- All Implemented Interfaces:
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
JDBC as a source of user authentication and authorization information.
Uses one database connection that is lazily initialized. Reconnect on failures.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA UserPrincipal with extra jdbc key info.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.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Connectionprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected StringFields inherited from class org.eclipse.jetty.security.AbstractLoginService
_fullValidate, _identityService, _nameFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
ConstructorsConstructorDescriptionJDBCLoginService(String name) JDBCLoginService(String name, String config) JDBCLoginService(String name, IdentityService identityService, String config) -
Method Summary
Modifier and TypeMethodDescriptionConnect to database with parameters setup by loadConfig()protected voiddoStart()protected voiddoStop()loadRoleInfo(UserPrincipal user) loadUserInfo(String username) voidLoad JDBC connection configuration from properties file.Methods inherited from class org.eclipse.jetty.security.AbstractLoginService
getIdentityService, getName, isFullValidate, login, logout, setFullValidate, setIdentityService, setName, toString, validateMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.security.LoginService
getUserIdentity
-
Field Details
-
_config
-
_jdbcDriver
-
_url
-
_userName
-
_password
-
_userTableKey
-
_userTablePasswordField
-
_roleTableRoleField
-
_userSql
-
_roleSql
-
_con
-
-
Constructor Details
-
JDBCLoginService
public JDBCLoginService() -
JDBCLoginService
-
JDBCLoginService
-
JDBCLoginService
-
-
Method Details
-
doStart
-
getConfig
-
setConfig
Load JDBC connection configuration from properties file.- Parameters:
config- Filename or url of user properties file.
-
connectDatabase
Connect to database with parameters setup by loadConfig()- Throws:
SQLException
-
loadUserInfo
- Specified by:
loadUserInfoin classAbstractLoginService
-
loadRoleInfo
- Specified by:
loadRoleInfoin classAbstractLoginService
-
doStop
-