Class JPAGroupDAO
- java.lang.Object
-
- org.apache.syncope.core.persistence.jpa.dao.AbstractDAO<A>
-
- org.apache.syncope.core.persistence.jpa.dao.AbstractAnyDAO<Group>
-
- org.apache.syncope.core.persistence.jpa.dao.JPAGroupDAO
-
- Direct Known Subclasses:
JPAJSONGroupDAO
public class JPAGroupDAO extends AbstractAnyDAO<Group> implements GroupDAO
-
-
Field Summary
Fields Modifier and Type Field Description static String
ADYNMEMB_TABLE
protected AnyMatchDAO
anyMatchDAO
protected AnyObjectDAO
anyObjectDAO
protected AnySearchDAO
anySearchDAO
protected PlainAttrDAO
plainAttrDAO
protected ApplicationEventPublisher
publisher
protected SearchCondVisitor
searchCondVisitor
static String
UDYNMEMB_TABLE
protected UserDAO
userDAO
-
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 JPAGroupDAO(AnyUtilsFactory anyUtilsFactory, ApplicationEventPublisher publisher, PlainSchemaDAO plainSchemaDAO, DerSchemaDAO derSchemaDAO, DynRealmDAO dynRealmDAO, AnyMatchDAO anyMatchDAO, PlainAttrDAO plainAttrDAO, UserDAO userDAO, AnyObjectDAO anyObjectDAO, AnySearchDAO searchDAO, SearchCondVisitor searchCondVisitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SearchCond
buildDynMembershipCond(String baseCondFIQL)
void
clearADynMembers(Group group)
void
clearUDynMembers(Group group)
int
count()
int
countADynMembers(Group group)
int
countAMembers(String groupKey)
Map<String,Integer>
countByRealm()
int
countUDynMembers(Group group)
int
countUMembers(String groupKey)
void
delete(Group group)
boolean
existsAMembership(String anyObjectKey, String groupKey)
boolean
existsUMembership(String userKey, String groupKey)
List<String>
findADynMembers(Group group)
List<Group>
findAll(int page, int itemsPerPage)
Find any objects without any limitation, according to given page and items per page.List<String>
findAllKeys(int page, int itemsPerPage)
Find any objects' keys without any limitation, according to given page and items per page.Collection<String>
findAllResourceKeys(String key)
List<String>
findAMembers(String groupKey)
List<AMembership>
findAMemberships(Group group)
Group
findByName(String name)
String
findKey(String name)
List<String>
findKeysByNamePattern(String pattern)
OffsetDateTime
findLastChange(String key)
List<Group>
findOwnedByGroup(String groupKey)
List<Group>
findOwnedByUser(String userKey)
List<TypeExtension>
findTypeExtensions(AnyTypeClass anyTypeClass)
List<String>
findUDynMembers(Group group)
List<String>
findUMembers(String groupKey)
List<UMembership>
findUMemberships(Group group)
protected List<ADynGroupMembership>
findWithADynMemberships(AnyType anyType)
protected List<UDynGroupMembership>
findWithUDynMemberships()
protected AnyUtils
init()
Pair<Set<String>,Set<String>>
refreshDynMemberships(AnyObject anyObject)
Evaluates all the dynamic group membership conditions against the given anyObject (invoked during save).Pair<Set<String>,Set<String>>
refreshDynMemberships(User user)
Evaluates all the dynamic group membership conditions against the given user (invoked during save).Set<String>
removeDynMemberships(AnyObject anyObject)
Removes the dynamic group memberships of the given anyObject (invoked during delete).Set<String>
removeDynMemberships(User user)
Removes the dynamic group memberships of the given anyObject (invoked during delete).Group
saveAndRefreshDynMemberships(Group group)
Saves the provided group and refreshes all User and AnyObject members.void
securityChecks(Set<String> authRealms, String key, String realm)
Checks if the calling user is authorized to access the Group matching the provided key, under the given realm.protected void
securityChecks(Group group)
-
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, save
-
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, save
-
-
-
-
Field Detail
-
UDYNMEMB_TABLE
public static final String UDYNMEMB_TABLE
- See Also:
- Constant Field Values
-
ADYNMEMB_TABLE
public static final String ADYNMEMB_TABLE
- See Also:
- Constant Field Values
-
publisher
protected final ApplicationEventPublisher publisher
-
anyMatchDAO
protected final AnyMatchDAO anyMatchDAO
-
plainAttrDAO
protected final PlainAttrDAO plainAttrDAO
-
userDAO
protected final UserDAO userDAO
-
anyObjectDAO
protected final AnyObjectDAO anyObjectDAO
-
anySearchDAO
protected final AnySearchDAO anySearchDAO
-
searchCondVisitor
protected final SearchCondVisitor searchCondVisitor
-
-
Constructor Detail
-
JPAGroupDAO
public JPAGroupDAO(AnyUtilsFactory anyUtilsFactory, ApplicationEventPublisher publisher, PlainSchemaDAO plainSchemaDAO, DerSchemaDAO derSchemaDAO, DynRealmDAO dynRealmDAO, AnyMatchDAO anyMatchDAO, PlainAttrDAO plainAttrDAO, UserDAO userDAO, AnyObjectDAO anyObjectDAO, AnySearchDAO searchDAO, SearchCondVisitor searchCondVisitor)
-
-
Method Detail
-
init
protected AnyUtils init()
- Specified by:
init
in classAbstractAnyDAO<Group>
-
findKey
@Transactional(readOnly=true) public String findKey(String name)
-
findLastChange
@Transactional(readOnly=true) public OffsetDateTime findLastChange(String key)
- Specified by:
findLastChange
in interfaceAnyDAO<Group>
-
count
public int count()
-
countByRealm
public Map<String,Integer> countByRealm()
- Specified by:
countByRealm
in interfaceGroupDAO
-
securityChecks
@Transactional(readOnly=true) public void securityChecks(Set<String> authRealms, String key, String realm)
Description copied from interface:GroupDAO
Checks if the calling user is authorized to access the Group matching the provided key, under the given realm.- Specified by:
securityChecks
in interfaceGroupDAO
- Parameters:
authRealms
- realms for which the calling user owns entitlement(s) to checkkey
- Group keyrealm
- Group's realm full path
-
securityChecks
protected void securityChecks(Group group)
- Specified by:
securityChecks
in classAbstractAnyDAO<Group>
-
findByName
public Group findByName(String name)
- Specified by:
findByName
in interfaceGroupDAO
-
findKeysByNamePattern
public List<String> findKeysByNamePattern(String pattern)
- Specified by:
findKeysByNamePattern
in interfaceGroupDAO
-
findOwnedByUser
@Transactional(readOnly=true) public List<Group> findOwnedByUser(String userKey)
- Specified by:
findOwnedByUser
in interfaceGroupDAO
-
findOwnedByGroup
@Transactional(readOnly=true) public List<Group> findOwnedByGroup(String groupKey)
- Specified by:
findOwnedByGroup
in interfaceGroupDAO
-
findAMemberships
public List<AMembership> findAMemberships(Group group)
- Specified by:
findAMemberships
in interfaceGroupDAO
-
findUMemberships
public List<UMembership> findUMemberships(Group group)
- Specified by:
findUMemberships
in interfaceGroupDAO
-
findAll
public List<Group> 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<Group>
- Parameters:
page
- search result pageitemsPerPage
- items per search result page- Returns:
- any objects' keys matching the provided conditions
-
buildDynMembershipCond
protected SearchCond buildDynMembershipCond(String baseCondFIQL)
-
saveAndRefreshDynMemberships
public Group saveAndRefreshDynMemberships(Group group)
Description copied from interface:GroupDAO
Saves the provided group and refreshes all User and AnyObject members.- Specified by:
saveAndRefreshDynMemberships
in interfaceGroupDAO
- Parameters:
group
- group to save- Returns:
- merged group
-
findTypeExtensions
public List<TypeExtension> findTypeExtensions(AnyTypeClass anyTypeClass)
- Specified by:
findTypeExtensions
in interfaceGroupDAO
-
existsAMembership
@Transactional(readOnly=true) public boolean existsAMembership(String anyObjectKey, String groupKey)
- Specified by:
existsAMembership
in interfaceGroupDAO
-
existsUMembership
@Transactional(readOnly=true) public boolean existsUMembership(String userKey, String groupKey)
- Specified by:
existsUMembership
in interfaceGroupDAO
-
findAMembers
@Transactional(readOnly=true) public List<String> findAMembers(String groupKey)
- Specified by:
findAMembers
in interfaceGroupDAO
-
findUMembers
@Transactional(readOnly=true) public List<String> findUMembers(String groupKey)
- Specified by:
findUMembers
in interfaceGroupDAO
-
findADynMembers
public List<String> findADynMembers(Group group)
- Specified by:
findADynMembers
in interfaceGroupDAO
-
countAMembers
public int countAMembers(String groupKey)
- Specified by:
countAMembers
in interfaceGroupDAO
-
countUMembers
public int countUMembers(String groupKey)
- Specified by:
countUMembers
in interfaceGroupDAO
-
countADynMembers
public int countADynMembers(Group group)
- Specified by:
countADynMembers
in interfaceGroupDAO
-
countUDynMembers
public int countUDynMembers(Group group)
- Specified by:
countUDynMembers
in interfaceGroupDAO
-
clearADynMembers
public void clearADynMembers(Group group)
- Specified by:
clearADynMembers
in interfaceGroupDAO
-
findWithADynMemberships
protected List<ADynGroupMembership> findWithADynMemberships(AnyType anyType)
-
refreshDynMemberships
@Transactional public Pair<Set<String>,Set<String>> refreshDynMemberships(AnyObject anyObject)
Description copied from interface:GroupDAO
Evaluates all the dynamic group membership conditions against the given anyObject (invoked during save).- Specified by:
refreshDynMemberships
in interfaceGroupDAO
- Parameters:
anyObject
- anyObject being saved- Returns:
- pair of groups dynamically assigned before and after refresh
-
removeDynMemberships
public Set<String> removeDynMemberships(AnyObject anyObject)
Description copied from interface:GroupDAO
Removes the dynamic group memberships of the given anyObject (invoked during delete).- Specified by:
removeDynMemberships
in interfaceGroupDAO
- Parameters:
anyObject
- anyObject being deleted- Returns:
- groups dynamically assigned before refresh
-
findUDynMembers
public List<String> findUDynMembers(Group group)
- Specified by:
findUDynMembers
in interfaceGroupDAO
-
clearUDynMembers
public void clearUDynMembers(Group group)
- Specified by:
clearUDynMembers
in interfaceGroupDAO
-
findWithUDynMemberships
protected List<UDynGroupMembership> findWithUDynMemberships()
-
refreshDynMemberships
@Transactional public Pair<Set<String>,Set<String>> refreshDynMemberships(User user)
Description copied from interface:GroupDAO
Evaluates all the dynamic group membership conditions against the given user (invoked during save).- Specified by:
refreshDynMemberships
in interfaceGroupDAO
- Parameters:
user
- user being saved- Returns:
- pair of groups dynamically assigned before and after refresh
-
removeDynMemberships
public Set<String> removeDynMemberships(User user)
Description copied from interface:GroupDAO
Removes the dynamic group memberships of the given anyObject (invoked during delete).- Specified by:
removeDynMemberships
in interfaceGroupDAO
- Parameters:
user
- user being deleted- Returns:
- groups dynamically assigned before refresh
-
findAllResourceKeys
@Transactional(readOnly=true) public Collection<String> findAllResourceKeys(String key)
- Specified by:
findAllResourceKeys
in interfaceAnyDAO<Group>
- Specified by:
findAllResourceKeys
in interfaceGroupDAO
-
-