org.openwms.core.service.spring.security
Class SecurityContextUserServiceImpl

java.lang.Object
  extended by org.openwms.core.service.spring.security.SecurityContextUserServiceImpl
All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationListener<UserChangedEvent>, org.springframework.security.core.userdetails.UserDetailsService

@Transactional
@Service(value="userDetailsService")
public class SecurityContextUserServiceImpl
extends Object
implements org.springframework.security.core.userdetails.UserDetailsService, org.springframework.context.ApplicationListener<UserChangedEvent>

A SecurityContextUserServiceImpl extends Spring UserDetailsService to read Users and Roles from the persistent storage and wraps them into security objects.

The advice can be referenced by name "userDetailsService".

Since:
0.1
Version:
$Revision: 1571 $
Author:
Tina Russell
See Also:
UserDetailsService

Field Summary
static String COMPONENT_NAME
          Springs service name.
 
Constructor Summary
SecurityContextUserServiceImpl()
           
 
Method Summary
 org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username)
           
 void onApplicationEvent(UserChangedEvent event)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_NAME

public static final String COMPONENT_NAME
Springs service name.

See Also:
Constant Field Values
Constructor Detail

SecurityContextUserServiceImpl

public SecurityContextUserServiceImpl()
Method Detail

onApplicationEvent

public void onApplicationEvent(UserChangedEvent event)

Specified by:
onApplicationEvent in interface org.springframework.context.ApplicationListener<UserChangedEvent>
See Also:
ApplicationListener.onApplicationEvent(org.springframework.context.ApplicationEvent)

loadUserByUsername

@Transactional(readOnly=true)
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username)
Specified by:
loadUserByUsername in interface org.springframework.security.core.userdetails.UserDetailsService
Parameters:
username - User's username to search for
Returns:
A wrapper object
Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException - in case the User was not found or the password was not valid
See Also:
UserDetailsService.loadUserByUsername(java.lang.String)


Copyright © 2005-2011 openwms.org. All Rights Reserved.