Package cz.metacentrum.perun.core.entry
Class ConsentsManagerEntry
java.lang.Object
cz.metacentrum.perun.core.entry.ConsentsManagerEntry
- All Implemented Interfaces:
- ConsentsManager
Consents entry logic.
- Author:
- Radoslav Čerhák invalid input: '<'r.cerhak@gmail.com>
- 
Constructor SummaryConstructors
- 
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 hubvoidsetConsentsManagerBl(ConsentsManagerBl consentsManagerBl) voidsetPerunBl(PerunBl perunBl) updateConsentHub(PerunSession sess, ConsentHub consentHub) Updates the consent hub.
- 
Constructor Details- 
ConsentsManagerEntry
- 
ConsentsManagerEntrypublic ConsentsManagerEntry()
 
- 
- 
Method Details- 
changeConsentStatuspublic Consent changeConsentStatus(PerunSession sess, Consent consent, ConsentStatus status) throws ConsentNotExistsException, PrivilegeException, InvalidConsentStatusException, UserNotExistsException Description copied from interface:ConsentsManagerSet consent status- Specified by:
- changeConsentStatusin interface- ConsentsManager
- 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
 
- 
evaluateConsentsDescription copied from interface:ConsentsManagerEvaluates consents for given consent hub with enforced consents enabled.Service defines whether only active users will be evaluated or expired ones as well. - Specified by:
- evaluateConsentsin interface- ConsentsManager
- Parameters:
- sess- session
- consentHub- consent hub
- Throws:
- PrivilegeException
 
- 
evaluateConsentspublic void evaluateConsents(PerunSession sess, List<ConsentHub> consentHubs) throws PrivilegeException Description copied from interface:ConsentsManagerEvaluates 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. - Specified by:
- evaluateConsentsin interface- ConsentsManager
- Parameters:
- sess- session
- consentHubs- consent hubs
- Throws:
- PrivilegeException
 
- 
evaluateConsentsDescription copied from interface:ConsentsManagerEvaluates 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. - Specified by:
- evaluateConsentsin interface- ConsentsManager
- Parameters:
- sess- session
- service- service
- Throws:
- PrivilegeException
 
- 
getAllConsentHubsDescription copied from interface:ConsentsManagerGet list of all Consent Hubs- Specified by:
- getAllConsentHubsin interface- ConsentsManager
- Parameters:
- sess- perun session
- Returns:
- list of Consent Hubs
- Throws:
- PrivilegeException
 
- 
getAllConsentsDescription copied from interface:ConsentsManagerGel all consents- Specified by:
- getAllConsentsin interface- ConsentsManager
- Parameters:
- sess-
- Returns:
- all existing consents in the database
- Throws:
- PrivilegeException
 
- 
getConsentByIdpublic Consent getConsentById(PerunSession sess, int id) throws ConsentNotExistsException, PrivilegeException Description copied from interface:ConsentsManagerGet consent object with specified id- Specified by:
- getConsentByIdin interface- ConsentsManager
- 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
 
- 
getConsentForUserAndConsentHubpublic Consent getConsentForUserAndConsentHub(PerunSession sess, int userId, int consentHubId, ConsentStatus status) throws PrivilegeException, UserNotExistsException, ConsentHubNotExistsException, ConsentNotExistsException Description copied from interface:ConsentsManagerGet consent for chosen user in specified consent hub with specified status- Specified by:
- getConsentForUserAndConsentHubin interface- ConsentsManager
- Parameters:
- sess-
- userId- id of the user
- consentHubId- id of the consent hub
- status- status of the consent
- Returns:
- Throws:
- PrivilegeException
- UserNotExistsException
- ConsentHubNotExistsException
- ConsentNotExistsException
 
- 
getConsentHubByFacilitypublic ConsentHub getConsentHubByFacility(PerunSession sess, int facilityId) throws ConsentHubNotExistsException, PrivilegeException, FacilityNotExistsException Description copied from interface:ConsentsManagerFinds existing Consent Hub by facility.- Specified by:
- getConsentHubByFacilityin interface- ConsentsManager
- Parameters:
- sess- perun session
- facilityId- id of facility for which consent hub is searched
- Returns:
- found Consent Hub
- Throws:
- ConsentHubNotExistsException
- PrivilegeException
- FacilityNotExistsException
 
- 
getConsentHubByIdpublic ConsentHub getConsentHubById(PerunSession sess, int id) throws ConsentHubNotExistsException, PrivilegeException Description copied from interface:ConsentsManagerFinds existing Consent Hub by id.- Specified by:
- getConsentHubByIdin interface- ConsentsManager
- Parameters:
- sess- perun session
- id- id of the Consent Hub you are looking for
- Returns:
- found Consent Hub
- Throws:
- ConsentHubNotExistsException
- PrivilegeException
 
