Class JPAAnyObjectDAO
- java.lang.Object
-
- org.apache.syncope.core.persistence.jpa.dao.AbstractDAO<A>
-
- org.apache.syncope.core.persistence.jpa.dao.AbstractAnyDAO<AnyObject>
-
- org.apache.syncope.core.persistence.jpa.dao.JPAAnyObjectDAO
-
- All Implemented Interfaces:
AnyDAO<AnyObject>
,AnyObjectDAO
,DAO<AnyObject>
- Direct Known Subclasses:
JPAJSONAnyObjectDAO
public class JPAAnyObjectDAO extends AbstractAnyDAO<AnyObject> implements AnyObjectDAO
-
-
Field Summary
Fields Modifier and Type Field Description protected GroupDAO
groupDAO
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 JPAAnyObjectDAO(AnyUtilsFactory anyUtilsFactory, PlainSchemaDAO plainSchemaDAO, DerSchemaDAO derSchemaDAO, DynRealmDAO dynRealmDAO, UserDAO userDAO, GroupDAO groupDAO)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
count()
Map<String,Integer>
countByRealm(AnyType anyType)
Map<AnyType,Integer>
countByType()
Counts the number of instances for each type.void
delete(AnyObject anyObject)
protected Pair<AnyObject,Pair<Set<String>,Set<String>>>
doSave(AnyObject anyObject)
List<AnyObject>
findAll(int page, int itemsPerPage)
Find any objects without any limitation, according to given page and items per page.Collection<String>
findAllGroupKeys(AnyObject anyObject)
Collection<Group>
findAllGroups(AnyObject anyObject)
List<String>
findAllKeys(int page, int itemsPerPage)
Find any objects' keys without any limitation, according to given page and items per page.List<Relationship<Any<?>,AnyObject>>
findAllRelationships(AnyObject anyObject)
Collection<String>
findAllResourceKeys(String key)
Collection<ExternalResource>
findAllResources(AnyObject anyObject)
protected List<ARelationship>
findARelationships(AnyObject anyObject)
List<AnyObject>
findByName(String name)
AnyObject
findByName(String type, String name)
List<Group>
findDynGroups(String key)
String
findKey(String type, String name)
OffsetDateTime
findLastChange(String key)
AMembership
findMembership(String key)
protected List<URelationship>
findURelationships(AnyObject anyObject)
protected AnyUtils
init()
AnyObject
save(AnyObject anyObject)
Pair<Set<String>,Set<String>>
saveAndGetDynGroupMembs(AnyObject anyObject)
void
securityChecks(Set<String> authRealms, String key, String realm, Collection<String> groups)
Checks if the calling user is authorized to access the Any Object matching the provided key, under the given realm.protected void
securityChecks(AnyObject anyObject)
-
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
-
-
-
-
Constructor Detail
-
JPAAnyObjectDAO
public JPAAnyObjectDAO(AnyUtilsFactory anyUtilsFactory, PlainSchemaDAO plainSchemaDAO, DerSchemaDAO derSchemaDAO, DynRealmDAO dynRealmDAO, UserDAO userDAO, GroupDAO groupDAO)
-
-
Method Detail
-
init
protected AnyUtils init()
- Specified by:
init
in classAbstractAnyDAO<AnyObject>
-
findByName
@Transactional(readOnly=true) public AnyObject findByName(String type, String name)
- Specified by:
findByName
in interfaceAnyObjectDAO
-
findByName
@Transactional(readOnly=true) public List<AnyObject> findByName(String name)
- Specified by:
findByName
in interfaceAnyObjectDAO
-
findKey
@Transactional(readOnly=true) public String findKey(String type, String name)
- Specified by:
findKey
in interfaceAnyObjectDAO
-
findLastChange
@Transactional(readOnly=true) public OffsetDateTime findLastChange(String key)
- Specified by:
findLastChange
in interfaceAnyDAO<AnyObject>
-
countByType
public Map<AnyType,Integer> countByType()
Description copied from interface:AnyObjectDAO
Counts the number of instances for each type. The returned map is expected to be sorted on values.- Specified by:
countByType
in interfaceAnyObjectDAO
- Returns:
- the number of instances for each type
-
countByRealm
public Map<String,Integer> countByRealm(AnyType anyType)
- Specified by:
countByRealm
in interfaceAnyObjectDAO
-
securityChecks
@Transactional(readOnly=true) public void securityChecks(Set<String> authRealms, String key, String realm, Collection<String> groups)
Description copied from interface:AnyObjectDAO
Checks if the calling user is authorized to access the Any Object matching the provided key, under the given realm.- Specified by:
securityChecks
in interfaceAnyObjectDAO
- Parameters:
authRealms
- realms for which the calling user owns entitlement(s) to checkkey
- Any Object keyrealm
- Any Object's realm full pathgroups
- group the Any Object is member of
-
securityChecks
protected void securityChecks(AnyObject anyObject)
- Specified by:
securityChecks
in classAbstractAnyDAO<AnyObject>
-
findMembership
public AMembership findMembership(String key)
- Specified by:
findMembership
in interfaceAnyObjectDAO
-
findAllRelationships
public List<Relationship<Any<?>,AnyObject>> findAllRelationships(AnyObject anyObject)
- Specified by:
findAllRelationships
in interfaceAnyObjectDAO
-
count
public int count()
-
findAll
public List<AnyObject> 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<AnyObject>
- 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(AnyObject anyObject)
- Specified by:
saveAndGetDynGroupMembs
in interfaceAnyObjectDAO
-
findARelationships
protected List<ARelationship> findARelationships(AnyObject anyObject)
-
findURelationships
protected List<URelationship> findURelationships(AnyObject anyObject)
-
findDynGroups
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public List<Group> findDynGroups(String key)
- Specified by:
findDynGroups
in interfaceAnyObjectDAO
-
findAllGroups
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<Group> findAllGroups(AnyObject anyObject)
- Specified by:
findAllGroups
in interfaceAnyObjectDAO
-
findAllGroupKeys
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<String> findAllGroupKeys(AnyObject anyObject)
- Specified by:
findAllGroupKeys
in interfaceAnyObjectDAO
-
findAllResources
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<ExternalResource> findAllResources(AnyObject anyObject)
- Specified by:
findAllResources
in interfaceAnyObjectDAO
-
findAllResourceKeys
@Transactional(readOnly=true) public Collection<String> findAllResourceKeys(String key)
- Specified by:
findAllResourceKeys
in interfaceAnyDAO<AnyObject>
-
-