com.google.code.ssm.test.svc
Class AppUserServiceImpl

java.lang.Object
  extended by com.google.code.ssm.test.svc.AppUserServiceImpl
All Implemented Interfaces:
AppUserService

@Service
public class AppUserServiceImpl
extends Object
implements AppUserService

Author:
Jakub BiaƂek

Constructor Summary
AppUserServiceImpl()
           
 
Method Summary
 void disableAppForUser(int userId, int applicationId)
          Uninstall application for user.
 void enableAppForUser(int userId, int applicationId, boolean favourite)
          Installs application for user.
 AppUser get(int userId, int applicationId)
          Returns application - user association
 List<AppUser> getInstalledList(int userId, List<Integer> applicationsIds)
          Returns application - user associations
 List<AppUser> getList(int userId)
          Get the list of AppUser entities for specified user that contains authorized and unauthorized (uninstalled) applications.
 List<AppUser> getList(int userId, boolean authorized)
          Get the list of AppUser entities for specified portal user.
 List<Integer> getUserIdsList(int applicationId, List<Integer> userIds)
          Gets the sublist of given users IDs list that contains only those users that installed given application.
 boolean isEnabled(int userId, int applicationId)
          Check if the user (by UID) is user of selected application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppUserServiceImpl

public AppUserServiceImpl()
Method Detail

disableAppForUser

public void disableAppForUser(int userId,
                              int applicationId)
Description copied from interface: AppUserService
Uninstall application for user.

Specified by:
disableAppForUser in interface AppUserService
Parameters:
userId - the portal user ID
applicationId - the application ID

enableAppForUser

public void enableAppForUser(int userId,
                             int applicationId,
                             boolean favourite)
Description copied from interface: AppUserService
Installs application for user.

Specified by:
enableAppForUser in interface AppUserService
Parameters:
userId - the portal user ID
applicationId - the application ID
favourite - is application marked as favourite

get

public AppUser get(int userId,
                   int applicationId)
Description copied from interface: AppUserService
Returns application - user association

Specified by:
get in interface AppUserService
Parameters:
userId - user ID
applicationId - application ID
Returns:
AppUser for given user and application

getInstalledList

public List<AppUser> getInstalledList(int userId,
                                      List<Integer> applicationsIds)
Description copied from interface: AppUserService
Returns application - user associations

Specified by:
getInstalledList in interface AppUserService
Parameters:
userId - user ID
applicationsIds - the IDs of applications
Returns:
list of installed (authorized) AppUser of given user with given applications' IDs

getList

public List<AppUser> getList(int userId)
Description copied from interface: AppUserService
Get the list of AppUser entities for specified user that contains authorized and unauthorized (uninstalled) applications.

Specified by:
getList in interface AppUserService
Parameters:
userId - the portal user ID
Returns:
list of all AppUser of given user

getList

public List<AppUser> getList(int userId,
                             boolean authorized)
Description copied from interface: AppUserService
Get the list of AppUser entities for specified portal user.

Specified by:
getList in interface AppUserService
Parameters:
userId - the portal user ID
authorized - if true the only authorized applications will be returned, otherwise other unauthorized (uninstalled) application will be returned
Returns:
list of authorized or unauthorized AppUser of given user

getUserIdsList

public List<Integer> getUserIdsList(int applicationId,
                                    List<Integer> userIds)
Description copied from interface: AppUserService
Gets the sublist of given users IDs list that contains only those users that installed given application.

Specified by:
getUserIdsList in interface AppUserService
userIds - portal user IDs
Returns:
find who have installed the selected application

isEnabled

public boolean isEnabled(int userId,
                         int applicationId)
Description copied from interface: AppUserService
Check if the user (by UID) is user of selected application.

Specified by:
isEnabled in interface AppUserService
Parameters:
userId - the user portal ID
applicationId - the application ID
Returns:
true if given portal user is a user of selected application (authorized = true)


Copyright © 2014. All rights reserved.