org.itracker.services
Interface UserService

All Known Implementing Classes:
UserServiceImpl

public interface UserService


Method Summary
 boolean addUserPermissions(Integer userId, List<Permission> newPermissions)
          Resets all of the permissions for a user in the database.
 boolean allowPasswordUpdates(User user, Object authentication, int authType, int reqSource)
          This method checks to see if the given user's password can be updated locally.
 boolean allowPermissionUpdates(User user, Object authentication, int authType, int reqSource)
          This method checks to see if the given user's permission information can be updated locally.
 boolean allowPreferenceUpdates(User user, Object authentication, int authType, int reqSource)
          This method checks to see if the given user's preference information can be updated locally.
 boolean allowProfileCreation(User user, Object authentication, int authType, int reqSource)
          This method checks to see if a new user profile can be created within ITracker
 boolean allowProfileUpdates(User user, Object authentication, int authType, int reqSource)
          This method checks to see if the given user's core user profile information can be updated locally.
 boolean allowRegistration(User user, Object authentication, int authType, int reqSource)
          This method checks to see if the given user is allowed to self register.
 User checkLogin(String login, Object authentication, int authType, int reqSource)
          This method checks the login of a user, and returns the user if authentication was successful.
 void clearOwnedProjects(User user)
           
 User createUser(User user)
           
 List<User> findUsersForProjectByPermissionTypeList(Integer projectID, Integer[] permissionTypes)
           
 String generateUserPassword(User user)
           
 List<User> getActiveUsers()
           
 List<User> getAllUsers()
           
 int getNumberUsers()
           
 List<Permission> getPermissionsByUserId(Integer userId)
          Returns an array of Permission objects for the requested userId.
 List<User> getPossibleOwners(Issue issue, Integer projectId, Integer userId)
           
 List<User> getSuperUsers()
           
 User getUser(Integer userId)
           
 User getUserByLogin(String login)
           
 String getUserPasswordByLogin(String login)
           
 List<Permission> getUserPermissionsLocal(User user)
          This method will call local EJBs to find all permissions for a user.
 Map<Integer,Set<PermissionType>> getUsersMapOfProjectIdsAndSetOfPermissionTypes(User user, int reqSource)
          Returns a HashMap of all permissions a user has.
 List<User> getUsersWithAnyProjectPermission(Integer projectId, int[] permissions)
          This method will return a list of users with any of the supplied permission, either explicitly, or by their role as a super user.
 List<User> getUsersWithAnyProjectPermission(Integer projectId, int[] permissions, boolean activeOnly)
          This method will return a list of users with any of the supplied permission, either explicitly, or by their role as a super user.
 Collection<User> getUsersWithAnyProjectPermission(Integer projectId, Integer[] permissionTypes)
          This method will return a list of users with any of the supplied permission, either explicitly, or by their role as a super user.
 List<User> getUsersWithPermissionLocal(Integer projectId, int permissionType)
          This method will call local EJBs to find users with a specific permission.
 List<User> getUsersWithProjectPermission(Integer projectId, int permission)
          This method will return a list of users with a specific permission, either explicitly, or by their role as a super user.
 List<User> getUsersWithProjectPermission(Integer projectId, int[] permissions, boolean requireAll, boolean activeOnly)
          This method will return a list of users with the supplied permission, either explicitly, or by their role as a super user.
 List<User> getUsersWithProjectPermission(Integer projectId, int permission, boolean activeOnly)
          This method will return a list of users with a specific permission, either explicitly, or by their role as a super user.
 boolean removeUserPermissions(Integer userId, List<Permission> newPermissions)
          Resets all of the permissions for a user in the database.
 boolean setUserPermissions(Integer userId, List<Permission> newPermissions)
          Resets all of the permissions for a user in the database.
 boolean updateAuthenticator(Integer userId, List<Permission> newPermissions)
          Adds an additional set of permissions to a user in the database.
 User updateUser(User user)
           
 UserPreferences updateUserPreferences(UserPreferences user)
           
 

Method Detail

getUser

User getUser(Integer userId)

getUserByLogin

User getUserByLogin(String login)

