com.google.code.ssm.test.dao
Class AppUserDAOImpl

java.lang.Object
  extended by com.google.code.ssm.test.dao.AppUserDAOImpl
All Implemented Interfaces:
AppUserDAO

@Service
public class AppUserDAOImpl
extends Object
implements AppUserDAO

Author:
Jakub BiaƂek

Constructor Summary
AppUserDAOImpl()
           
 
Method Summary
 AppUserPK create(AppUser entity)
           
 List<Integer> getAppIdList(int userId, boolean authorized)
           
 AppUser getByPk(AppUserPK pk)
           
 AppUser getByPKFromDB(AppUserPK pk)
           
 List<AppUser> getList(int userId, List<Integer> appsIds)
           
 List<AppUser> getUsersList(int applicationId, List<Integer> userIds)
           
 List<AppUser> getUsersListFromCache(int applicationId, List<Integer> usersIds, Collection<Integer> notFoundUsersIds)
          Fetch AppUser entities from remote cache (memcached).
 void remove(AppUserPK pk)
           
 AppUser update(AppUser entity)
           
 void updateListInCache(int userId, boolean authorized, List<Integer> appsIdsList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppUserDAOImpl

public AppUserDAOImpl()
Method Detail

create

public AppUserPK create(AppUser entity)
Specified by:
create in interface AppUserDAO

getByPk

public AppUser getByPk(AppUserPK pk)
Specified by:
getByPk in interface AppUserDAO

update

public AppUser update(AppUser entity)
Specified by:
update in interface AppUserDAO

remove

public void remove(AppUserPK pk)
Specified by:
remove in interface AppUserDAO

getList

public List<AppUser> getList(int userId,
                             List<Integer> appsIds)
Specified by:
getList in interface AppUserDAO
Parameters:
userId - the user ID
appsIds - sorted list of applications' IDs in ASC order
Returns:
list of entities

getAppIdList

public List<Integer> getAppIdList(int userId,
                                  boolean authorized)
Specified by:
getAppIdList in interface AppUserDAO

getUsersList

public List<AppUser> getUsersList(int applicationId,
                                  List<Integer> userIds)
Specified by:
getUsersList in interface AppUserDAO
Parameters:
applicationId - the ID of application
userIds - sorted list of users IDs
Returns:
list of entities

getUsersListFromCache

public List<AppUser> getUsersListFromCache(int applicationId,
                                           List<Integer> usersIds,
                                           Collection<Integer> notFoundUsersIds)
Description copied from interface: AppUserDAO
Fetch AppUser entities from remote cache (memcached).

Specified by:
getUsersListFromCache in interface AppUserDAO
Parameters:
applicationId - ID of application
usersIds - list of users IDs to fetch
notFoundUsersIds - collection with users IDs that weren't found in cache
Returns:
list of users of given application with given IDs from cache

updateListInCache

public void updateListInCache(int userId,
                              boolean authorized,
                              List<Integer> appsIdsList)
Specified by:
updateListInCache in interface AppUserDAO

getByPKFromDB

public AppUser getByPKFromDB(AppUserPK pk)
Specified by:
getByPKFromDB in interface AppUserDAO


Copyright © 2014. All rights reserved.