Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.jetty.security
Class MappedLoginService

    java.lang.Object
      org.eclipse.jetty.util.component.AbstractLifeCycle
          org.eclipse.jetty.security.MappedLoginService

All Implemented Interfaces:
  LoginService, LifeCycle

Direct Known Subclasses:
  DataSourceLoginService, HashLoginService, JDBCLoginService

    public abstract class MappedLoginService

extends AbstractLifeCycle
implements LoginService

A login service that keeps UserIdentities in a concurrent map either as the source or a cache of the users.

Nested Class Summary
`static class` | `MappedLoginService.Anonymous`
`static class` | `MappedLoginService.KnownUser`
`static class` | `MappedLoginService.RolePrincipal`
`static interface` | `MappedLoginService.UserPrincipal`

Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
`AbstractLifeCycle.AbstractLifeCycleListener`

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

Field Summary
`protected IdentityService` | `_identityService`
`protected java.lang.String` | `_name`
`protected java.util.concurrent.ConcurrentMap<java.lang.String,UserIdentity>` | `_users`

Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
`_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING`

Constructor Summary
`protected` | `MappedLoginService()`

Method Summary
`protected void` | `doStart()`
`protected void` | `doStop()`
`IdentityService` | `getIdentityService()` Get the identityService.
`java.lang.String` | `getName()` Get the name.
`java.util.concurrent.ConcurrentMap<java.lang.String,UserIdentity>` | `getUsers()` Get the users.
`protected abstract UserIdentity` | `loadUser(java.lang.String username)`
`protected abstract void` | `loadUsers()`
`UserIdentity` | `login(java.lang.String username, java.lang.Object credentials)` Login a user.
`void` | `logout(UserIdentity identity)`
`UserIdentity` | `putUser(java.lang.String userName, Credential credential, java.lang.String[] roles)` Put user into realm.
`protected UserIdentity` | `putUser(java.lang.String userName, java.lang.Object info)` Put user into realm.
`void` | `removeUser(java.lang.String username)`
`void` | `setIdentityService(IdentityService identityService)` Set the identityService.
`void` | `setName(java.lang.String name)` Set the name.
`void` | `setUsers(java.util.Map<java.lang.String,UserIdentity> users)` Set the users.
`java.lang.String` | `toString()`
`boolean` | `validate(UserIdentity user)` Validate a user identity.

Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
`addLifeCycleListener, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### _identityService

    protected IdentityService _identityService

### _name

    protected java.lang.String _name

### _users

    protected final java.util.concurrent.ConcurrentMap<java.lang.String,UserIdentity> _users

Constructor Detail

### MappedLoginService

    protected MappedLoginService()

Method Detail

### getName

    public java.lang.String getName()

  Get the name.

  Specified by:
    `getName` in interface `LoginService`
  Returns:
    the name

### getIdentityService

    public IdentityService getIdentityService()

  Get the identityService.

  Specified by:
    `getIdentityService` in interface `LoginService`
  Returns:
    the identityService

### getUsers

    public java.util.concurrent.ConcurrentMap<java.lang.String,UserIdentity> getUsers()

  Get the users.

  Returns:
    the users

### 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

### setUsers

    public void setUsers(java.util.Map<java.lang.String,UserIdentity> users)

  Set the users.

  Parameters:
    `users` - the users to set

### doStart

    protected void doStart()
                    throws java.lang.Exception

  Overrides:
    `doStart` in class `AbstractLifeCycle`
  Throws:
    `java.lang.Exception`
  See Also:
    `AbstractLifeCycle.doStart()`

### doStop

    protected void doStop()
                   throws java.lang.Exception

  Overrides:
    `doStop` in class `AbstractLifeCycle`
  Throws:
    `java.lang.Exception`

### logout

    public void logout(UserIdentity identity)

  Specified by:
    `logout` in interface `LoginService`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### putUser

    protected UserIdentity putUser(java.lang.String userName,
                                   java.lang.Object info)

  Put user into realm. Called by implementations to put the user data loaded from file/db etc into the user structure.

  Parameters:
    `userName` - User name
    `info` - a UserIdentity instance, or a String password or Credential instance
  Returns:
    User instance

### putUser

    public UserIdentity putUser(java.lang.String userName,
                                Credential credential,
                                java.lang.String[] roles)

  Put user into realm.

  Parameters:
    `userName` - The user to add
    `credential` - The users Credentials
    `roles` - The users roles
  Returns:
    UserIdentity

### removeUser

    public void removeUser(java.lang.String username)

### login

    public UserIdentity login(java.lang.String username,
                              java.lang.Object credentials)

  Description copied from interface: `LoginService`
  Login a user.

  Specified by:
    `login` in interface `LoginService`
  Parameters:
    `username` - The user name
    `credentials` - The users credentials
  Returns:
    A UserIdentity if the credentials matched, otherwise null
  See Also:
    `LoginService.login(java.lang.String, java.lang.Object)`

### validate

    public boolean validate(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)` 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.

### loadUser

    protected abstract UserIdentity loadUser(java.lang.String username)

### loadUsers

    protected abstract void loadUsers()
                               throws java.io.IOException

  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.