getUserPasswordByLogin

String getUserPasswordByLogin(String login)

getAllUsers

List<User> getAllUsers()

getNumberUsers

int getNumberUsers()

getActiveUsers

List<User> getActiveUsers()

getSuperUsers

List<User> getSuperUsers()

getPossibleOwners

List<User> getPossibleOwners(Issue issue,
                             Integer projectId,
                             Integer userId)

createUser

User createUser(User user)
                throws UserException
Throws:
UserException

updateUser

User updateUser(User user)
                throws UserException
Throws:
UserException

generateUserPassword

String generateUserPassword(User user)
                            throws PasswordException
Throws:
PasswordException

updateUserPreferences

UserPreferences updateUserPreferences(UserPreferences user)
                                      throws UserException
Throws:
UserException

clearOwnedProjects

void clearOwnedProjects(User user)

findUsersForProjectByPermissionTypeList

List<User> findUsersForProjectByPermissionTypeList(Integer projectID,
                                                   Integer[] permissionTypes)

getUsersWithPermissionLocal

List<User> getUsersWithPermissionLocal(Integer projectId,
                                       int permissionType)
This method will call local EJBs to find users with a specific permission. This method is used by the deafult authenticator to manage permissions locally. If a pluggable authenticator is implemented that stores permissions in an external system, calling this method may not have up to date information.

Parameters:
projectId - id of the project on which the returned users have permissions
permissionType - the type of permission to search for
Returns:
an array of UserModels containing the users with the permission

getUserPermissionsLocal

List<Permission> getUserPermissionsLocal(User user)
This method will call local EJBs to find all permissions for a user. This method is used by the deafult authenticator to manage permissions locally. If a pluggable authenticator is implemented that stores permissions in an external system, calling this method may not have up to date information.

Parameters:
user - the user to find the permissions for
Returns:
an array of PermissionModels containing the user's permissions

updateAuthenticator

boolean updateAuthenticator(Integer userId,
                            List<Permission> newPermissions)
Adds an additional set of permissions to a user in the database. This does not remove any existing permissions. Any duplication permissions will be ignored. Before updating the permissions, this method will call the pluggable authenticator to have the permission set augmented. This augmented set of permissions will then be used for the actual update.

Parameters:
userId - the userId, not login, of the user to add the permissions to
newPermissions - an array of PermissionModels that represent the new permissions to add to the user
Returns:
true if the operation was successful

addUserPermissions

boolean addUserPermissions(Integer userId,
                           List<Permission> newPermissions)
Resets all of the permissions for a user in the database. The new permissions for the user are contained in a HashMap object. The keys of this map MUST be in the format PermProd. For example to add the VIEW_ALL permission to project 3, the key would be Perm7Prod3. The value of the key would be a Permission object. Before updating the permissions, this method will call the pluggable authenticator to have the permission set augmented. This augmented set of permissions will then be used for the actual update.

Parameters:
userId - the userId, not login, of the user to add the permissions to
newPermissions - a HashMap containing keys and Permission values as described in the method description.
Returns:
true if the operation was successful
See Also:
UserUtilities

setUserPermissions

boolean setUserPermissions(Integer userId,
                           List<Permission> newPermissions)
Resets all of the permissions for a user in the database. The new permissions for the user are contained in a HashMap object. The keys of this map MUST be in the format PermProd. For example to add the VIEW_ALL permission to project 3, the key would be Perm7Prod3. The value of the key would be a Permission object. Before updating the permissions, this method will call the pluggable authenticator to have the permission set augmented. This augmented set of permissions will then be used for the actual update.

Parameters:
userId - the userId, not login, of the user to add the permissions to
newPermissions - a HashMap containing keys and Permission values as described in the method description.
Returns:
true if the operation was successful
See Also:
UserUtilities

removeUserPermissions

boolean removeUserPermissions(Integer userId,
                              List<Permission> newPermissions)
Resets all of the permissions for a user in the database. The new permissions for the user are contained in a HashMap object. The keys of this map MUST be in the format PermProd. For example to add the VIEW_ALL permission to project 3, the key would be Perm7Prod3. The value of the key would be a Permission object. Before updating the permissions, this method will call the pluggable authenticator to have the permission set augmented. This augmented set of permissions will then be used for the actual update.

