Class AbstractLoginService

  • 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
    Direct Known Subclasses:
    HashLoginService, JDBCLoginService

    public abstract class AbstractLoginService
    extends org.eclipse.jetty.util.component.ContainerLifeCycle
    implements LoginService
    AbstractLoginService Base class for LoginServices that allows subclasses to provide the user authentication and authorization information, but provides common behaviour such as handling authentication.
    • Nested Class Summary

      • 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 
      Modifier and Type Field Description
      protected boolean _fullValidate  
      protected IdentityService _identityService  
      protected java.lang.String _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 
      Modifier Constructor Description
      protected AbstractLoginService()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      IdentityService getIdentityService()
      Get the IdentityService associated with this Login Service.
      java.lang.String getName()  
      boolean isFullValidate()  
      protected abstract java.util.List<RolePrincipal> loadRoleInfo​(UserPrincipal user)  
      protected abstract UserPrincipal loadUserInfo​(java.lang.String username)  
      org.eclipse.jetty.server.UserIdentity login​(java.lang.String username, java.lang.Object credentials, javax.servlet.ServletRequest request)
      Login a user.
      void logout​(org.eclipse.jetty.server.UserIdentity user)  
      void setFullValidate​(boolean fullValidate)  
      void setIdentityService​(IdentityService identityService)
      Set the identityService.
      void setName​(java.lang.String name)
      Set the name.
      java.lang.String toString()  
      boolean validate​(org.eclipse.jetty.server.UserIdentity user)
      Validate a user identity.
      • 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
    • Field Detail

      • _name

        protected java.lang.String _name
      • _fullValidate

        protected boolean _fullValidate
    • Constructor Detail

      • AbstractLoginService

        protected AbstractLoginService()
    • Method Detail

      • loadUserInfo

        protected abstract UserPrincipal loadUserInfo​(java.lang.String username)
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface LoginService
        Returns:
        Get the name of the login service (aka Realm name)
      • setIdentityService

        public void setIdentityService​(IdentityService identityService)
        Set the identityService.
        Specified by:
        setIdentityService in interface LoginService
        Parameters:
        identityService - the identityService to set
      • setName

        public void setName​(java.lang.String name)
        Set the name.
        Parameters:
        name - the name to set
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class org.eclipse.jetty.util.component.AbstractLifeCycle
      • login

        public org.eclipse.jetty.server.UserIdentity login​(java.lang.String username,
                                                           java.lang.Object credentials,
                                                           javax.servlet.ServletRequest request)
        Description copied from interface: LoginService
        Login a user.
        Specified by:
        login in interface LoginService
        Parameters:
        username - The user name
        credentials - The users credentials
        request - TODO
        Returns:
        A UserIdentity if the credentials matched, otherwise null
      • validate

        public boolean validate​(org.eclipse.jetty.server.UserIdentity user)
        Description copied from interface: LoginService
        Validate a user identity. Validate that a UserIdentity previously created by a call to LoginService.login(String, Object, ServletRequest) is still valid.
        Specified by:
        validate in interface LoginService
        Parameters:
        user - The user to validate
        Returns:
        true if authentication has not been revoked for the user.
      • getIdentityService

        public IdentityService getIdentityService()
        Description copied from interface: LoginService
        Get the IdentityService associated with this Login Service.
        Specified by:
        getIdentityService in interface LoginService
        Returns:
        the IdentityService associated with this Login Service.
      • logout

        public void logout​(org.eclipse.jetty.server.UserIdentity user)
        Specified by:
        logout in interface LoginService
      • isFullValidate

        public boolean isFullValidate()
      • setFullValidate

        public void setFullValidate​(boolean fullValidate)