org.squashtest.tm.service.user
Interface AdministrationService

All Known Implementing Classes:
AdministrationServiceImpl

public interface AdministrationService

//TODO : should be split between USerAdminService and WhateverAdminService Will handle CRUD on Squash user accounts, groups, permissions and the like. For all operations about user authentication, the said operation will be delegated to the UserAuthenticationManagerService. Security should ensure that : - access to user informations (both reading and writing) are opened to the said user ROLE_ADMIN authority only, - the rest requires ROLE_ADMIN authority only.

Author:
bsiri

Method Summary
 void activateUser(long userId)
           
 void activateUsers(Collection<Long> userIds)
           
 void addUser(org.squashtest.tm.domain.users.User aUser, long groupId, String password)
           
 void associateToTeams(long userId, List<Long> teamIds)
          Will add user to teams members lists.
 void createAuthentication(long userId, String newPassword)
          Creates authentication data for given user.
 org.squashtest.tm.domain.users.User createUserFromLogin(String login)
          Creates a stub User using the given login and returns it.
 void createUserWithoutCredentials(org.squashtest.tm.domain.users.User user, long groupId)
          Creates a user without credentials.
 void deactivateUser(long userId)
           
 void deactivateUsers(Collection<Long> userIds)
           
 void deassociateTeams(long userId, List<Long> teamIds)
          Will remove user from teams members lists.
 void deleteUsers(Collection<Long> userIds)
           
 org.squashtest.tm.domain.AdministrationStatistics findAdministrationStatistics()
          will ask database how much there is of some entities and return it in a AdministrationStatistics bean.
 List<org.squashtest.tm.domain.users.User> findAllActiveUsersOrderedByLogin()
           
 List<org.squashtest.tm.domain.users.Team> findAllNonAssociatedTeams(long userId)
          Will return a list of all Team that do not have the concerned User as a member
access restricted to admins
 List<org.squashtest.tm.domain.project.Project> findAllProjects()
           
 org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<org.squashtest.tm.domain.users.User>> findAllUsersFiltered(org.squashtest.tm.core.foundation.collection.PagingAndSorting sorter, org.squashtest.tm.core.foundation.collection.Filtering filter)
           
 List<org.squashtest.tm.domain.users.UsersGroup> findAllUsersGroupOrderedByQualifiedName()
           
 List<org.squashtest.tm.domain.users.User> findAllUsersOrderedByLogin()
           
 org.squashtest.tm.domain.users.User findByLogin(String login)
           
 String findLoginMessage()
           
 org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<org.squashtest.tm.domain.users.Team>> findSortedAssociatedTeams(long userId, org.squashtest.tm.core.foundation.collection.PagingAndSorting paging, org.squashtest.tm.core.foundation.collection.Filtering filtering)
          Will return an paged and filtered list of Teams that have the concerned user as a member.
 AuthenticatedUser findUserById(long userId)
           
 String findWelcomeMessage()
           
 void modifyLoginMessage(String loginMessage)
           
 void modifyUserEmail(long userId, String newEmail)
           
 void modifyUserFirstName(long userId, String newName)
           
 void modifyUserLastName(long userId, String newName)
           
 void modifyUserLogin(long userId, String newLogin)
           
 void modifyWelcomeMessage(String welcomeMessage)
           
 void resetUserPassword(long userId, String newPassword)
           
 void setUserGroupAuthority(long userId, long groupId)
           
 

Method Detail

findAdministrationStatistics

org.squashtest.tm.domain.AdministrationStatistics findAdministrationStatistics()
will ask database how much there is of some entities and return it in a AdministrationStatistics bean.

Returns:
AdministrationStatistics as result of counts in database.

findAllProjects

List<org.squashtest.tm.domain.project.Project> findAllProjects()

modifyWelcomeMessage

void modifyWelcomeMessage(String welcomeMessage)

findWelcomeMessage

String findWelcomeMessage()

modifyLoginMessage

void modifyLoginMessage(String loginMessage)

findLoginMessage

String findLoginMessage()

modifyUserFirstName