Parameters:
userId - the userId, not login, of the user to add the permissions to
newPermissions - a HashMap containing keys and Permission values as described in the method description.
Returns:
true if the operation was successful
See Also:
UserUtilities

getPermissionsByUserId

List<Permission> getPermissionsByUserId(Integer userId)
Returns an array of Permission objects for the requested userId.

Parameters:
userId - the userId, not the login, to find the permissions of

getUsersMapOfProjectIdsAndSetOfPermissionTypes

Map<Integer,Set<PermissionType>> getUsersMapOfProjectIdsAndSetOfPermissionTypes(User user,
                                                                                int reqSource)
Returns a HashMap of all permissions a user has. The HashMap uses the projectId as the key values, and then contains a HashSet as the value of the key containing Integer objects of the permissions a user has. A special key of the Integer -1 may also be in the HashMap. This key is used to represent if the user is a super user, and in which case the user has all permissions be default. The value of this key would be a Boolen object with the value true if the user was a super user. This HashMap is usually not used directly, but in conjunction with the hasPermission methods in UserUtilities to determine if a user has a particular permission.

Parameters:
model - a User representing the user that the permissions should be obtained for
reqSource - the source of the request
Returns:
a Map of permission types by project ID
See Also:
UserUtilities.hasPermission(java.util.Map>, int)

getUsersWithProjectPermission

List<User> getUsersWithProjectPermission(Integer projectId,
                                         int permission)
This method will return a list of users with a specific permission, either explicitly, or by their role as a super user. This list is obtained calling a method in the pluggable authenticator, so the actual source of the data may not be the local datastore.

Parameters:
projectId - the project to find the permission for
permission - the permission to check for
Returns:
an array of Users that represent the users that have the permission

getUsersWithProjectPermission

List<User> getUsersWithProjectPermission(Integer projectId,
                                         int permission,
                                         boolean activeOnly)
This method will return a list of users with a specific permission, either explicitly, or by their role as a super user. This list is obtained calling a method in the pluggable authenticator, so the actual source of the data may not be the local datastore.

Parameters:
projectId - the project to find the permission for
permission - the permission to check for
activeOnly - only include users who are currently active
Returns:
an array of UserModels that represent the users that have the permission

getUsersWithProjectPermission

List<User> getUsersWithProjectPermission(Integer projectId,
                                         int[] permissions,
                                         boolean requireAll,
                                         boolean activeOnly)
This method will return a list of users with the supplied permission, either explicitly, or by their role as a super user. This list is obtained calling a method in the pluggable authenticator, so the actual source of the data may not be the local datastore.

Parameters:
projectId - the project to find the permission for
permissions - the permissions that are checked against
requireAll - true if all the permissions in the array are required, false if only one is required
activeOnly - only include users who are currently active
Returns:
an array of UserModels that represent the users that have the permission

getUsersWithAnyProjectPermission

List<User> getUsersWithAnyProjectPermission(Integer projectId,
                                            int[] permissions)
This method will return a list of users with any of the supplied permission, either explicitly, or by their role as a super user. This list is obtained calling a method in the pluggable authenticator, so the actual source of the data may not be the local datastore.

Parameters:
projectId - the project to find the permission for
permissions - the permissions that are checked against
Returns:
an array of UserModels that represent the users that have the permission

getUsersWithAnyProjectPermission

Collection<User> getUsersWithAnyProjectPermission(Integer projectId,
                                                  Integer[] permissionTypes)
This method will return a list of users with any of the supplied permission, either explicitly, or by their role as a super user. This list is obtained calling a method in the pluggable authenticator, so the actual source of the data may not be the local datastore.

Parameters:
projectId - the project to find the permission for
permissions - the permissions that are checked against
Returns:
an array of UserModels that represent the users that have the permission

getUsersWithAnyProjectPermission

List<User> getUsersWithAnyProjectPermission(Integer projectId,
                                            int[] permissions,
                                            boolean activeOnly)