- 
getConsentHubByNamepublic ConsentHub getConsentHubByName(PerunSession sess, String name) throws ConsentHubNotExistsException, PrivilegeException Description copied from interface:ConsentsManagerFinds existing Consent Hub by name.- Specified by:
- getConsentHubByNamein interface- ConsentsManager
- Parameters:
- sess- perun session
- name- name of the Consent Hub you are looking for
- Returns:
- found Consent Hub
- Throws:
- ConsentHubNotExistsException
- PrivilegeException
 
- 
getConsentHubByResourcepublic ConsentHub getConsentHubByResource(PerunSession sess, int resourceId) throws ConsentHubNotExistsException, PrivilegeException, FacilityNotExistsException, ResourceNotExistsException Description copied from interface:ConsentsManagerFinds existing Consent Hub for facility to which resource belongs.- Specified by:
- getConsentHubByResourcein interface- ConsentsManager
- Parameters:
- sess- perun session
- resourceId- id of resource
- Returns:
- found Consent Hub
- Throws:
- ConsentHubNotExistsException
- PrivilegeException
- FacilityNotExistsException
- ResourceNotExistsException
 
- 
getConsentsForConsentHubpublic List<Consent> getConsentsForConsentHub(PerunSession sess, int id, ConsentStatus status) throws PrivilegeException, ConsentHubNotExistsException Description copied from interface:ConsentsManagerGet all consents for chosen ConsentHub with the specified status- Specified by:
- getConsentsForConsentHubin interface- ConsentsManager
- Parameters:
- sess-
- id- id of the ConsentHub
- status- status of the consent
- Returns:
- consents for chosen ConsentHub with the specified status
- Throws:
- PrivilegeException
- ConsentHubNotExistsException
 
- 
getConsentsForConsentHubpublic List<Consent> getConsentsForConsentHub(PerunSession sess, int id) throws PrivilegeException, ConsentHubNotExistsException Description copied from interface:ConsentsManagerGet all consents for chosen ConsentHub- Specified by:
- getConsentsForConsentHubin interface- ConsentsManager
- Parameters:
- sess-
- id- id of the ConsentHub
- Returns:
- consents for chosen ConsentHub
- Throws:
- PrivilegeException
- ConsentHubNotExistsException
 
- 
getConsentsForConsentHubByResourcepublic List<Consent> getConsentsForConsentHubByResource(PerunSession sess, int resourceId) throws PrivilegeException, ConsentHubNotExistsException, FacilityNotExistsException, ResourceNotExistsException Description copied from interface:ConsentsManagerGet consents for members assigned to the chosen resource.- Specified by:
- getConsentsForConsentHubByResourcein interface- ConsentsManager
- Parameters:
- sess- session
- resourceId- id of resource
- Returns:
- consents for corresponding ConsentHub
- Throws:
- PrivilegeException
- ConsentHubNotExistsException
- FacilityNotExistsException
- ResourceNotExistsException
 
- 
getConsentsForUserpublic List<Consent> getConsentsForUser(PerunSession sess, int id, ConsentStatus status) throws UserNotExistsException, PrivilegeException Description copied from interface:ConsentsManagerGet all consents for chosen User with the specified status- Specified by:
- getConsentsForUserin interface- ConsentsManager
- Parameters:
- sess-
- id- id of the User
- status- status of the consent
- Returns:
- consents for chosen User with the specified status
- Throws:
- UserNotExistsException
- PrivilegeException
 
- 
getConsentsForUserpublic List<Consent> getConsentsForUser(PerunSession sess, int id) throws UserNotExistsException, PrivilegeException Description copied from interface:ConsentsManagerGet all consents for chosen User- Specified by:
- getConsentsForUserin interface- ConsentsManager
- Parameters:
- sess-
- id- id of the user
- Returns:
- consents for chosen User
- Throws:
- UserNotExistsException
- PrivilegeException
 
- 
getConsentsForUserAndConsentHubpublic List<Consent> getConsentsForUserAndConsentHub(PerunSession sess, int userId, int consentHubId) throws PrivilegeException, UserNotExistsException, ConsentHubNotExistsException Description copied from interface:ConsentsManagerGet all consents for chosen User in specified consent hub- Specified by:
- getConsentsForUserAndConsentHubin interface- ConsentsManager
- Parameters:
- sess-
- userId- id of the user
- consentHubId- id of the consent hub
- Returns:
- Throws:
- PrivilegeException
- UserNotExistsException
- ConsentHubNotExistsException
 
- 
getConsentsManagerBl
- 
getPerunBl
- 
setConsentsManagerBl
- 
setPerunBl
- 
updateConsentHubpublic ConsentHub updateConsentHub(PerunSession sess, ConsentHub consentHub) throws ConsentHubNotExistsException, PrivilegeException, ConsentHubExistsException Description copied from interface:ConsentsManagerUpdates the consent hub. Ignores related facilities.- Specified by:
- updateConsentHubin interface- ConsentsManager
- Parameters:
- sess- session
- consentHub- consent hub
- Returns:
- updated consent hub
- Throws:
- ConsentHubNotExistsException- if consent hub does not exist
- PrivilegeException- insufficient rights
- ConsentHubExistsException- if consent hub with the same name already exists
 
 
-