com.atlassian.crowd.service
Class UserServiceImpl

java.lang.Object
  extended by com.atlassian.crowd.service.UserServiceImpl
All Implemented Interfaces:
UserService

public class UserServiceImpl
extends Object
implements UserService


Constructor Summary
UserServiceImpl(ApplicationManager applicationManager, ApplicationService applicationService, CrowdUserDetailsService crowdUserDetailsService, TokenAuthenticationManager tokenAuthenticationManager)
           
 
Method Summary
 boolean authenticate(String username, String password)
          Given a usernamen & password, this method checks, whether or not the provided user can be authenticated
 String getAuthenticatedUsername(javax.servlet.http.HttpServletRequest request)
          Returns the username of the currently logged in user or null if no user can be found.
 String getRemoteUsername()
          Returns the username of the currently logged in user or null if no user can be found.
 boolean isSystemAdmin(String username)
          Returns true or false depending on if a user has been granted the system admin permission within Crowd.
 boolean isUserInGroup(String username, String group)
          Returns whether the user is in the specify group
 Principal resolve(String username)
          Returns the user that made this request or null if this application does not have such a user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserServiceImpl

public UserServiceImpl(ApplicationManager applicationManager,
                       ApplicationService applicationService,
                       CrowdUserDetailsService crowdUserDetailsService,
                       TokenAuthenticationManager tokenAuthenticationManager)
Method Detail

getRemoteUsername

public String getRemoteUsername()
Description copied from interface: UserService
Returns the username of the currently logged in user or null if no user can be found.

Specified by:
getRemoteUsername in interface UserService
Returns:
The user name of the logged in user or null

getAuthenticatedUsername

public String getAuthenticatedUsername(javax.servlet.http.HttpServletRequest request)
Description copied from interface: UserService
Returns the username of the currently logged in user or null if no user can be found.

Specified by:
getAuthenticatedUsername in interface UserService
Parameters:
request - The request to retrieve the username from
Returns:
The user name of the logged in user or null

isUserInGroup

public boolean isUserInGroup(String username,
                             String group)
Description copied from interface: UserService
Returns whether the user is in the specify group

Specified by:
isUserInGroup in interface UserService
Parameters:
username - The username to check
group - The group to check
Returns:
True if the user is in the specified group

isSystemAdmin

public boolean isSystemAdmin(String username)
                      throws org.springframework.dao.DataAccessException
Description copied from interface: UserService
Returns true or false depending on if a user has been granted the system admin permission within Crowd. This will usually mean that the user is a member of the crowd-administrators group OR the user is a member of a group assigned to the crowd application.

Specified by:
isSystemAdmin in interface UserService
Parameters:
username - The username of the user to check
Returns:
true or false depending on if a user has been granted the system admin permission.
Throws:
org.springframework.dao.DataAccessException - if there was an error retrieving the username

authenticate

public boolean authenticate(String username,
                            String password)
Description copied from interface: UserService
Given a usernamen & password, this method checks, whether or not the provided user can be authenticated

Specified by:
authenticate in interface UserService
Parameters:
username - Username of the user
password - Password of the user
Returns:
True if the user can be authenticated, false otherwise

resolve

public Principal resolve(String username)
                  throws org.springframework.dao.DataAccessException
Description copied from interface: UserService
Returns the user that made this request or null if this application does not have such a user.

Specified by:
resolve in interface UserService
Parameters:
username - Username of the user a consumer is making a request on behalf of
Returns:
Principal corresponding to the username, null if the user does not exist
Throws:
org.springframework.dao.DataAccessException - if there was an error retrieving the username


Copyright © 2013 Atlassian. All Rights Reserved.