Package org.eclipse.jetty.plus.security
Class DataSourceLoginService
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.security.AbstractLoginService
-
- org.eclipse.jetty.plus.security.DataSourceLoginService
-
- All Implemented Interfaces:
org.eclipse.jetty.security.LoginService,org.eclipse.jetty.util.component.LifeCycle
public class DataSourceLoginService extends org.eclipse.jetty.security.AbstractLoginServiceDataSourceUserRealmObtain 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.security.AbstractLoginService
org.eclipse.jetty.security.AbstractLoginService.RolePrincipal, org.eclipse.jetty.security.AbstractLoginService.UserPrincipal
-
-
Constructor Summary
Constructors Constructor Description DataSourceLoginService()DataSourceLoginService(String name)DataSourceLoginService(String name, org.eclipse.jetty.security.IdentityService identityService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetCreateTables()StringgetJndiName()StringgetRoleTableKey()StringgetRoleTableName()StringgetRoleTableRoleField()org.eclipse.jetty.server.ServergetServer()StringgetUserRoleTableName()StringgetUserRoleTableRoleKey()StringgetUserRoleTableUserKey()StringgetUserTableKey()StringgetUserTableName()StringgetUserTablePasswordField()StringgetUserTableUserField()voidinitDb()Lookup the datasource for the jndiName and formulate the necessary sql query strings based on the configured table and column names.String[]loadRoleInfo(org.eclipse.jetty.security.AbstractLoginService.UserPrincipal user)org.eclipse.jetty.security.AbstractLoginService.UserPrincipalloadUserInfo(String username)voidsetCreateTables(boolean createTables)voidsetJndiName(String jndi)voidsetRoleTableKey(String tableKey)voidsetRoleTableName(String tableName)voidsetRoleTableRoleField(String tableRoleField)voidsetServer(org.eclipse.jetty.server.Server server)voidsetUserRoleTableName(String roleTableName)voidsetUserRoleTableRoleKey(String roleTableRoleKey)voidsetUserRoleTableUserKey(String roleTableUserKey)voidsetUserTableKey(String tableKey)voidsetUserTableName(String name)voidsetUserTablePasswordField(String tablePasswordField)voidsetUserTableUserField(String tableUserField)-
Methods inherited from class org.eclipse.jetty.security.AbstractLoginService
getIdentityService, getName, isFullValidate, login, logout, setFullValidate, setIdentityService, setName, toString, validate
-
-
-
-
Method Detail
-
setJndiName
public void setJndiName(String jndi)
-
getJndiName
public 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(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)
-
loadUserInfo
public org.eclipse.jetty.security.AbstractLoginService.UserPrincipal loadUserInfo(String username)
- Specified by:
loadUserInfoin classorg.eclipse.jetty.security.AbstractLoginService
-
loadRoleInfo
public String[] loadRoleInfo(org.eclipse.jetty.security.AbstractLoginService.UserPrincipal user)
- Specified by:
loadRoleInfoin classorg.eclipse.jetty.security.AbstractLoginService
-
initDb
public void initDb() throws NamingException, SQLExceptionLookup 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
-
-