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:
org.eclipse.jetty.security.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

public class DataSourceLoginService extends org.eclipse.jetty.security.AbstractLoginService
DataSourceLoginService

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

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    DBUser

    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.StopException

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Field Summary

    Fields inherited from class org.eclipse.jetty.security.AbstractLoginService

    _fullValidate, _identityService, _name

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, STARTED, STARTING, STOPPED, STOPPING

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
    DataSourceLoginService(String name, org.eclipse.jetty.security.IdentityService identityService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
     
     
     
     
    org.eclipse.jetty.server.Server
     
     
     
     
     
     
     
     
    void
    Lookup the datasource for the jndiName and formulate the necessary sql query strings based on the configured table and column names.
    List<org.eclipse.jetty.security.RolePrincipal>
    loadRoleInfo(org.eclipse.jetty.security.UserPrincipal user)
     
    org.eclipse.jetty.security.UserPrincipal
    loadUserInfo(String username)
     
    void
    setCreateTables(boolean createTables)
     
    void
     
    void
     
    void
     
    void
    setRoleTableRoleField(String tableRoleField)
     
    void
    setServer(org.eclipse.jetty.server.Server server)
     
    void
     
    void
    setUserRoleTableRoleKey(String roleTableRoleKey)
     
    void
    setUserRoleTableUserKey(String roleTableUserKey)
     
    void
     
    void
     
    void
    setUserTablePasswordField(String tablePasswordField)
     
    void
    setUserTableUserField(String tableUserField)
     

    Methods inherited from class org.eclipse.jetty.security.AbstractLoginService

    getIdentityService, getName, isFullValidate, login, logout, setFullValidate, setIdentityService, setName, toString, validate

    Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

    addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.component.Container

    getCachedBeans, getEventListeners

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

    dumpSelf

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    isDumpable
  • Constructor Details

    • DataSourceLoginService

      public DataSourceLoginService()
    • DataSourceLoginService

      public DataSourceLoginService(String name)
    • DataSourceLoginService

      public DataSourceLoginService(String name, org.eclipse.jetty.security.IdentityService identityService)
  • Method Details

    • 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.UserPrincipal loadUserInfo(String username)
      Specified by:
      loadUserInfo in class org.eclipse.jetty.security.AbstractLoginService
    • loadRoleInfo

      public List<org.eclipse.jetty.security.RolePrincipal> loadRoleInfo(org.eclipse.jetty.security.UserPrincipal user)
      Specified by:
      loadRoleInfo in class org.eclipse.jetty.security.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