Package org.dspace.authorize.service
Interface ResourcePolicyService
- All Known Implementing Classes:
ResourcePolicyServiceImpl
public interface ResourcePolicyService
Service interface class for the ResourcePolicy object.
The implementation of this class is responsible for all business logic calls for the ResourcePolicy object and is
autowired by spring
- Author:
- kevinvandevelde at atmire.com
-
Method Summary
Modifier and TypeMethodDescriptionclone(Context context, ResourcePolicy resourcePolicy) Create and persist a copy of a given ResourcePolicy, with an empty dSpaceObject field.intcountByEPerson(Context context, EPerson ePerson) Count all the resource policies of the 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 resourceUuidintcountResourcePoliciesByEPersonAndResourceUuid(Context context, EPerson ePerson, UUID resourceUuid) Count all the policies related to a resourceUuid belong to an ePersonintcountResourcePolicyByGroup(Context context, Group group) Count all the resource policies of the groupvoiddelete(Context context, ResourcePolicy resourcePolicy) find(Context c, DSpaceObject o) find(Context c, DSpaceObject o, int actionId) find(Context c, DSpaceObject o, String type) find(Context c, DSpaceObject dso, Group group, int action) Retrieve a list of ResourcePolicies by EPersonfindByEPerson(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 ePersonfindByGroup(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 actionIdfindByTypeGroupActionExceptId(Context context, DSpaceObject dso, Group group, int action, int notPolicyID) Look for ResourcePolicies by DSpaceObject, Group, and action, ignoring IDs with a specific PolicyID.findExceptRpType(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 rpTypegetActionText(ResourcePolicy resourcePolicy) booleanisDateValid(ResourcePolicy resourcePolicy) booleanisMyResourcePolicy(Context context, EPerson eperson, Integer id) Check if the resource policy identified with (id) belong to ePersonvoidremoveAllEPersonPolicies(Context context, EPerson ePerson) Removes all ResourcePolicies related to an EPersonvoidvoidremoveDsoAndTypeNotEqualsToPolicies(Context c, DSpaceObject o, String type) voidremoveDsoEPersonPolicies(Context context, DSpaceObject dso, EPerson ePerson) voidremoveDsoGroupPolicies(Context context, DSpaceObject dso, Group group) voidremoveGroupPolicies(Context c, Group group) voidremovePolicies(Context c, DSpaceObject o, int actionId) voidremovePolicies(Context c, DSpaceObject o, String type) voidremovePolicies(Context c, DSpaceObject o, String type, int action) voidupdate(Context context, List<ResourcePolicy> resourcePolicies) Persist a collection of model objects.voidupdate(Context context, ResourcePolicy resourcePolicy) Persist a model object.
-
Method Details
-
create
ResourcePolicy create(Context context, EPerson eperson, Group group) throws SQLException, AuthorizeException - Throws:
SQLExceptionAuthorizeException
-
find
- Throws:
SQLException
-
update
Persist a model object.- Parameters:
context-resourcePolicy- object to be persisted.- Throws:
SQLException- passed through.AuthorizeException- passed through.
-
update
void update(Context context, List<ResourcePolicy> resourcePolicies) throws SQLException, AuthorizeException Persist a collection of model objects.- Parameters:
context-resourcePolicies- object to be persisted.- Throws:
SQLException- passed through.AuthorizeException- passed through.
-
delete
- Throws:
SQLExceptionAuthorizeException
-
find
- Throws:
SQLException
-
find
- Throws:
SQLException
-
find
- Throws:
SQLException
-
find
- Throws:
SQLException
-
find
- Throws:
SQLException
-
find
Retrieve a list of ResourcePolicies by EPerson- Parameters:
c- contextePerson- the EPerson for which to look up the resource policies- Returns:
- a list of ResourcePolicies for the provided EPerson
- Throws:
SQLException- if there's a database problem
-
find
List<ResourcePolicy> find(Context c, EPerson e, List<Group> groups, int action, int type_id) 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:
context- current DSpace session.dso- find policies for this object.group- find policies referring to this group.action- find policies for this action.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- passed through.
-
getActionText
-
isDateValid
-
clone
ResourcePolicy clone(Context context, ResourcePolicy resourcePolicy) throws SQLException, AuthorizeException Create and persist a copy of a given ResourcePolicy, with an empty dSpaceObject field.- Parameters:
context- current DSpace session.resourcePolicy- the policy to be copied.- Returns:
- the copy.
- Throws:
SQLException- passed through.AuthorizeException- passed through.
-
removeAllPolicies
- Throws:
SQLExceptionAuthorizeException
-
removePolicies
void removePolicies(Context c, DSpaceObject o, int actionId) throws SQLException, AuthorizeException - Throws:
SQLExceptionAuthorizeException
-
removePolicies
- Throws:
SQLExceptionAuthorizeException
-
removePolicies
void removePolicies(Context c, DSpaceObject o, String type, int action) throws SQLException, AuthorizeException - Throws:
SQLExceptionAuthorizeException
-
removeDsoGroupPolicies
void removeDsoGroupPolicies(Context context, DSpaceObject dso, Group group) throws SQLException, AuthorizeException - Throws:
SQLExceptionAuthorizeException
-
removeDsoEPersonPolicies
void removeDsoEPersonPolicies(Context context, DSpaceObject dso, EPerson ePerson) throws SQLException, AuthorizeException - Throws:
SQLExceptionAuthorizeException
-
removeAllEPersonPolicies
void removeAllEPersonPolicies(Context context, EPerson ePerson) throws SQLException, AuthorizeException Removes all ResourcePolicies related to an EPerson- Parameters:
context- contextePerson- the EPerson for which the ResourcePolicies will be deleted- Throws:
SQLException- if there's a database problemAuthorizeException- when the current user is not authorized
-
removeGroupPolicies
- Throws:
SQLException
-
removeDsoAndTypeNotEqualsToPolicies
void removeDsoAndTypeNotEqualsToPolicies(Context c, DSpaceObject o, String type) throws SQLException, AuthorizeException - Throws:
SQLExceptionAuthorizeException
-
findExceptRpType
List<ResourcePolicy> findExceptRpType(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- Returns:
- some of the policies referring to
ePerson. - 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
-
countResourcePoliciesByEPersonAndResourceUuid
int countResourcePoliciesByEPersonAndResourceUuid(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
-
isMyResourcePolicy
Check if the resource policy identified with (id) belong to ePerson- Parameters:
context- DSpace context objecteperson- ePersonid- id of resource policy- Returns:
- Throws:
SQLException- if database error
-