public class JPAUserDAO extends AbstractAnyDAO<User> implements UserDAO
Modifier and Type | Field and Description |
---|---|
protected AccessTokenDAO |
accessTokenDAO |
protected String |
anonymousUser |
protected DelegationDAO |
delegationDAO |
protected GroupDAO |
groupDAO |
protected RoleDAO |
roleDAO |
anyUtilsFactory, derSchemaDAO, dynRealmDAO, plainSchemaDAO
LOG
DEFAULT_PAGE_SIZE
Constructor and Description |
---|
JPAUserDAO() |
anyUtils, authFind, convert, delete, find, findAllKeys, findAllowedSchemas, findByDerAttrValue, findByKeys, findByPlainAttrUniqueValue, findByPlainAttrValue, findByResource, findDynRealms, findKey, findLastChange, getAllMatchingCond
clear, detach, entityManager, entityManagerFactory, refresh
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
authFind, delete, find, findAllowedSchemas, findByDerAttrValue, findByKeys, findByPlainAttrUniqueValue, findByPlainAttrValue, findByResource, findDynRealms, getAllMatchingCond
@Autowired protected RoleDAO roleDAO
@Autowired protected AccessTokenDAO accessTokenDAO
@Autowired protected GroupDAO groupDAO
@Autowired protected DelegationDAO delegationDAO
protected String anonymousUser
protected AnyUtils init()
init
in class AbstractAnyDAO<User>
@Transactional(readOnly=true) public String findKey(String username)
@Transactional(readOnly=true) public Date findLastChange(String key)
findLastChange
in interface AnyDAO<User>
@Transactional(readOnly=true) public Optional<String> findUsername(String key)
findUsername
in interface UserDAO
public int count()
public Map<String,Integer> countByRealm()
countByRealm
in interface UserDAO
public Map<String,Integer> countByStatus()
countByStatus
in interface UserDAO
@Transactional(readOnly=true) public void securityChecks(Set<String> authRealms, String key, String realm, Collection<String> groups)
UserDAO
securityChecks
in interface UserDAO
authRealms
- realms for which the calling user owns entitlement(s) to checkkey
- User keyrealm
- User's realm full pathgroups
- group the User is member ofprotected void securityChecks(User user)
securityChecks
in class AbstractAnyDAO<User>
public User findByUsername(String username)
findByUsername
in interface UserDAO
public User findByToken(String token)
findByToken
in interface UserDAO
public List<User> findBySecurityQuestion(SecurityQuestion securityQuestion)
findBySecurityQuestion
in interface UserDAO
public UMembership findMembership(String key)
findMembership
in interface UserDAO
public List<User> findAll(int page, int itemsPerPage)
AnyDAO
public List<String> findAllKeys(int page, int itemsPerPage)
AnyDAO
findAllKeys
in interface AnyDAO<User>
page
- search result pageitemsPerPage
- items per search result pagepublic Pair<Set<String>,Set<String>> saveAndGetDynGroupMembs(User user)
saveAndGetDynGroupMembs
in interface UserDAO
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<Role> findAllRoles(User user)
findAllRoles
in interface UserDAO
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public List<Role> findDynRoles(String key)
findDynRoles
in interface UserDAO
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public List<Group> findDynGroups(String key)
findDynGroups
in interface UserDAO
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<Group> findAllGroups(User user)
findAllGroups
in interface UserDAO
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<String> findAllGroupKeys(User user)
findAllGroupKeys
in interface UserDAO
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<String> findAllGroupNames(User user)
findAllGroupNames
in interface UserDAO
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<ExternalResource> findAllResources(User user)
findAllResources
in interface UserDAO
@Transactional(readOnly=true) public Collection<String> findAllResourceKeys(String key)
findAllResourceKeys
in interface AnyDAO<User>
@Transactional(readOnly=true) public boolean linkedAccountExists(String userKey, String connObjectKeyValue)
linkedAccountExists
in interface UserDAO
public Optional<? extends LinkedAccount> findLinkedAccount(ExternalResource resource, String connObjectKeyValue)
findLinkedAccount
in interface UserDAO
@Transactional(readOnly=true) public List<LinkedAccount> findLinkedAccounts(String userKey)
findLinkedAccounts
in interface UserDAO
public List<LinkedAccount> findLinkedAccountsByPrivilege(Privilege privilege)
findLinkedAccountsByPrivilege
in interface UserDAO
public List<LinkedAccount> findLinkedAccountsByResource(ExternalResource resource)
findLinkedAccountsByResource
in interface UserDAO
Copyright © 2010–2023 The Apache Software Foundation. All rights reserved.