Package cz.metacentrum.perun.core.api
Interface ConsentsManager
- All Known Implementing Classes:
- ConsentsManagerEntry
public interface ConsentsManager
Consents entry logic.
- Author:
- Radoslav Čerhák invalid input: '<'r.cerhak@gmail.com>
- 
Method SummaryModifier and TypeMethodDescriptionchangeConsentStatus(PerunSession sess, Consent consent, ConsentStatus status) Set consent statusvoidevaluateConsents(PerunSession sess, ConsentHub consentHub) Evaluates consents for given consent hub with enforced consents enabled.voidevaluateConsents(PerunSession sess, Service service) Evaluates consents for given service for all consent hubs with given service with enforced consents enabled.voidevaluateConsents(PerunSession sess, List<ConsentHub> consentHubs) Evaluates consents for given list of consent hubs with enforced consents enabled.Get list of all Consent HubsgetAllConsents(PerunSession sess) Gel all consentsgetConsentById(PerunSession sess, int id) Get consent object with specified idgetConsentForUserAndConsentHub(PerunSession sess, int userId, int consentHubId, ConsentStatus status) Get consent for chosen user in specified consent hub with specified statusgetConsentHubByFacility(PerunSession sess, int facilityId) Finds existing Consent Hub by facility.getConsentHubById(PerunSession sess, int id) Finds existing Consent Hub by id.getConsentHubByName(PerunSession sess, String name) Finds existing Consent Hub by name.getConsentHubByResource(PerunSession sess, int resourceId) Finds existing Consent Hub for facility to which resource belongs.getConsentsForConsentHub(PerunSession sess, int id) Get all consents for chosen ConsentHubgetConsentsForConsentHub(PerunSession sess, int id, ConsentStatus status) Get all consents for chosen ConsentHub with the specified statusgetConsentsForConsentHubByResource(PerunSession sess, int resourceId) Get consents for members assigned to the chosen resource.getConsentsForUser(PerunSession sess, int id) Get all consents for chosen UsergetConsentsForUser(PerunSession sess, int id, ConsentStatus status) Get all consents for chosen User with the specified statusgetConsentsForUserAndConsentHub(PerunSession sess, int userId, int consentHubId) Get all consents for chosen User in specified consent hubupdateConsentHub(PerunSession perunSession, ConsentHub consentHub) Updates the consent hub.
- 
Method Details- 
changeConsentStatusConsent changeConsentStatus(PerunSession sess, Consent consent, ConsentStatus status) throws ConsentNotExistsException, PrivilegeException, InvalidConsentStatusException, UserNotExistsException Set consent status- Parameters:
- sess- perun session
- consent- consent
- status- status that should be set
- Returns:
- consent
- Throws:
- ConsentNotExistsException- if consent hub does not exist
- PrivilegeException- if insufficient rights
- InvalidConsentStatusException- if passed status value can not be set
- UserNotExistsException- if user does not exist
 
- 
evaluateConsentsEvaluates consents for given consent hub with enforced consents enabled.Service defines whether only active users will be evaluated or expired ones as well. - Parameters:
- sess- session
- consentHub- consent hub
- Throws:
- PrivilegeException
 
- 
evaluateConsentsEvaluates consents for given list of consent hubs with enforced consents enabled.Service defines whether only active users will be evaluated or expired ones as well. - Parameters:
- sess- session
- consentHubs- consent hubs
- Throws:
- PrivilegeException
 
- 
evaluateConsentsEvaluates consents for given service for all consent hubs with given service with enforced consents enabled.Corresponding consent hubs (containing the service) will have consents evaluated ONLY for selected service. Service defines whether only active users will be evaluated or expired ones as well. If new consent is created, attributes from ALL services under given consent hub are gathered for it. - Parameters:
- sess- session
- service- service
- Throws:
- PrivilegeException
 
- 
getAllConsentHubsGet list of all Consent Hubs- Parameters:
- sess- perun session
- Returns:
- list of Consent Hubs
- Throws:
- PrivilegeException
- InternalErrorException
 
- 
getAllConsentsGel all consents- Parameters:
- sess-
- Returns:
- all existing consents in the database
- Throws:
- PrivilegeException
 
- 
getConsentByIdConsent getConsentById(PerunSession sess, int id) throws ConsentNotExistsException, PrivilegeException Get consent object with specified id- Parameters:
- sess-
- id- id of desired consent object
- Returns:
- consent object with specified id
- Throws:
- ConsentNotExistsException- thrown if consent with the id doesn't exist
- PrivilegeException
 
- 
getConsentForUserAndConsentHubConsent getConsentForUserAndConsentHub(PerunSession sess, int userId, int consentHubId, ConsentStatus status) throws PrivilegeException, UserNotExistsException, ConsentHubNotExistsException, ConsentNotExistsException Get consent for chosen user in specified consent hub with specified status- Parameters:
- sess-
- userId- id of the user
- consentHubId- id of the consent hub
- status- status of the consent
- Returns:
- Throws:
- PrivilegeException
- UserNotExistsException
- ConsentHubNotExistsException
- ConsentNotExistsException
 
