org.openwms.core.service.spring
Class UserWrapper

java.lang.Object
  extended by org.openwms.core.service.spring.UserWrapper
All Implemented Interfaces:
Serializable, UserHolder, org.springframework.security.core.userdetails.UserDetails
Direct Known Subclasses:
SystemUserWrapper

public class UserWrapper
extends Object
implements org.springframework.security.core.userdetails.UserDetails, UserHolder

An UserWrapper is used as an adapter between Roles or SecurityObjects and Spring's GrantedAuthority objects.

Since:
0.1
Version:
$Revision: 1571 $
Author:
Tina Russell
See Also:
SecurityObject, Role, GrantedAuthority, UserDetails, Serialized Form

Constructor Summary
UserWrapper(User user)
          Create a new UserWrapper.
 
Method Summary
 boolean equals(Object obj)
           
 Collection<org.springframework.security.core.GrantedAuthority> getAuthorities()
          
 String getPassword()
          
 User getUser()
          Return the wrapped User instance.
 String getUsername()
          
 int hashCode()
           
 boolean isAccountNonExpired()
          
 boolean isAccountNonLocked()
          
 boolean isCredentialsNonExpired()
          
 boolean isEnabled()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserWrapper

public UserWrapper(User user)
Create a new UserWrapper.

Parameters:
user - The User to wrap
Method Detail

getUser

public User getUser()
Return the wrapped User instance.

Specified by:
getUser in interface UserHolder
Returns:
The wrapped User
See Also:
UserHolder.getUser()

getAuthorities

public Collection<org.springframework.security.core.GrantedAuthority> getAuthorities()

Specified by:
getAuthorities in interface org.springframework.security.core.userdetails.UserDetails
Returns:
the authorities, sorted by natural key (never null)
See Also:
UserDetails.getAuthorities()

getPassword

public String getPassword()

Specified by:
getPassword in interface org.springframework.security.core.userdetails.UserDetails
Returns:
the password (never null)
See Also:
UserDetails.getPassword()

getUsername

public String getUsername()

Specified by:
getUsername in interface org.springframework.security.core.userdetails.UserDetails
Returns:
the username (never null)
See Also:
UserDetails.getUsername()

isAccountNonExpired

public boolean isAccountNonExpired()

Specified by:
isAccountNonExpired in interface org.springframework.security.core.userdetails.UserDetails
Returns:
true if the user's account is valid (ie non-expired), false if no longer valid (ie expired)
See Also:
UserDetails.isAccountNonExpired()

isAccountNonLocked

public boolean isAccountNonLocked()

Specified by:
isAccountNonLocked in interface org.springframework.security.core.userdetails.UserDetails
Returns:
true if the user is not locked, false otherwise
See Also:
UserDetails.isAccountNonLocked()

isCredentialsNonExpired

public boolean isCredentialsNonExpired()

Specified by:
isCredentialsNonExpired in interface org.springframework.security.core.userdetails.UserDetails
Returns:
true if the user's credentials are valid (ie non-expired), false if no longer valid (ie expired)
See Also:
UserDetails.isCredentialsNonExpired()

isEnabled

public boolean isEnabled()

Specified by:
isEnabled in interface org.springframework.security.core.userdetails.UserDetails
Returns:
true if the user is enabled, false otherwise
See Also:
UserDetails.isEnabled()

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)


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