## org.hornetq.spi.core.security
Class JAASSecurityManager

    java.lang.Object
      org.hornetq.spi.core.security.JAASSecurityManager

All Implemented Interfaces:
  org.hornetq.core.server.HornetQComponent, HornetQSecurityManager

    public class JAASSecurityManager

extends Object
implements HornetQSecurityManager, org.hornetq.core.server.HornetQComponent

This implementation delegates to the JAAS security interfaces. The `Subject` returned by the login context is expecting to have a `Group` with the `Roles` name containing a set of `JAASSecurityManager.SimplePrincipal` for each role of the user.

Author:
  Andy Taylor, Tim Fox, Jeff Mesnil

Nested Class Summary
`static class` `JAASSecurityManager.SimplePrincipal`

Constructor Summary
`JAASSecurityManager()`

Method Summary
`void` `addRole(String user, String role)` adds a new role for a user.
`void` `addUser(String user, String password)` adds a new user
`boolean` `isStarted()`
`void` `removeRole(String user, String role)` removes a role from a user
`void` `removeUser(String user)` removes a user and any roles they may have.
`void` `setCallbackHandler(CallbackHandler handler)`
`void` `setConfiguration(Configuration config)`
`void` `setConfigurationName(String configurationName)`
`void` `setDefaultUser(String username)`
`void` `start()` lifecycle method, needs to be called
`void` `stop()`
`boolean` `validateUser(String user, String password)` is this a valid user.
`boolean` `validateUserAndRole(String user, String password, Set<org.hornetq.core.security.Role> roles, org.hornetq.core.security.CheckType checkType)` is this a valid user and do they have the correct role

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

Constructor Detail

### JAASSecurityManager

    public JAASSecurityManager()

Method Detail

### validateUser

    public boolean validateUser(String user,
                                String password)

  Description copied from interface: `HornetQSecurityManager`
  is this a valid user.

  Specified by:
    `validateUser` in interface `HornetQSecurityManager`
  Parameters:
    `user` - the user
    `password` - the users password
  Returns:
    true if a valid user

### validateUserAndRole

    public boolean validateUserAndRole(String user,
                                       String password,
                                       Set<org.hornetq.core.security.Role> roles,
                                       org.hornetq.core.security.CheckType checkType)

  Description copied from interface: `HornetQSecurityManager`
  is this a valid user and do they have the correct role

  Specified by:
    `validateUserAndRole` in interface `HornetQSecurityManager`
  Parameters:
    `user` - the user
    `password` - the users password
    `roles` - the roles the user has
    `checkType` - the type of check to perform
  Returns:
    true if the user is valid and they have the correct roles

### addRole

    public void addRole(String user,
                        String role)

  Description copied from interface: `HornetQSecurityManager`
  adds a new role for a user.

  Specified by:
    `addRole` in interface `HornetQSecurityManager`
  Parameters:
    `user` - the user
    `role` - the role to add

### addUser

    public void addUser(String user,
                        String password)

  Description copied from interface: `HornetQSecurityManager`
  adds a new user

  Specified by:
    `addUser` in interface `HornetQSecurityManager`
  Parameters:
    `user` - the user to add
    `password` - theusers password

### removeRole

    public void removeRole(String user,
                           String role)

  Description copied from interface: `HornetQSecurityManager`
  removes a role from a user

  Specified by:
    `removeRole` in interface `HornetQSecurityManager`
  Parameters:
    `user` - the user
    `role` - the role to remove

### removeUser

    public void removeUser(String user)

  Description copied from interface: `HornetQSecurityManager`
  removes a user and any roles they may have.

  Specified by:
    `removeUser` in interface `HornetQSecurityManager`
  Parameters:
    `user` - the user to remove

### setDefaultUser

    public void setDefaultUser(String username)

  Specified by:
    `setDefaultUser` in interface `HornetQSecurityManager`

### start

    public void start()
               throws Exception

  lifecycle method, needs to be called

  Specified by:
    `start` in interface `org.hornetq.core.server.HornetQComponent`
  Throws:
    `Exception`

### stop

    public void stop()

  Specified by:
    `stop` in interface `org.hornetq.core.server.HornetQComponent`

### isStarted

    public boolean isStarted()

  Specified by:
    `isStarted` in interface `org.hornetq.core.server.HornetQComponent`

### setConfigurationName

    public void setConfigurationName(String configurationName)

### setCallbackHandler

    public void setCallbackHandler(CallbackHandler handler)

### setConfiguration

    public void setConfiguration(Configuration config)

Copyright © 2009 Red Hat Inc. All Rights Reserved.