- 
getConsentHubByFacilityConsentHub getConsentHubByFacility(PerunSession sess, int facilityId) throws ConsentHubNotExistsException, PrivilegeException, FacilityNotExistsException Finds existing Consent Hub by facility.- Parameters:
- sess- perun session
- facilityId- id of facility for which consent hub is searched
- Returns:
- found Consent Hub
- Throws:
- ConsentHubNotExistsException
- InternalErrorException
- PrivilegeException
- FacilityNotExistsException
 
- 
getConsentHubByIdConsentHub getConsentHubById(PerunSession sess, int id) throws ConsentHubNotExistsException, PrivilegeException Finds existing Consent Hub by id.- Parameters:
- sess- perun session
- id- id of the Consent Hub you are looking for
- Returns:
- found Consent Hub
- Throws:
- ConsentHubNotExistsException
- InternalErrorException
- PrivilegeException
 
- 
getConsentHubByNameConsentHub getConsentHubByName(PerunSession sess, String name) throws ConsentHubNotExistsException, PrivilegeException Finds existing Consent Hub by name.- Parameters:
- sess- perun session
- name- name of the Consent Hub you are looking for
- Returns:
- found Consent Hub
- Throws:
- ConsentHubNotExistsException
- InternalErrorException
- PrivilegeException
 
- 
getConsentHubByResourceConsentHub getConsentHubByResource(PerunSession sess, int resourceId) throws ConsentHubNotExistsException, PrivilegeException, FacilityNotExistsException, ResourceNotExistsException Finds existing Consent Hub for facility to which resource belongs.- Parameters:
- sess- perun session
- resourceId- id of resource
- Returns:
- found Consent Hub
- Throws:
- ConsentHubNotExistsException
- InternalErrorException
- PrivilegeException
- FacilityNotExistsException
- ResourceNotExistsException
 
- 
getConsentsForConsentHubList<Consent> getConsentsForConsentHub(PerunSession sess, int id, ConsentStatus status) throws PrivilegeException, ConsentHubNotExistsException Get all consents for chosen ConsentHub with the specified status- Parameters:
- sess-
- id- id of the ConsentHub
- status- status of the consent
- Returns:
- consents for chosen ConsentHub with the specified status
- Throws:
- PrivilegeException
- ConsentHubNotExistsException
 
- 
getConsentsForConsentHubList<Consent> getConsentsForConsentHub(PerunSession sess, int id) throws PrivilegeException, ConsentHubNotExistsException Get all consents for chosen ConsentHub- Parameters:
- sess-
- id- id of the ConsentHub
- Returns:
- consents for chosen ConsentHub
- Throws:
- PrivilegeException
- ConsentHubNotExistsException
 
- 
getConsentsForConsentHubByResourceList<Consent> getConsentsForConsentHubByResource(PerunSession sess, int resourceId) throws PrivilegeException, ConsentHubNotExistsException, FacilityNotExistsException, ResourceNotExistsException Get consents for members assigned to the chosen resource.- Parameters:
- sess- session
- resourceId- id of resource
- Returns:
- consents for corresponding ConsentHub
- Throws:
- PrivilegeException
- ConsentHubNotExistsException
- FacilityNotExistsException
- ResourceNotExistsException
 
- 
getConsentsForUserList<Consent> getConsentsForUser(PerunSession sess, int id, ConsentStatus status) throws PrivilegeException, UserNotExistsException Get all consents for chosen User with the specified status- Parameters:
- sess-
- id- id of the User
- status- status of the consent
- Returns:
- consents for chosen User with the specified status
- Throws:
- PrivilegeException
- UserNotExistsException
 
- 
getConsentsForUserList<Consent> getConsentsForUser(PerunSession sess, int id) throws PrivilegeException, UserNotExistsException Get all consents for chosen User- Parameters:
- sess-
- id- id of the user
- Returns:
- consents for chosen User
- Throws:
- PrivilegeException
- UserNotExistsException
 
- 
getConsentsForUserAndConsentHubList<Consent> getConsentsForUserAndConsentHub(PerunSession sess, int userId, int consentHubId) throws PrivilegeException, UserNotExistsException, ConsentHubNotExistsException Get all consents for chosen User in specified consent hub- Parameters:
- sess-
- userId- id of the user
- consentHubId- id of the consent hub
- Returns:
- Throws:
- PrivilegeException
- UserNotExistsException
- ConsentHubNotExistsException
 
- 
updateConsentHubConsentHub updateConsentHub(PerunSession perunSession, ConsentHub consentHub) throws ConsentHubNotExistsException, PrivilegeException, ConsentHubExistsException Updates the consent hub. Ignores related facilities.- Parameters:
- perunSession- session
- consentHub- consent hub
- Returns:
- updated consent hub
- Throws:
- InternalErrorException
- ConsentHubNotExistsException- if consent hub does not exist
- ConsentHubExistsException- if consent hub with the same name already exists
- PrivilegeException- insufficient rights
 
 
-