Package org.dspace.authorize.dao
Interface ResourcePolicyDAO
- All Superinterfaces:
GenericDAO<ResourcePolicy>
- All Known Implementing Classes:
ResourcePolicyDAOImpl
Database Access Object interface class for the ResourcePolicy object.
The implementation of this class is responsible for all database calls for the ResourcePolicy object and is
autowired by spring
This class should only be accessed from a single service and should never be exposed outside of the API
- Author:
- kevinvandevelde at atmire.com
-
Method Summary
Modifier and TypeMethodDescriptionintcountByEPerson(Context context, EPerson ePerson) Count all the resource policies of the ePersonintcountByEPersonAndResourceUuid(Context context, EPerson ePerson, UUID resourceUuid) Count all the policies related to a resourceUuid belong to an ePersonintcountByGroupAndResourceUuid(Context context, Group group, UUID resourceUuid) Count all the resource policies of the group and of the resourceUuidintcountByResouceUuidAndActionId(Context context, UUID resourceUuid, int actionId) Count all the policies related to a resourceUuid and actionIdintcountByResourceUuid(Context context, UUID resourceUuid) Count all the policies by resourceUuidintcountResourcePolicyByGroup(Context context, Group group) Count all the resource policies of the groupvoiddeleteByDso(Context context, DSpaceObject dso) voiddeleteByDsoAndAction(Context context, DSpaceObject dso, int actionId) voiddeleteByDsoAndType(Context context, DSpaceObject dSpaceObject, String type) voiddeleteByDsoAndTypeAndAction(Context context, DSpaceObject dSpaceObject, String type, int action) voiddeleteByDsoAndTypeNotEqualsTo(Context c, DSpaceObject o, String type) voiddeleteByDsoEPersonPolicies(Context context, DSpaceObject dso, EPerson ePerson) voiddeleteByDsoGroupPolicies(Context context, DSpaceObject dso, Group group) voiddeleteByEPerson(Context context, EPerson ePerson) Deletes all policies that belong to an EPersonvoiddeleteByGroup(Context context, Group group) findByDso(Context context, DSpaceObject dso) findByDSoAndAction(Context context, DSpaceObject dso, int actionId) findByDSoAndActionExceptRpType(Context c, DSpaceObject o, int actionID, String rpType) Return a list of policies for an object that match the action except the record labeled with the rpTypefindByDsoAndType(Context context, DSpaceObject dSpaceObject, String type) findByEPerson(Context context, EPerson ePerson) findByEPerson(Context context, EPerson ePerson, int offset, int limit) Return a paginated list of policies that belong to an EPersonfindByEPersonAndResourceUuid(Context context, EPerson ePerson, UUID resourceUuid, int offset, int limit) Return a paginated list of policies related to a resourceUuid belong to an ePersonfindByEPersonGroupTypeIdAction(Context context, EPerson e, List<Group> groups, int action, int type_id) findByGroup(Context context, Group group) findByGroup(Context context, Group group, int offset, int limit) Return a paginated list of policies related to a groupfindByGroupAndResourceUuid(Context context, Group group, UUID resourceUuid, int offset, int limit) Return a paginated list of policies related to a group and related to a resourceUuidfindByResouceUuid(Context context, UUID resourceUuid, int offset, int limit) Return a paginated list of policies related to a DSpace resourcefindByResouceUuidAndActionId(Context context, UUID resourceUuid, int actionId, int offset, int limit) Return a paginated list of policies related to a DSpace resource filter by actionIdfindByTypeGroupAction(Context context, DSpaceObject dso, Group group, int action) findByTypeGroupActionExceptId(Context context, DSpaceObject dso, Group group, int action, int notPolicyID) Look for ResourcePolicies by DSpaceObject, Group, and action, ignoring IDs with a specific PolicyID.findOneById(Context context, Integer id)
-
Method Details
-
findByDso
- Throws:
SQLException
-
findByDsoAndType
List<ResourcePolicy> findByDsoAndType(Context context, DSpaceObject dSpaceObject, String type) throws SQLException - Throws:
SQLException
-
findByEPerson
- Throws:
SQLException
-
findByGroup
- Throws:
SQLException
-
findByDSoAndAction
List<ResourcePolicy> findByDSoAndAction(Context context, DSpaceObject dso, int actionId) throws SQLException - Throws:
SQLException
-
deleteByDsoAndTypeAndAction
void deleteByDsoAndTypeAndAction(Context context, DSpaceObject dSpaceObject, String type, int action) throws SQLException - Throws:
SQLException
-
findByTypeGroupAction
List<ResourcePolicy> findByTypeGroupAction(Context context, DSpaceObject dso, Group group, int action) throws SQLException - Throws:
SQLException
-
findByTypeGroupActionExceptId
List<ResourcePolicy> findByTypeGroupActionExceptId(Context context, DSpaceObject dso, Group group, int action, int notPolicyID) throws SQLException Look for ResourcePolicies by DSpaceObject, Group, and action, ignoring IDs with a specific PolicyID. This method can be used to detect duplicate ResourcePolicies.- Parameters:
notPolicyID- ResourcePolicies with this ID will be ignored while looking out for equal ResourcePolicies.- Returns:
- List of resource policies for the same DSpaceObject, group and action but other policyID.
- Throws:
SQLException
-
findByEPersonGroupTypeIdAction
List<ResourcePolicy> findByEPersonGroupTypeIdAction(Context context, EPerson e, List<Group> groups, int action, int type_id) throws SQLException - Throws:
SQLException
-
deleteByDso
- Throws:
SQLException
-
deleteByDsoAndAction
- Throws:
SQLException
-
deleteByDsoAndType
void deleteByDsoAndType(Context context, DSpaceObject dSpaceObject, String type) throws SQLException - Throws:
SQLException
-
deleteByGroup
- Throws:
SQLException
-
deleteByDsoGroupPolicies
- Throws:
SQLException
-
deleteByDsoEPersonPolicies
void deleteByDsoEPersonPolicies(Context context, DSpaceObject dso, EPerson ePerson) throws SQLException - Throws:
SQLException
-
deleteByEPerson
Deletes all policies that belong to an EPerson- Parameters:
context- DSpace context objectePerson- ePerson whose policies to delete- Throws:
SQLException- if database error
-
deleteByDsoAndTypeNotEqualsTo
- Throws:
SQLException
-
findByDSoAndActionExceptRpType
List<ResourcePolicy> findByDSoAndActionExceptRpType(Context c, DSpaceObject o, int actionID, String rpType) throws SQLException Return a list of policies for an object that match the action except the record labeled with the rpType- Parameters:
c- contexto- DSpaceObject policies relate toactionID- action (defined in class Constants)rpType- the resource policy type- Returns:
- list of resource policies
- Throws:
SQLException- if there's a database problem
-
findByEPerson
List<ResourcePolicy> findByEPerson(Context context, EPerson ePerson, int offset, int limit) throws SQLException Return a paginated list of policies that belong to an EPerson- Parameters:
context- DSpace context objectePerson- ePerson whose policies want to findoffset- the position of the first result to returnlimit- paging limit- Throws:
SQLException- if database error
-
countByEPerson
Count all the resource policies of the ePerson- Parameters:
context- DSpace context objectePerson- ePerson whose policies want to count- Returns:
- total resource policies of the ePerson
- Throws:
SQLException- if database error
-
findByEPersonAndResourceUuid
List<ResourcePolicy> findByEPersonAndResourceUuid(Context context, EPerson ePerson, UUID resourceUuid, int offset, int limit) throws SQLException Return a paginated list of policies related to a resourceUuid belong to an ePerson- Parameters:
context- DSpace context objectePerson- ePerson whose policies want to findresourceUuid- the uuid of an DSpace resourceoffset- the position of the first result to returnlimit- paging limit- Returns:
- list of resource policies
- Throws:
SQLException- if database error
-
countByEPersonAndResourceUuid
int countByEPersonAndResourceUuid(Context context, EPerson ePerson, UUID resourceUuid) throws SQLException Count all the policies related to a resourceUuid belong to an ePerson- Parameters:
context- DSpace context objectresourceUuid- the uuid of an DSpace resourceePerson- ePerson whose policies want to find- Returns:
- total policies
- Throws:
SQLException- if database error
-
findByResouceUuidAndActionId
List<ResourcePolicy> findByResouceUuidAndActionId(Context context, UUID resourceUuid, int actionId, int offset, int limit) throws SQLException Return a paginated list of policies related to a DSpace resource filter by actionId- Parameters:
context- DSpace context objectresourceUuid- the uuid of an DSpace resourceactionId- id relative to action as READ, WRITE, DELITE etc.offset- the position of the first result to returnlimit- paging limit- Returns:
- list of resource policies
- Throws:
SQLException- if database error
-
countByResouceUuidAndActionId
int countByResouceUuidAndActionId(Context context, UUID resourceUuid, int actionId) throws SQLException Count all the policies related to a resourceUuid and actionId- Parameters:
context- DSpace context objectresourceUuid- the uuid of an DSpace resourceactionId- id relative to action as READ, WRITE, DELITE etc.- Returns:
- total policies
- Throws:
SQLException- if database error
-
findByResouceUuid
List<ResourcePolicy> findByResouceUuid(Context context, UUID resourceUuid, int offset, int limit) throws SQLException Return a paginated list of policies related to a DSpace resource- Parameters:
context- DSpace context objectresourceUuid- the uuid of an DSpace resourceoffset- the position of the first result to returnlimit- paging limit- Returns:
- list of resource policies
- Throws:
SQLException- if database error
-
countByResourceUuid
Count all the policies by resourceUuid- Parameters:
context- DSpace context objectresourceUuid- the uuid of an DSpace resource- Returns:
- total policies
- Throws:
SQLException- if database error
-
findByGroup
List<ResourcePolicy> findByGroup(Context context, Group group, int offset, int limit) throws SQLException Return a paginated list of policies related to a group- Parameters:
context- DSpace context objectgroup- DSpace groupoffset- the position of the first result to returnlimit- paging limit- Returns:
- list of resource policies
- Throws:
SQLException- if database error
-
countResourcePolicyByGroup
Count all the resource policies of the group- Parameters:
context- DSpace context objectgroup- DSpace group- Returns:
- total policies
- Throws:
SQLException- if database error
-
findByGroupAndResourceUuid
List<ResourcePolicy> findByGroupAndResourceUuid(Context context, Group group, UUID resourceUuid, int offset, int limit) throws SQLException Return a paginated list of policies related to a group and related to a resourceUuid- Parameters:
context- DSpace context objectgroup- DSpace groupresourceUuid- the uuid of an DSpace resourceoffset- the position of the first result to returnlimit- paging limit- Returns:
- list of resource policies
- Throws:
SQLException- if database error
-
countByGroupAndResourceUuid
int countByGroupAndResourceUuid(Context context, Group group, UUID resourceUuid) throws SQLException Count all the resource policies of the group and of the resourceUuid- Parameters:
context- DSpace context objectgroup- DSpace groupresourceUuid- the uuid of an DSpace resource- Returns:
- total policies
- Throws:
SQLException- if database error
-
findOneById
- Throws:
SQLException
-