Class DataSourceLoginService

All Implemented Interfaces:
LoginService, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle

public class DataSourceLoginService extends AbstractLoginService
DataSourceLoginService

Obtain user/password/role information from a database via jndi DataSource.

  • Constructor Details

    • DataSourceLoginService

      public DataSourceLoginService()
    • DataSourceLoginService

      public DataSourceLoginService(String name)
    • DataSourceLoginService

      public DataSourceLoginService(String name, IdentityService identityService)
  • Method Details

    • setJndiName

      public void setJndiName(String jndi)
    • getJndiName

      public String getJndiName()
    • setServer

      public void setServer(Server server)
    • getServer

      public 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 UserPrincipal loadUserInfo(String username)
      Specified by:
      loadUserInfo in class AbstractLoginService
    • loadRoleInfo

      public List<RolePrincipal> loadRoleInfo(UserPrincipal user)
      Specified by:
      loadRoleInfo in class AbstractLoginService
    • initDb

      public void initDb() throws NamingException, SQLException
      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 jndi
      SQLException - if unable to init database