void modifyUserFirstName(long userId,
                         String newName)

modifyUserLastName

void modifyUserLastName(long userId,
                        String newName)

modifyUserLogin

void modifyUserLogin(long userId,
                     String newLogin)

modifyUserEmail

void modifyUserEmail(long userId,
                     String newEmail)

findUserById

AuthenticatedUser findUserById(long userId)

findByLogin

org.squashtest.tm.domain.users.User findByLogin(@NotNull
                                                String login)

findAllUsersOrderedByLogin

List<org.squashtest.tm.domain.users.User> findAllUsersOrderedByLogin()

findAllActiveUsersOrderedByLogin

List<org.squashtest.tm.domain.users.User> findAllActiveUsersOrderedByLogin()

findAllUsersFiltered

org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<org.squashtest.tm.domain.users.User>> findAllUsersFiltered(org.squashtest.tm.core.foundation.collection.PagingAndSorting sorter,
                                                                                                                                   org.squashtest.tm.core.foundation.collection.Filtering filter)

findAllUsersGroupOrderedByQualifiedName

List<org.squashtest.tm.domain.users.UsersGroup> findAllUsersGroupOrderedByQualifiedName()

addUser

void addUser(org.squashtest.tm.domain.users.User aUser,
             long groupId,
             String password)

setUserGroupAuthority

void setUserGroupAuthority(long userId,
                           long groupId)

resetUserPassword

void resetUserPassword(long userId,
                       String newPassword)

deactivateUser

void deactivateUser(long userId)

activateUser

void activateUser(long userId)

deactivateUsers

void deactivateUsers(Collection<Long> userIds)

activateUsers

void activateUsers(Collection<Long> userIds)

deleteUsers

void deleteUsers(Collection<Long> userIds)

deassociateTeams

void deassociateTeams(long userId,
                      List<Long> teamIds)
Will remove user from teams members lists.
access restricted to admins

Parameters:
userId - : the id of the concerned User
teamIds - : ids of Teams to remove user from.

associateToTeams

void associateToTeams(long userId,
                      List<Long> teamIds)
Will add user to teams members lists.
access restricted to admins

Parameters:
userId - : the id of the concerned User
teamIds - : ids of the Teams to add user to.

findSortedAssociatedTeams

org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<org.squashtest.tm.domain.users.Team>> findSortedAssociatedTeams(long userId,
                                                                                                                                        org.squashtest.tm.core.foundation.collection.PagingAndSorting paging,
                                                                                                                                        org.squashtest.tm.core.foundation.collection.Filtering filtering)
Will return an paged and filtered list of Teams that have the concerned user as a member.
access restricted to admins

Parameters:
userId - : the id of the concerned user
paging - : the PagingAndSorting criteria that the result has to match
filtering - : the Filtering criteria that the result has to match
Returns:

findAllNonAssociatedTeams

List<org.squashtest.tm.domain.users.Team> findAllNonAssociatedTeams(long userId)
Will return a list of all Team that do not have the concerned User as a member
access restricted to admins

Parameters:
userId - : the id of the concerned User
Returns:
the list of all non associated Teams

createUserFromLogin

org.squashtest.tm.domain.users.User createUserFromLogin(@NotNull
                                                        String login)
Creates a stub User using the given login and returns it. This should throw an exception when the user already exists.

Returns:
the new User
Throws:
org.squashtest.tm.exception.user.LoginAlreadyExistsException - when user already exists

createUserWithoutCredentials

void createUserWithoutCredentials(org.squashtest.tm.domain.users.User user,
                                  long groupId)
Creates a user without credentials. This should be used when authentication is managed by an external provider only.

Parameters:
user -
groupId -

createAuthentication

void createAuthentication(long userId,
                          String newPassword)
                          throws org.squashtest.tm.exception.user.LoginAlreadyExistsException
Creates authentication data for given user.

Parameters:
userId -
newPassword -
Throws:
org.squashtest.tm.exception.user.LoginAlreadyExistsException - when authentication data already exixts


Copyright © 2010-2013 Henix, henix.fr. All Rights Reserved.