Top Description Inners Fields Constructors Methods
org.eclipse.jetty.security

public Class JDBCLoginService

extends AbstractLoginService
Class Inheritance
Imports
java.io.InputStream, java.sql.Connection, .DriverManager, .PreparedStatement, .ResultSet, .SQLException, java.util.ArrayList, .List, .Properties, java.util.stream.Collectors, org.eclipse.jetty.util.Loader, org.eclipse.jetty.util.resource.ResourceFactory, org.eclipse.jetty.util.security.Credential, org.slf4j.Logger, .LoggerFactory

JDBC as a source of user authentication and authorization information. Uses one database connection that is lazily initialized. Reconnect on failures.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
JDBCLoginService.JDBCUserPrincipal

A UserPrincipal with extra jdbc key info.

Field Summary

Modifier and TypeField and Description
protected Connection
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
private static final Logger
Inherited from org.eclipse.jetty.security.AbstractLoginService:
_fullValidate_identityService_name

Constructor Summary

AccessConstructor and Description
public
public
public
public
JDBCLoginService(String name, IdentityService identityService, String config)

Method Summary

Modifier and TypeMethod and Description
private void
closeConnection()

Close an existing connection

public Connection
connectDatabase()

Connect to database with parameters setup by loadConfig()

protected void
doStart()

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Starts the managed lifecycle beans in the order they were added.

protected void
doStop()

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStop.

Stops the managed lifecycle beans in the reverse order they were added.

public String
public List<RolePrincipal>
public UserPrincipal
public void
setConfig(String
Filename or url of user properties file.
config
)

Load JDBC connection configuration from properties file.

Inherited from org.eclipse.jetty.security.AbstractLoginService:
getIdentityServicegetNameisFullValidateloginlogoutsetFullValidatesetIdentityServicesetNametoStringvalidate

Field Detail

_conback to summary
protected Connection _con
_configback to summary
protected String _config
_jdbcDriverback to summary
protected String _jdbcDriver
_passwordback to summary
protected String _password
_roleSqlback to summary
protected String _roleSql
_roleTableRoleFieldback to summary
protected String _roleTableRoleField
_urlback to summary
protected String _url
_userNameback to summary
protected String _userName
_userSqlback to summary
protected String _userSql
_userTableKeyback to summary
protected String _userTableKey
_userTablePasswordFieldback to summary
protected String _userTablePasswordField
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.util.component.ContainerLifeCycle.LOG.

Constructor Detail

JDBCLoginServiceback to summary
public JDBCLoginService()
JDBCLoginServiceback to summary
public JDBCLoginService(String name)
JDBCLoginServiceback to summary
public JDBCLoginService(String name, String config)
JDBCLoginServiceback to summary
public JDBCLoginService(String name, IdentityService identityService, String config)

Method Detail

closeConnectionback to summary
private void closeConnection()

Close an existing connection

connectDatabaseback to summary
public Connection connectDatabase() throws SQLException

Connect to database with parameters setup by loadConfig()

doStartback to summary
protected void doStart() throws Exception

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Doc from org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Starts the managed lifecycle beans in the order they were added.

Annotations
@Override
Exceptions
Exception:

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

If there was a problem starting. Will cause a transition to FAILED state

doStopback to summary
protected void doStop() throws Exception

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStop.

Doc from org.eclipse.jetty.util.component.ContainerLifeCycle.doStop.

Stops the managed lifecycle beans in the reverse order they were added.

Annotations
@Override
Exceptions
Exception:

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

If there was a problem stopping. Will cause a transition to FAILED state

getConfigback to summary
public String getConfig()
loadRoleInfoback to summary
public List<RolePrincipal> loadRoleInfo(UserPrincipal user)

Implements abstract org.eclipse.jetty.security.AbstractLoginService.loadRoleInfo.

Annotations
@Override
loadUserInfoback to summary
public UserPrincipal loadUserInfo(String username)

Implements abstract org.eclipse.jetty.security.AbstractLoginService.loadUserInfo.

Annotations
@Override
setConfigback to summary
public void setConfig(String config)

Load JDBC connection configuration from properties file.

Parameters
config:String

Filename or url of user properties file.

org.eclipse.jetty.security back to summary

public Class JDBCLoginService.JDBCUserPrincipal

extends UserPrincipal
Class Inheritance

A UserPrincipal with extra jdbc key info.

Field Summary

Modifier and TypeField and Description
pack-priv final int
Inherited from org.eclipse.jetty.security.UserPrincipal:
_credential

Constructor Summary

AccessConstructor and Description
public
JDBCUserPrincipal(String name, Credential credential, int key)

Method Summary

Modifier and TypeMethod and Description
public int
Inherited from org.eclipse.jetty.security.UserPrincipal:
authenticateauthenticateauthenticateconfigureSubjectdeconfigureSubjectgetNametoString

Field Detail

_userKeyback to summary
pack-priv final int _userKey

Constructor Detail

JDBCUserPrincipalback to summary
public JDBCUserPrincipal(String name, Credential credential, int key)

Method Detail

getUserKeyback to summary
public int getUserKey()