Class JPAUserDAO
- java.lang.Object
-
- org.apache.syncope.core.persistence.jpa.dao.AbstractDAO<A>
-
- org.apache.syncope.core.persistence.jpa.dao.AbstractAnyDAO<User>
-
- org.apache.syncope.core.persistence.jpa.dao.JPAUserDAO
-
- Direct Known Subclasses:
JPAJSONUserDAO
public class JPAUserDAO extends AbstractAnyDAO<User> implements UserDAO
-
-
Field Summary
Fields Modifier and Type Field Description protected AccessTokenDAO
accessTokenDAO
protected DelegationDAO
delegationDAO
protected FIQLQueryDAO
fiqlQueryDAO
protected GroupDAO
groupDAO
protected RoleDAO
roleDAO
protected SecurityProperties
securityProperties
-
Fields inherited from class org.apache.syncope.core.persistence.jpa.dao.AbstractAnyDAO
anyUtilsFactory, derSchemaDAO, dynRealmDAO, plainSchemaDAO
-
Fields inherited from class org.apache.syncope.core.persistence.jpa.dao.AbstractDAO
LOG
-
Fields inherited from interface org.apache.syncope.core.persistence.api.dao.AnyDAO
DEFAULT_PAGE_SIZE
-
-
Constructor Summary
Constructors Constructor Description JPAUserDAO(AnyUtilsFactory anyUtilsFactory, PlainSchemaDAO plainSchemaDAO, DerSchemaDAO derSchemaDAO, DynRealmDAO dynRealmDAO, RoleDAO roleDAO, AccessTokenDAO accessTokenDAO, GroupDAO groupDAO, DelegationDAO delegationDAO, FIQLQueryDAO fiqlQueryDAO, SecurityProperties securityProperties)
-
Method Summary
-
Methods inherited from class org.apache.syncope.core.persistence.jpa.dao.AbstractAnyDAO
anyUtils, authFind, delete, find, findAllKeys, findAllowedSchemas, findByDerAttrValue, findByKeys, findByPlainAttrUniqueValue, findByPlainAttrValue, findByResource, findDynRealms, findLastChange, getAllMatchingCond
-
Methods inherited from class org.apache.syncope.core.persistence.jpa.dao.AbstractDAO
detach, entityManager, entityManagerFactory, isOracle, refresh
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.syncope.core.persistence.api.dao.AnyDAO
authFind, delete, find, findAllowedSchemas, findByDerAttrValue, findByKeys, findByPlainAttrUniqueValue, findByPlainAttrValue, findByResource, findDynRealms, getAllMatchingCond
-
-
-
-
Field Detail
-
roleDAO
protected final RoleDAO roleDAO
-
accessTokenDAO
protected final AccessTokenDAO accessTokenDAO
-
groupDAO
protected final GroupDAO groupDAO
-
delegationDAO
protected final DelegationDAO delegationDAO
-
fiqlQueryDAO
protected final FIQLQueryDAO fiqlQueryDAO
-
securityProperties
protected final SecurityProperties securityProperties
-
-
Constructor Detail
-
JPAUserDAO
public JPAUserDAO(AnyUtilsFactory anyUtilsFactory, PlainSchemaDAO plainSchemaDAO, DerSchemaDAO derSchemaDAO, DynRealmDAO dynRealmDAO, RoleDAO roleDAO, AccessTokenDAO accessTokenDAO, GroupDAO groupDAO, DelegationDAO delegationDAO, FIQLQueryDAO fiqlQueryDAO, SecurityProperties securityProperties)
-
-
Method Detail
-
init
protected AnyUtils init()
- Specified by:
init
in classAbstractAnyDAO<User>
-
findKey
@Transactional(readOnly=true) public String findKey(String username)
-
findLastChange
@Transactional(readOnly=true) public OffsetDateTime findLastChange(String key)
- Specified by:
findLastChange
in interfaceAnyDAO<User>
-
findUsername
@Transactional(readOnly=true) public Optional<String> findUsername(String key)
- Specified by:
findUsername
in interfaceUserDAO
-
count
public int count()
-
countByRealm
public Map<String,Integer> countByRealm()
- Specified by:
countByRealm
in interfaceUserDAO
-
countByStatus
public Map<String,Integer> countByStatus()
- Specified by:
countByStatus
in interfaceUserDAO
-
securityChecks
@Transactional(readOnly=true) public void securityChecks(Set<String> authRealms, String key, String realm, Collection<String> groups)
Description copied from interface:UserDAO
Checks if the calling user is authorized to access the User matching the provided key, under the given realm.- Specified by:
securityChecks
in interfaceUserDAO
- Parameters:
authRealms
- realms for which the calling user owns entitlement(s) to checkkey
- User keyrealm
- User's realm full pathgroups
- group the User is member of
-
securityChecks
protected void securityChecks(User user)
- Specified by:
securityChecks
in classAbstractAnyDAO<User>
-
findByUsername
public User findByUsername(String username)
- Specified by:
findByUsername
in interfaceUserDAO
-
findByToken
public User findByToken(String token)
- Specified by:
findByToken
in interfaceUserDAO
-
findBySecurityQuestion
public List<User> findBySecurityQuestion(SecurityQuestion securityQuestion)
- Specified by:
findBySecurityQuestion
in interfaceUserDAO
-
findMembership
public UMembership findMembership(String key)
- Specified by:
findMembership
in interfaceUserDAO
-
findAll
public List<User> findAll(int page, int itemsPerPage)
Description copied from interface:AnyDAO
Find any objects without any limitation, according to given page and items per page.
-
findAllKeys
public List<String> findAllKeys(int page, int itemsPerPage)
Description copied from interface:AnyDAO
Find any objects' keys without any limitation, according to given page and items per page.- Specified by:
findAllKeys
in interfaceAnyDAO<User>
- Parameters:
page
- search result pageitemsPerPage
- items per search result page- Returns:
- any objects' keys matching the provided conditions
-
saveAndGetDynGroupMembs
public Pair<Set<String>,Set<String>> saveAndGetDynGroupMembs(User user)
- Specified by:
saveAndGetDynGroupMembs
in interfaceUserDAO
-
findAllRoles
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<Role> findAllRoles(User user)
- Specified by:
findAllRoles
in interfaceUserDAO
-
findDynRoles
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public List<Role> findDynRoles(String key)
- Specified by:
findDynRoles
in interfaceUserDAO
-
findDynGroups
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public List<Group> findDynGroups(String key)
- Specified by:
findDynGroups
in interfaceUserDAO
-
findAllGroups
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<Group> findAllGroups(User user)
- Specified by:
findAllGroups
in interfaceUserDAO
-
findAllGroupKeys
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<String> findAllGroupKeys(User user)
- Specified by:
findAllGroupKeys
in interfaceUserDAO
-
findAllGroupNames
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<String> findAllGroupNames(User user)
- Specified by:
findAllGroupNames
in interfaceUserDAO
-
findAllResources
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<ExternalResource> findAllResources(User user)
- Specified by:
findAllResources
in interfaceUserDAO
-
findAllResourceKeys
@Transactional(readOnly=true) public Collection<String> findAllResourceKeys(String key)
- Specified by:
findAllResourceKeys
in interfaceAnyDAO<User>
-
linkedAccountExists
@Transactional(readOnly=true) public boolean linkedAccountExists(String userKey, String connObjectKeyValue)
- Specified by:
linkedAccountExists
in interfaceUserDAO
-
findLinkedAccount
public Optional<? extends LinkedAccount> findLinkedAccount(ExternalResource resource, String connObjectKeyValue)
- Specified by:
findLinkedAccount
in interfaceUserDAO
-
findLinkedAccounts
@Transactional(readOnly=true) public List<LinkedAccount> findLinkedAccounts(String userKey)
- Specified by:
findLinkedAccounts
in interfaceUserDAO
-
findLinkedAccountsByPrivilege
public List<LinkedAccount> findLinkedAccountsByPrivilege(Privilege privilege)
- Specified by:
findLinkedAccountsByPrivilege
in interfaceUserDAO
-
findLinkedAccountsByResource
public List<LinkedAccount> findLinkedAccountsByResource(ExternalResource resource)
- Specified by:
findLinkedAccountsByResource
in interfaceUserDAO
-
-