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 GroupDAOgroupDAOprotected UserDAOuserDAO-
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 intcount()Map<String,Integer>countByRealm(AnyType anyType)Map<AnyType,Integer>countByType()Counts the number of instances for each type.voiddelete(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)AnyObjectfindByName(String type, String name)List<Group>findDynGroups(String key)StringfindKey(String type, String name)OffsetDateTimefindLastChange(String key)AMembershipfindMembership(String key)protected List<URelationship>findURelationships(AnyObject anyObject)protected AnyUtilsinit()AnyObjectsave(AnyObject anyObject)Pair<Set<String>,Set<String>>saveAndGetDynGroupMembs(AnyObject anyObject)voidsecurityChecks(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 voidsecurityChecks(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:
initin classAbstractAnyDAO<AnyObject>
-
findByName
@Transactional(readOnly=true) public AnyObject findByName(String type, String name)
- Specified by:
findByNamein interfaceAnyObjectDAO
-
findByName
@Transactional(readOnly=true) public List<AnyObject> findByName(String name)
- Specified by:
findByNamein interfaceAnyObjectDAO
-
findKey
@Transactional(readOnly=true) public String findKey(String type, String name)
- Specified by:
findKeyin interfaceAnyObjectDAO
-
findLastChange
@Transactional(readOnly=true) public OffsetDateTime findLastChange(String key)
- Specified by:
findLastChangein interfaceAnyDAO<AnyObject>
-
countByType
public Map<AnyType,Integer> countByType()
Description copied from interface:AnyObjectDAOCounts the number of instances for each type. The returned map is expected to be sorted on values.- Specified by:
countByTypein interfaceAnyObjectDAO- Returns:
- the number of instances for each type
-
countByRealm
public Map<String,Integer> countByRealm(AnyType anyType)
- Specified by:
countByRealmin interfaceAnyObjectDAO
-
securityChecks
@Transactional(readOnly=true) public void securityChecks(Set<String> authRealms, String key, String realm, Collection<String> groups)
Description copied from interface:AnyObjectDAOChecks if the calling user is authorized to access the Any Object matching the provided key, under the given realm.- Specified by:
securityChecksin 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:
securityChecksin classAbstractAnyDAO<AnyObject>
-
findMembership
public AMembership findMembership(String key)
- Specified by:
findMembershipin interfaceAnyObjectDAO
-
findAllRelationships
public List<Relationship<Any<?>,AnyObject>> findAllRelationships(AnyObject anyObject)
- Specified by:
findAllRelationshipsin interfaceAnyObjectDAO
-
count
public int count()
-
findAll
public List<AnyObject> findAll(int page, int itemsPerPage)
Description copied from interface:AnyDAOFind 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:AnyDAOFind any objects' keys without any limitation, according to given page and items per page.- Specified by:
findAllKeysin 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:
saveAndGetDynGroupMembsin 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:
findDynGroupsin interfaceAnyObjectDAO
-
findAllGroups
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<Group> findAllGroups(AnyObject anyObject)
- Specified by:
findAllGroupsin interfaceAnyObjectDAO
-
findAllGroupKeys
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<String> findAllGroupKeys(AnyObject anyObject)
- Specified by:
findAllGroupKeysin interfaceAnyObjectDAO
-
findAllResources
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public Collection<ExternalResource> findAllResources(AnyObject anyObject)
- Specified by:
findAllResourcesin interfaceAnyObjectDAO
-
findAllResourceKeys
@Transactional(readOnly=true) public Collection<String> findAllResourceKeys(String key)
- Specified by:
findAllResourceKeysin interfaceAnyDAO<AnyObject>
-
-