This method will return a list of users with any of the supplied permission, either explicitly, or by their role as a super user. This list is obtained calling a method in the pluggable authenticator, so the actual source of the data may not be the local datastore.

Parameters:
projectId - the project to find the permission for
permissions - the permissions that are checked against
activeOnly - only include users who are currently active
Returns:
an array of UserModels that represent the users that have the permission

checkLogin

User checkLogin(String login,
                Object authentication,
                int authType,
                int reqSource)
                throws AuthenticatorException
This method checks the login of a user, and returns the user if authentication was successful.

Parameters:
login - the login the user/client provided
authentication - the user's authentication information, if known
authType - the type of authentication information being provided
reqSource - the source from which the request was made (eg web, api)
Returns:
a User if the login is successful
Throws:
AuthenticatorException - an exception if the login is unsuccessful, or an error occurs

allowRegistration

boolean allowRegistration(User user,
                          Object authentication,
                          int authType,
                          int reqSource)
                          throws AuthenticatorException
This method checks to see if the given user is allowed to self register.

Parameters:
user - a User object that contains the data the user submitted
authentication - the user's authentication information, if known
authType - the type of authentication information being provided
reqSource - the source from which the request was made (eg web, api)
Returns:
true if the user is allowed to register
Throws:
AuthenticatorException - an exception if an error occurs

allowProfileCreation

boolean allowProfileCreation(User user,
                             Object authentication,
                             int authType,
                             int reqSource)
                             throws AuthenticatorException
This method checks to see if a new user profile can be created within ITracker

Parameters:
user - a User object that contains the data for the new user. If null, then the request is being made for an unknown future user. For example, the system may request this with an null user if it needs to know if the system should even present the option to create a new user
authentication - the user's authentication information, if known
authType - the type of authentication information being provided
reqSource - the source from which the request was made (eg web, api)
Returns:
a boolean indicating whether new user profile can be created through ITracker
Throws:
AuthenticatorException - an exception if an error occurs

allowProfileUpdates

boolean allowProfileUpdates(User user,
                            Object authentication,
                            int authType,
                            int reqSource)
                            throws AuthenticatorException
This method checks to see if the given user's core user profile information can be updated locally.

Parameters:
user - a User object that contains the data the user submitted
authentication - the user's authentication information, if known
authType - the type of authentication information being provided
reqSource - the source from which the request was made (eg web, api)
Returns:
a boolean whether the user's core profile information can be updated
Throws:
AuthenticatorException - an exception if an error occurs

allowPasswordUpdates

boolean allowPasswordUpdates(User user,
                             Object authentication,
                             int authType,
                             int reqSource)
                             throws AuthenticatorException
This method checks to see if the given user's password can be updated locally.

Parameters:
user - a User object that contains the data the user submitted
authentication - the user's authentication information, if known
authType - the type of authentication information being provided
reqSource - the source from which the request was made (eg web, api)
Returns:
a boolean whether the user's core profile information can be updated
Throws:
AuthenticatorException - an exception if an error occurs

allowPermissionUpdates

boolean allowPermissionUpdates(User user,
                               Object authentication,
                               int authType,
                               int reqSource)
                               throws AuthenticatorException
This method checks to see if the given user's permission information can be updated locally.

Parameters:
user - a User object that contains the data the user submitted
authentication - the user's authentication information, if known
authType - the type of authentication information being provided
reqSource - the source from which the request was made (eg web, api)
Returns:
a boolean whether the user's core profile information can be updated
Throws:
AuthenticatorException - an exception if an error occurs

allowPreferenceUpdates

boolean allowPreferenceUpdates(User user,
                               Object authentication,
                               int authType,
                               int reqSource)
                               throws AuthenticatorException
This method checks to see if the given user's preference information can be updated locally.

Parameters:
user - a User object that contains the data the user submitted
authentication - the user's authentication information, if known
authType - the type of authentication information being provided
reqSource - the source from which the request was made (eg web, api)
Returns:
a boolean whether the user's core profile information can be updated
Throws:
AuthenticatorException - an exception if an error occurs


Copyright © 2002-2012 itracker. All Rights Reserved.